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

Solution 1:

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.

Solution 2:

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.

Solution 3:

I had the same problem. Restart, and while machine is restarting, hold down Command key and the R key simultaneously. Hold down until the Apple icon appears, then release both keys. Four options will come up-- choose Disk Utility. Continue with Erase Free Space procedure as usual.

First attempt worked for me, after 6 months of frustration.

Best of luck! Tim