Disk Utility Won't Erase Hard Drive? Fix It
In this article
If Disk Utility won't let you erase your hard drive, the usual cause is that the drive is mounted, the partition is in use, or the format options are grayed out. In most cases you can fix this by unmounting the drive first, then erasing it. If that fails, you may need to use Terminal or boot into Recovery Mode. This guide walks you through each fix, from the quickest to the most thorough.
What You'll Need
- Your Mac with the drive connected (internal or external).
- Time Machine or another backup of any data you need — erasing permanently deletes everything on the drive.
- Administrator login credentials for your Mac.
- If the drive is your startup disk, you'll need a macOS recovery method (Command+R at startup, or a bootable installer).
Step-by-Step
- Back up anything important. Erasing a drive wipes all data, photos, documents, and apps. Use Time Machine or copy files to another drive before proceeding.
- Open Disk Utility. Go to Applications > Utilities > Disk Utility, or press Command+Space and type “Disk Utility”.
- Select the drive (not the volume). In the sidebar, you'll see two levels: the physical disk (e.g., “APPLE SSD SM0512L Media”) and the volumes on it (e.g., “Macintosh HD”). Click the disk entry — the one that shows the capacity and model — not the volume below it.
- Click the Erase button. It's in the toolbar at the top of the Disk Utility window. If it's grayed out, the drive is likely mounted or is the startup disk — see the next steps.
- Unmount the drive first. If Erase is grayed out, click the “Unmount” button (or right-click the drive and choose Unmount). Wait a few seconds, then try Erase again. This often clears the “in use” lock.
- Choose the correct format. In the Erase dialog:
- Name: give the drive a label (e.g., “Backup”).
- Format: for most modern Macs (macOS 10.13 or later), choose APFS or Mac OS Extended (Journaled) for older Macs or if you need compatibility with Time Machine on older systems.
- Scheme (if shown): choose GUID Partition Map for Intel and Apple Silicon Macs. For a Windows or external drive, you might use “Master Boot Record” — but GUID is safe for Mac use.
- Click Erase. Confirm the warning. The process may take a few seconds to a few minutes depending on the drive size and speed.
- If the drive is your startup disk, you can't erase it while macOS is running. You must boot into Recovery Mode:
- Restart your Mac and immediately hold Command+R (Apple Silicon: hold the power button until you see “Loading startup options”).
- Choose Disk Utility from the Recovery window.
- Now select the startup disk and erase it as above. Then quit Disk Utility and reinstall macOS from Recovery.
- If Erase still fails, try Terminal. In Disk Utility, go to File > New > New Connection, or open Terminal from Applications > Utilities. Run
diskutil listto see the disk identifier (likedisk2). Then unmount it withdiskutil unmountDisk /dev/disk2(replace with your identifier). Then erase withdiskutil eraseDisk APFS “NewName” /dev/disk2— this wipes the whole disk. Be very careful to use the correct disk identifier. - If the drive is physically locked or read-only, check for a physical write-protect switch (on some external drives) or a firmware password. In that case, you may need to unlock the drive first (e.g., in Disk Utility > File > Unlock, or via the software that came with the drive).
Common Mistakes
- Erasing the volume instead of the disk. If you select “Macintosh HD” (the volume) and erase it, you only erase that partition — the disk itself remains with its partition map, and you may still see “Erase” grayed out on the disk. Always select the top-level disk entry.
- Forgetting to unmount. If the drive is mounted (shown in Finder), Disk Utility often refuses to erase it. Unmount first — not eject, just unmount.
- Choosing the wrong format. If you pick “Mac OS Extended” on a drive that was previously APFS, it will work, but if you pick “APFS” on a drive that needs to be readable by older Macs, it may not be recognized. Check what your Mac supports.
- Not backing up. This is the most common regret. Erase is permanent — there’s no undo.
Tips
- If you’re erasing an external drive, make sure it’s connected directly to your Mac (not through a hub) and that the cable is secure. A flaky connection can cause errors.
- If you plan to use the drive with both Mac and Windows, choose “ExFAT” as the format — it works on both systems without extra software.
- For a secure erase (to prevent data recovery), Disk Utility on modern Macs doesn’t offer that option anymore. Instead, you can use Terminal’s
diskutil secureErasecommand, but note that on solid-state drives (SSDs) it’s not effective due to wear leveling — for SSDs, just erase normally. - If Disk Utility won’t even show the drive, restart your Mac and try again. Also try a different port or cable.
Troubleshooting
If Erase is still grayed out after unmounting:
- Check if the drive is the startup disk. If so, you must boot into Recovery Mode as described in Step 8.
- Check if the drive has a firmware password. Go to System Settings > Privacy & Security > Firmware Password (or use Recovery) to disable it, then try again.
- Try restarting your Mac and then opening Disk Utility — sometimes a background process (like Spotlight indexing) holds the drive.
If Disk Utility reports “Erase process has failed”:
- Look at the exact error message. “Input/output error” usually means a hardware problem — try a different cable or port, or use Disk Utility’s First Aid to check the drive.
- If the drive is an external drive with its own power supply, make sure it’s powered on and not going to sleep.
- Try using Terminal’s
diskutil eraseDiskcommand — sometimes it works when the GUI fails.
If the drive doesn’t appear at all in Disk Utility:
- Go to Disk Utility > View > Show All Devices (or press Command+2) to see all physical disks.
- If it still doesn’t show, the drive may be physically damaged or not properly connected. Try a different Mac or a different cable.
Frequently Asked Questions
Why is the Erase button grayed out in Disk Utility?
The most common reason is that the drive is mounted or is the current startup disk. Unmount the drive first, or boot into Recovery Mode if it’s your startup disk.
Can I erase a hard drive that has a Time Machine backup on it?
Yes, but you’ll lose the backup. If you want to keep the backup, copy it to another drive first, or use a different drive for erasing.
What format should I choose when erasing for a Mac?
For macOS 10.13 or later, use APFS. For older Macs or if you need compatibility with older Time Machine, use Mac OS Extended (Journaled). For a drive that will be used with both Mac and Windows, use ExFAT.
How do I erase a drive that is write-protected?
Check for a physical lock switch on the drive casing. If there’s no switch, the drive may have a firmware lock — try unlocking it in Disk Utility (File > Unlock) or via the manufacturer’s software.
Will erasing a drive remove viruses or malware?
Yes, erasing the drive removes all data, including any malware that was stored on it. However, if the malware is in the firmware or the drive’s controller, a simple erase may not remove it — that’s rare, but if you suspect it, contact the drive manufacturer.
Can I erase an external drive that is in use by another app?
Close all apps that might be using the drive (like Time Machine, Spotlight, or a backup app). You can also unmount the drive first — if an app is using it, you’ll get an error, and you’ll need to quit that app.