Mac Secure Erase Free Space

I was trying to wipe the free space of an external USB 3.0 disk in OS X (Yosemite) disk utility. However, I receive the following error: EDIT: The disk is formatted as GUID / Mac OS Extended (Journaled) and 1.1 of 2.0 TB are occupied.


If you’re selling an old Mac, a spare hard drive, or you’re just quite paranoid about your deleted data, you’re either familiar with—or should be familiar with—the Erase Free Space button on the Erase tab in Disk Utility (found in your Applications -> Utilities folder).

Erase

When you click this button, you’re presented with three options for securely erasing the free space on your hard drive: write over the free space with zeros (fast and relatively safe), write over the free space three times (more secure, very slow), or write over the free space seven times (extremely slow).

  1. SecureErase freespace level device Erase, using a 'secure' (but see the NOTE below) method, either a whole-disk (including all of its partitions if partitioned), or, only the free space (not in use for files) on a currently-mounted volume. Secure erasing makes it harder to recover data using 'file recovery' software.
  2. Here's the video tutorial that explains how to securely wipe the free space on your Mac using Disk Drill.Download for free: https://www.cleverfiles.com/disk.

I use this feature whenever I sell an old machine. First I format the drive and install a fresh copy of macOS, then I use Disk Utility to erase the free space (typically the one-time write-with-zeros option). This gives me a good sense of security, as it would take a team of dedicated professionals, and possibly special hardware, to have some chance of recovering any of my deleted data—though I really only care about a few financial files, and those are kept on an encrypted disk image, so they’re probably safe anyway.

Use Terminal to securely erase a drive

What if you want to do this from Terminal instead? In Terminal, a program named diskutil provides most of the features of macOS’s Disk Utility.

(Please note that, as with many Terminal commands, there’s a chance of Really Bad Things happening if you make a mistake with the following instructions. Proceed with caution, and make sure your backups are current before you try any of the following.)

How To Wipe A Mac Hard Drive

To find out about diskutil in detail, type man diskutil at the Terminal prompt. Within the man pages, you’ll find the explanation for how to securely erase a disk’s free space using diskutil:

But how do you figure out what to list for device, which is the disk (or partition) that has the free space you’re trying to securely erase? diskutil can provide that information, too. Just use diskutil list to see a list of all drives and partitions. On the far right, you’ll see an IDENTIFIER column; that column contains the identifier that diskutil needs. Here’s an example of the list output on my machine:

There’s just one last bit of information you need to know to erase the free space on a drive from the command line. In Unix, all devices appear as part of the file system tree, and in macOS, they’re all listed in the /dev directory. So if I want to use diskutil to erase the free space on my Apple_HFS Untitled volume on my external drive, using the single-pass method, the final command would look like this:

diskutil secureErase freespace 1 /dev/disk2s1

Warning! It’s critically important that you include the freespace portion of that command. If you don’t, diskutil will happily start securely erasing the entire disk, instead of just the free space! Yes, that’s a Really Bad Thing, especially because it will be securely erased, meaning there’s no chance you’ll be able to recover the data.

Former Macworld Senior Editor Rob Griffiths founded Mac OS X Hints. He’s now master of ceremonies at Many Tricks Software.


Source link

You cannot use 'diskutil' to erase the free space anymore because Apple has disabled this feature because:

Erase Free Space Windows

Free space on a mac


  • It is harmful to an SSD
  • It is not needed when an SSD is using TRIM (since the blocks are erased fairly quickly after data has been deleted).
  • Due to how SSDs work internally erasing the 'free' space may not overwrite the data you are looking to shred because once a NAND block is recycled the OS doesn't have access to that particular block.


What you want to do is not possible. TRIM happens to do exactly what you intend which is 'shredding' the data once it has been deleted. The SSD's internal garbage collection routines will do the same thing eventually if TRIM is not enabled. If you don't have TRIM enabled, then make sure to uncheck 'Put hard disk to sleep when possible' in the Energy Saver System Preferences so that the SSD will remain powered on when the computer is not in use so that the SSD's garbage collection routines will have time to run to perform maintenance on the SSD which includes zeroing out the recycled NAND blocks.

Free

How To Wipe Free Space


Mac Secure Erase Free Space Terminal


How To Stop Secure Erase Mac

Sep 7, 2020 10:23 AM