macOSDrivesTroubleshooting5 min

External drive won't erase or unmount on a Mac? Here is how to fix it

You plug in a USB stick or an SSD, Disk Utility shows it, and Erase fails with "Couldn't unmount disk", "Operation not permitted" or "Resource busy". Sometimes the drive does not appear at all, only a greyed-out entry. The drive is almost never broken. Something still has it open, or Disk Utility is looking at the wrong level.

Erase the device, not the volume

  1. In Disk Utility choose View → Show All Devices. The sidebar now shows the physical disk (for example "SanDisk Ultra Media") above its volumes.
  2. Select the physical disk, not the volume under it, and click Erase.
  3. Pick a scheme (GUID Partition Map) and a format: ExFAT if the drive is shared with Windows, APFS if it stays on Macs.

Erasing the volume alone fails whenever the partition table is damaged, which is exactly the case after a Windows installer, a Linux image or an interrupted copy.

Force the unmount

If the error is still "Couldn't unmount disk", something is holding a file open: Spotlight indexing, Time Machine, a Finder window or a stuck copy. Terminal can take the disk away from all of them.

diskutil list
diskutil unmountDisk force /dev/diskN
diskutil eraseDisk ExFAT UNTITLED GPT /dev/diskN

Replace diskN with the identifier shown next to your drive in the first command (external drives are usually disk4 or higher). Double-check it: the erase command does exactly what it says, on whichever disk you name.

When even Terminal refuses

Drives from Linux or Raspberry Pi images, drives with a write-protect flag, and drives whose controller reports a wrong size often produce "Operation not permitted" even with sudo, because macOS runs the command inside its own sandbox. Restore My USB is our non-sandboxed Mac app built for exactly this: it force-unmounts, wipes the partition table and formats the drive in one step, and its health check tells you when the drive itself is the problem so you stop wasting time on it.

An SD card that formats fine but shows the old files after every reformat has a locked controller. It is finished; replace it.

Restore My USB