Apple - "Couldn’t create temporary file." error when erasing free space on external disk

My first thought would be that it is a permissions error of some kind…

Either

  • the Drive is formatted as NTFS or ExtFS etc
  • The System doesn't have write permissions to the device itself

For the first, the simplest, if not cheapest solution would be something like Paragon NTFS or ExtFS or Tuxera NTFS

If it is a pure permissions/ownership issue, then for a removable drive the simplest fix would be to set it to 'Ignore Ownership' from the Get Info window. This should be sufficient to allow the system to write to the drive in order to securely erase.


If you run disk utility from the command line, you get the same behaviour with the following output:

# where `Title` is the name of the drive.
diskutil secureErase freespace 0 /Volumes/Title/

Started erase on disk1s2 Untitled
Creating a temporary file
Securely erasing a file
Creating a secondary temporary file
Mounting disk
Error: -69847: Couldn't create temporary file
Underlying error: 1: POSIX reports: Operation not permitted

You can fix this by running the command with sudo.