Erase Free Space on a Mac Hard Drive with OS X Disk Utility to Prevent File Recovery

Aug 21, 2013 - 7 Comments

Use Disk Utility to erase free space on a Mac hard drive The Mac OS X Disk Utility app provides an ability to erase free space on traditional hard drives, which overwrites vacant disk space on the drive to prevent any potential recovery of deleted files (that is, files that have been removed traditionally, rather than through secure methods). For most users this is an unnecessary procedure, but if you plan on transferring ownership of a traditional hard drive or computer to someone else and you don’t want to securely format the entire hard drive first, this provides an alternative option that instead allows you to securely overwrite and remove only the files that have been deleted.

Yes, this only works on traditional hard drives of the spinning platter variety, which is typical for MacBook Pro, Mac Mini, and iMac models, and is the case with most external hard drives used for backups. This option is not available for flash-memory based SSD models (like those bundled within the MacBook Air, Retina MacBook Pro) because those drives use the TRIM function to quickly remove and recover blocks instead, which has the side effect of automatically preventing file recovery fairly quickly – often within 10 minutes of emptying the Trash.

Erasing Free Space on Hard Drives in Mac OS X

Here is how to erase free space on a Mac Hard Disk with Disk Utility:

  1. Launch Disk Utility, found within /Applications/Utilities/ or through Launchpad
  2. Connect the hard drive if it’s an external disk, and then select the hard drive from the left side menu
  3. Choose the “Erase” tab, then choose the “Erase Free Space” option
  4. Erase free space on a hard drive

  5. Select the desired level of erasure and choose “Erase Free Space” to begin the process of overwriting the free space on the hard drive

The three Erase Free Space options are as follows:

  • Fastest – the quickest option, this does a single pass write of a bunch of zeros over the unused portion of the hard drive
  • Secure (middle option) – a triple pass erasure, this writes zeros over the unused space three times
  • Most Secure – the most secure option that also takes the longest, this writes data over the free space a total of 7 times

Erase free space in Mac OS X to prevent file recovery

Choose whichever option is most appropriate for your needs, but it’s generally recommended to use the “secure” or “most secure” option if you intend on transferring ownership of a hard drive, or if you suspect a hard drive that once contained important data has the chance of being stolen or misused. Keep in mind that the latter two options take longer to complete, because they are performing the same overwrite task either 3 times or 7 times.

These options are the exact same as what’s presented by general secure formatting of an entire hard drive. Of course the difference here is that this trick focuses only on securely erasing the free space (i.e.; focusing on files that have been deleted through Trash), and has no impact on the hard drives other contents. This makes it a great solution for situations where you clean up an existing OS X installation for a new owner and want to preserve things like installed applications, but do not want any of your deleted personal data to be potentially recovered by anyone.

Again, this is largely unnecessary for most users, but it is good practice to erase free space on any traditional hard drive that will have ownership transferred. This can also provide for a delayed alternative to using the secure empty Trash function of OS X if you decide later that you want to prevent the recovery of some files that were deleted. Finally, if you’re absolutely determined to complete this process on an SSD, you can use this workaround to accomplish secure erase on SSD volumes, though it’s really not necessary due to how SSD drives function, and it’s also not recommended because it places unnecessary writes on an SSD drive, which could reduce it’s potential lifespan. Nonetheless it’s worth mentioning for the sake of being thorough.

You’ll notice this feature is available in all versions of Mac OS X with the exception of El Capitan, where it was removed from Disk Utility presumably because many of the popular Macs ship with SSD drives by default.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Security, Tips & Tricks

7 Comments

» Comments RSS Feed

  1. Tara Sparshu says:

    I’ve tried this but after trying to erase for about half an hour it tells me it cannot be completed as it cannot create temporary files. Any idea how to fix this?

  2. Lucian says:

    After erasing free space,the hard drive now has actually gained another 6 GB instead of freeing space…How is that possible? Is there some sort of a repository or folder that was created during the erase process? If so, where is it and can it be deleted?

  3. CJ says:

    Oh my, thank you so much!! This has been a complete lifesaver. Thanks for including the pictures – as they were really helpful. Again, THANK YOU.

    P.S.
    Did I say thank you?!

  4. Marcus says:

    While doing this, disk utility created this disk image…

    .com.apple.diskmanagement.EFTFile1.sparseimage

    What should be done it and where can it be found ?

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site