I accidentally deleted my efi partition, which I now know is bad news bears. I found a guide here to restore it without losing data, but even though I'm booting from usb and have unmounted all partitions, I'm still getting the error gpt remove: unable to open device "disk0": resource busy.

Everything I'm reading says to boot from an OSX usb installer disk, and use diskutil unmountdisk disk0 and then gpt will work. I've definitely done both of these things but it's still telling me the disk is mounted...

Could someone recommend anything else to try? Much thanks

  • The drive you'er booted from may be disk0, so check it and if need be use Disk Utility to see what disk number the target disk actually is. Commented Jul 5, 2015 at 18:41
  • Thanks, but I thought of that too. I'm booted from disk1, and I am trying to work on disk0. Also, in diskutil list it says that partition 0 is still mounted (that's what the * next to it means right?)
    – jamzsabb
    Commented Jul 5, 2015 at 18:46
  • No, the asterisk does not mean it's mounted. Are you sure you're booted from disk1 and disk1 is the USB device. Assuming disk0 is the internal disk, is it using Core Storage? Commented Jul 5, 2015 at 19:09

3 Answers 3


I figured it out, my hd was getting mounted under Volumes and had to be removed with diskutil unmount /Volumes/Macintosh\ HD

Don't know why unmountdisk wasn't fixing this but whatever

  • This bit me as well. Thanks for the heads-up! Commented Jun 5, 2017 at 2:44

If none of the disk utility and external boot options are working for you try this:

  • Run diskutil list to get the device address
  • Use sudo diskutil unmountDisk force /dev/disk2 to force unmounting (replace disk2 with the right name from the first step!)

Source: http://technology.siprep.org/fix-for-disk-erase-failed-couldnt-unmount-disk/


There are two different kind of boot modes in computers, Legacy BIOS-based and Unified Extensible Firmware Interface (UEFI). UEFI is the main booting mechanism used recent computers, while old computers uses BIOS. UEFI mode requires the system to be installed on a GUID partition table (GPT) disk, and BIOS the master boot record (MBR) disk. Windows won’t allow you to restore system from UEFI based computer to bios computer, and vice versa. Some UEFI based computer supports both UEFI boot mode and Legacy BIOS-compatibility mode, so this error may happen even when you restore system backup to the original computer being backed up.

  • Macs have never used BIOS, ever.
    – Tetsujin
    Commented Oct 21, 2016 at 16:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .