If you’re selling an old Mac with a hard drive, 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 Empty Space
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.
Editor’s note: This Terminal tip originally ran in March 2009 and is only useful for mechanical hard drives and not the SSDs found in newer Macs.
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).
This feature cane used whenever selling an old machine with a hard drive. Format the drive and install a fresh copy of macOS, then 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.
- How to securely erase free space on a hard drive (Mac) January 9, 2017 From time to time, I need to clean off the contents of a hard drive on one of my Macs—most often this is the case prior to selling the mac or giving it to someone else.
- Now mac has only one partition which is the startup volume. The problem is the previous partition created a free space upon removing it and it is not allocated to anyone, now when I try to delete the free space, Disk Utility fails to carry out the opertaion!
- ShredIt X – Mac OS X; Instructions: How to Erase Free Space. There are three ways to erase free space using ShredIt X. Using Drag and Drop. Drag the Hard Drive icon onto the ShredIt Icon and drop it;. Using the Buttons. Double-click the ShredIt X Icon to start the app. Click the “Shred Freespace” button on the main dialog.
- There are two methods to check available space on a hard drive: 1. Access the Apple menu and select About this Mac. Choose the Storage tab. More detailed information can be found within the Disk Utility feature, which is located in the Applications folder under Utilities.
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.)
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:
IDG
There’s just one last bit of information you need to know to erase the free space on a hard 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
Erase Free Space Mac El Capitan
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.