There are a few methods to force your Mac to erase a hard drive. The easiest is to use Disk Utility, which comes pre-installed on all Macs. Open Disk Utility, select the drive you want to erase, click “Erase” and choose a format. You can also erase from the Terminal by using the “diskutil” command with the “eraseDisk” argument. For more security, you may want to completely overwrite the drive by using Disk Utility’s “zero-out data” option or a third-party tool like Darik’s Boot and Nuke (DBAN).
At some point, you may find yourself needing to completely wipe and erase the contents of a hard drive on your Mac. There are a few reasons why you might need to do this:
- You’re selling your Mac or passing it down to someone else, and you want to remove all personal data first.
- You’re experiencing performance issues on your Mac and want a fresh start.
- You suspect your Mac has been infected with malware, and want to do a clean install of macOS to remove all traces.
Whatever the reason, macOS makes it relatively easy to perform a complete drive erase. In this article, I’ll go through the different methods you can use to securely erase a hard drive on a Mac.
Use Disk Utility to Erase a Drive
The simplest way to erase a drive on Mac is by using Disk Utility. Disk Utility is an app included with all versions of macOS, located in the /Applications/Utilities folder.
Here are the steps to erase a drive with Disk Utility:
- Open Disk Utility.
- Select the drive you want to erase from the list of available drives on the left side.
- Click the “Erase” button near the top of the Disk Utility window.
- Choose a format to erase the drive with. For Mac-only drives, choose “Mac OS Extended (Journaled).” For drives that will also be used with Windows PCs, choose “ExFAT.”
- You can also choose to name the erased drive.
- Click the “Erase” button at the bottom of the window.
That’s all there is to it! Disk Utility will quickly format the drive, wiping it clean in the process.
Some things to keep in mind when using Disk Utility to erase a drive:
- Erasing the drive does NOT securely delete any data. It simply removes the references to the data on the drive so it appears empty.
- To prevent erased data from being recovered, you need to completely overwrite the drive by using the secure erase options I’ll cover next.
- Erasing the startup drive will require rebooting from the Recovery HD partition or an external drive first.
Zero-Out Data Option
To help prevent erased data from being recovered, Disk Utility provides an option to overwrite the drive with zeros during the erase process. Here’s how to enable it:
- Follow the same steps to launch Disk Utility and select the drive you want to erase.
- Choose Security Options from the Erase menu.
- Check the box next to “Zero Out Data.”
This will take much longer than a standard erase, but it will writes zeros to the entirety of the drive, making it much more difficult for erased data to ever be recovered.
Use Terminal to Securely Erase a Drive
To securely erase a drive at the command line, you can use the diskutil tool in the macOS Terminal.
Here are the steps to follow:
- Launch the Terminal app, located in /Applications/Utilities/
- Type diskutil list and press Return. This will show you a list of the available drives.
- Identify the disk identifier for the drive you want to erase, usually in the format /dev/disk#
- Type sudo diskutil eraseDisk JHFS+ DriveName diskIdentifier, replacing “DriveName” with the name you want, and “diskIdentifier” with the proper identifier.
- Press Return. Enter your administrator password when prompted.
This will perform a standard reformatting erase of the drive. To do a secure erase, use these steps instead:
- Type sudo diskutil secureErase freespace 0 /dev/diskX (use the real disk identifier).
- Press Return and enter your password when prompted.
Using the secureErase method will overwrite the existing data to prevent it from being recovered. This can take a long time to run on a large drive, but is the most secure option.
Erase Using Third-Party Tools
While Disk Utility and terminal commands work well for general purpose drive erasure, there are third-party tools available that can completely overwrite a drive in a much more secure manner.
Two popular options are:
- Darik’s Boot and Nuke (DBAN): An free bootable tool that provides multiple options for securely overwriting drives.
- DiskWarrior: A popular Mac disk repair tool that includes options for secure erase as well.
These tools boot your Mac from an external device, then provide options to securely wipe your Mac’s internal drive using military-grade deletion algorithms. This is the most secure option if you are concerned about forensic recovery of erased data.
Recover Data After Erasing a Drive
So you just erased a drive, and now you’ve realized there was important data on it you still need? Don’t panic! As long as you only performed a standard drive format (and did not use a secure erase option), you may still be able to recover the “deleted” data.
Here are a few options:
Data Recovery Software
There are many data recovery apps available for Mac, both free and paid. Some examples include:
- Disk Drill
- EaseUS Data Recovery
- Stellar Data Recovery
- Data Rescue
These tools scan the drive and attempt to reconstruct the previous data, even if the drive has been reformatted or erased. Just do NOT write any new data to the drive, as this may overwrite the data you want to recover.
Take to Data Recovery Service
For difficult cases of data loss, you may want to turn to a professional data recovery service. They have specialized tools and “clean rooms” that can recover data from even seriously corrupted drives. Examples are DriveSavers, Gillware, Secure Data Recovery, and Desert Data Recovery.
However, services like this are not cheap. Expect to pay anywhere from $500 to over $2000 for professional data recovery.
Tips for Erasing Drives on Mac
Here are some useful tips to keep in mind when securely erasing a drive on Mac:
- Back up important data first. Before wiping a drive, always copy any important files somewhere else, like an external hard drive or cloud storage.
- Use a bootable drive if erasing the startup disk. You can’t erase the current startup drive while the Mac is booted from it. Use the Recovery HD or a bootable USB drive instead.
- Zero-out for deleted file security. The only way to securely prevent deleted files from being recovered is to use Disk Utility’s zero-out option.
- Consider a 3rd party tool for maximum security. Apps like DBAN and DiskWarrior offer multiple levels of secure deletion to prevent forensic data recovery.
- Act fast if data was erased accidentally. Immediately copy the drive to another device; this protects the data against being overwritten.
Following these best practices will ensure no trace of your sensitive data remains after erasing a hard drive on your Mac.
Frequently Asked Questions
Here are some common questions about erasing drives on Mac:
Is formatting the same as erasing a drive?
Formatting and erasing a drive are essentially the same operation – both remove the file system structure from the disk and re-initialize it. However, neither actually deletes or overwrites the existing data – it just marks it as deleted by removing the indexes and directory structure pointing to it.
How long does it take to erase a hard drive?
A standard format/erase of a drive with Disk Utility typically takes just a few seconds. If you select the zero-out data option, it can take several hours for large hard drives or SSDs. Using a third-party secure erase tool, it may take over 24 hours to fully overwrite each sector multiple times.
Can I recover data after erasing a drive?
If you only performed a basic format of the drive, recovery software should be able to retrieve most of the original files. But if you did a full secure erase, overwritten the data with zeros, or used multiple passes, it becomes nearly impossible to recover anything usable.
What’s the best free tool to erase a hard drive?
Darik’s Boot and Nuke (DBAN) is a great free option for completely wiping a drive. It boots from external media and provides multiple levels of secure overwriting algorithms.
What types of hard drives can Disk Utility erase?
Disk Utility can erase all common drive formats used with Mac, including SATA, SSD, NVMe, external USB drives, Thunderbolt drives, and RAID arrays. The only requirement is that the Mac can see and mount the drive.
What should I do before selling or donating my Mac?
Before letting someone else take ownership of your Mac, you’ll want to fully back up your data, erase the hard drive, and then reinstall macOS to wipe all personal data. Be sure enable Find My Mac and log out of iCloud & other accounts too.
While erasing a hard drive may seem like a straightforward task, you need to take the proper steps to ensure no personal data can be recovered. Using Disk Utility’s secure erase options, erasing from the Terminal with diskutil, or using a dedicated bootable tool like DBAN will securely overwrite your sensitive files before disposal or donation of your old Mac. Just be sure to have a current backup, as the data will be unrecoverable after a thorough scrubbing.