Fix for disk erase failed couldn’t unmount disk

If you're trying on a Mac using Disk Utility to erase a hard drive and it won't unmount, giving you an error similar to Disk erase failed. Couldn't unmount disk, then you may have to force an unmount through the terminal.

Launch up Terminal.app (through /Applications/Utilities or through a Spotlight search).

Then paste in the command:

diskutil list
to list out the different disks. You should see some disks appear like /dev/disk0, /dev/disk1, /dev/disk2.

Find the one you want to force unmount. For this example, let's say it's /dev/disk2.

Run a command similar to this one

sudo diskutil unmountDisk force /dev/disk2
If you're prompted for a password, enter it (yes, your account does need to have administrative privileges). You should not physically unplug the drive.

You should now be able to erase the drive.

57 thoughts on “Fix for disk erase failed couldn’t unmount disk”

  1. Excellent post! It worked the 1st time for me, and i also had to stumble across the interweb minefield before finding this solution. Thank you !

    -Bobby

  2. I tried this method, but now it says “Forced unmount of disk2 failed: at least one volume could not be unmounted” Please help, I would like to erase my hard drive so i can do a clean install of el Capitan

  3. Whenever I go to type the password, it has a round dot and won’t let me type anything. Do you know what might be causing this?

  4. In the terminal, there’s no visual feedback for passwords. Just keep typing your password and then hit Enter when you’re done. Your password is being accepted. There are just no dots or asterisks to indicate so.

  5. I have been trying off and on for weeks to get rid of this error. I searched high and low and your directions were the easiest to follow and actually worked!! Thank you very very much.

    1. Came across this same problem after my MacBook Pro freezes after logging in and won’t go to my desktop. I’ve tried the original text and the one you suggested to Jon and it still says ‘command not found’
      Any ideas what’s up?

      1. The only thing I can think of is that you’re accidentally typing it wrong. I would suggest copy and paste. You may have to still change the number (it may not be /dev/disk2 but /dev/disk3 or something else), but most terminal “command not found” errors I’ve seen have been due to people not typing exactly what they’re seeing (no space where there should be one, or an I instead of 1, or lowercase instead of uppercase, etc.), so copy-and-paste is probably the best way to go.

          1. Another possibility is that you’re trying to run the sudo command from a non-admin account. Standard accounts do not have enough privileges to escalate using sudo.

  6. I was trying to install tacos sierra on my 2011 iMac 21.5″ and it crashed my computer, and it just kept restarting. I foolishly tried to download it on my macbook pro 2012 13″ also. So now i have two broken internal hard drives. Have an external hard drive, which i used to boot up the iMac with el capitan, but i am still in the process of trying to erase the internal drive. I tried this but it still didn’t work, it says “unable to unmount 1 or more part” or something like that. I need to get this one fixed and get the internal one running again, because i can’t have two computers running off one external drive, and i still need to fix my macbook. PLEASE HELP!! Thank You!

    1. Sierra is still beta, right? I wouldn’t have installed it on an everyday use (production) machine, but I guess what’s done is done. If the external El Capitan absolutely refuses to unmount the disk, can you try booting into Recovery Mode (hold down Cmd-R while booting up) and then using Disk Utility there?

      If that doesn’t work, I’d actually seriously consider booting Ubuntu or some other non–Mac OS X operating system to reformat the drive that way first, and then use Disk Utility to format the drive back to HFS+ and reinstall OS X.

      1. i managed to install el capitan on the external drive and use terminal to force erase the disk. from there i booted the iMac on its original OS X lion and from there downloaded the public beta of mac os sierra, which i was supposed to in the first place, but i was just impatient. Im just happy i didn’t have any files on the computers, so nothing was lost, just my time it took to fix them. Right now i have the macbook booted on the external on el capitan and I’m going to go through the whole process over again for this computer.

  7. I had hoped…. 🙁

    Didn’t work for me – I’ve been trying anything and everything to get my external to show back up so I could start over!

    Unmounting disk
    Wiping volume data to prevent future accidental probing failed.
    Operation failed…

  8. I knew there had to be an “easy” way to do this, and this was it. Thanks so much for the quick and easy tip. Worked like a charm for me to reformat an external drive. 100x easier than the other ways I read to solve the unmount issue, like boot disks, etc.

  9. Is there a way to work around needing a password? I was an idiot and renamed my home folder and now I’m trying to format my computer because it doesn’t recognize me or my password so not only can I not get into any admin stuff to fix the original issue, but I get the cannot erase/unmount error, and my password doesn’t work so I can’t use the terminal to force it. u_u

    1. You may be able to rectify this issue by booting into single user mode, and then (after the fsck scan) renaming the home folder back.

  10. i have the same prob and am doing this coz i forget ma macbook password and now !! i can’t complete this w/o a password !! wt to do pls i need help ..

  11. when i try to unmount i get an error saying “at least one volume could not be unmounted”. I tried the other workaround; hdiutil detach, and i get an error saying “Resource busy”

    please advise

  12. Your instructions are clear, and almost successful in my case…
    Within the terminal it was successful, but when I go back to Disk Utility to format the hard drive to ExFat it still says “Disk Erase failed with error: Invalid Request.” Any ideas?
    (I am trying to format a windows pre-formatted hard drive to use on my mac).

  13. I’ve done this procedure several times, it says it was successful: “Forced unmount of all volumes on disk2 was successful” but it’s not showing up in finder, and the disc utility says it’s uninitialized, still fails disc utility erase, and after hitting the erase button it tries, but fails: Unmounting disk
    Operation failed…
    Unable to write to the last block of the device.

    I watched the video posted here that says to partition it, but my partition button is greyed out, what can I try next?

    1. If it successfully unmounts the volumes, the volumes are unmounted and thus should not show up in Finder.

      Keep it unmounted and then erase in Disk Utility.

      1. it still fails disc erase in utility, this drive is almost brand new, it’s hardly been used, is there anything else I can try?

        1. Try booting up Ubuntu and reformatting the drive (as FAT32) and then booting into Recovery Mode and re-reformatting it (as HFS+).

  14. Is there a way to restore the data prior to erasing using the steps above?
    Current error: Source volume is read-write and cannot be uncounted, so it can’t be lock copied.
    Thanks.

    1. The error says “so it can’t be lock copied”? I’ve never seen that error and can’t find it in a Google search. What’s the exact error message? And what are you trying to do? Get data off the volume before erasing it? I’m unclear what you mean by “restore the data.” Do you mean “save the data”?

  15. Thanks for the post. I’ve tried everything you recommended (including in the comments section), and have not had success. Here’s what I did:

    Big-Mac:~ admin$ diskutil list
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *500.1 GB disk0
    1: EFI EFI 209.7 MB disk0s1
    2: Apple_HFS iMac 499.2 GB disk0s2
    3: Apple_Boot Recovery HD 650.0 MB disk0s3
    /dev/disk2
    #: TYPE NAME SIZE IDENTIFIER
    0: FDisk_partition_scheme *1.0 TB disk2
    1: Apple_HFS Beatrice 910.3 GB disk2s1
    2: Windows_NTFS For Windows 89.9 GB disk2s2
    Big-Mac:~ admin$ sudo diskutil unmountDisk force /dev/disk2
    Password:
    Forced unmount of disk2 failed: at least one volume could not be unmounted
    Big-Mac:~ admin$ hdiutil detach /dev/disk2
    hdiutil: detach: timeout for DiskArbitration expired
    Big-Mac:~ admin$

    Any help would be appreciated! 🙂

    1. Yeah, unfortunately, no idea on that. Honestly, since that appears to be an external drive, I would shut down the computer and then just unplug the drive.

  16. I have tried all the methods listed in previous comments. When trying to erase the disk it gives me the “could not unmount disk” error. When using the sudo command it gives me the error of “at least one volumes could not be unmounted”. I used to have a boot camp windows 7 that was deleted a year ago If that would effect it. I am not using any external drives

  17. After trying for several hours, came across this solution and it worked perfectly, thanks much for posting this! I am wondering now if I could have simply “ejected” my external Seagate hard drive to come up with the same solution – since drive disappeared from desktop similarly when I choose to eject drive. Either way, glad this worked.

  18. How do you know which one to choose to unmount? After typing diskutil list there are 14 dev/disk? Trying to erase hard drive and had “can’t unmount” error.

  19. Hi Alan,

    Trying to erase my hard drive and it won’t unmount: Disk erase failed. Couldn’t ummount disk.

    The diskutil list command brought up just /dev/disk0 (plus disk0s1, disk0s2 and disk0s3). The command “sudo diskutil unmountDisk force /devdisk0” failed because “at least one volume could not be unmounted.”

    I followed your further guidance below to another blog and the command “hdiutil detach /dev/disk0” resulted in the following message: “hdiutil: couldn’t unmount ‘disk0’ – Resource busy.”

    I followed your additional further guidance below and see the command “sudo lsof | grep /Volumes/myDrive” – what is supposed to be substituted in for “myDrive”? I’ve tried many things and everything simple ends up resetting the Terminal for a new command query.

    1. /dev/disk# is where the drive is physically, and /Volumes/NAMEOFDRIVE is where you can actually find the drive in Finder.

      Three quick ways to find that:

      1. Type /Volumes/ and then hit the Tab key on your keyboard twice to see what the options are.

      2. Type mount and hit Enter to see what paths things are mounted to.

      3. Type df -h and hit Enter to see free disk space (but this will also show the mounted paths).

Leave a Reply

Your email address will not be published. Required fields are marked *