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.


Posted

in

by

Comments

75 responses to “Fix for disk erase failed couldn’t unmount disk”

  1. Randall Avatar
    Randall

    This worked perfectly for me! After searching for a very long time through forums of people suggesting basic things or trying to make others feel ignorant this solution worked!
    Thank you so much. I now have a useable disk where before it would not mount and could not be formatted or erased. Running OS X 10.9.5. I will be linking this solution to other forums in the future.
    http://technology.siprep.org/fix-for-disk-erase-failed-couldnt-unmount-disk/

  2. Bobby Avatar
    Bobby

    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

  3. Lissett Avatar
    Lissett

    Worked for me as well! Thank you so much 🙂 Very clear instructions!

  4. Jason Avatar
    Jason

    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

  5. Alan Siu Avatar
    Alan Siu

    Odd. I’ve never seen that. I did Google your error, and came across this workaround. Give it a shot:
    http://emsooriyabandara.blogspot.com/2014/11/solved-external-hard-drive-not-detected.html

  6. Jaycie Turner Avatar
    Jaycie Turner

    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?

  7. Alan Siu Avatar
    Alan Siu

    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.

  8. marita Avatar
    marita

    What to do when the problem happens when i am trying to erase the internal hard drive to sell my pac book pro?

    1. Alan Siu Avatar
      Alan Siu

      Try booting into recovery mode (holding down Cmd-R during bootup) and then erasing it from there.

  9. Ian Small Avatar
    Ian Small

    Brilliant! Spent hours searching. Came across this and bingo, worked in seconds.

  10. Scott Avatar
    Scott

    Great tip. This worked great. Took a lot of time to find it but was a flawless solution. Thanks very much.

  11. Jeff Alexander Avatar
    Jeff Alexander

    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.

  12. Jon Avatar
    Jon

    When I try to do this I get an errror on the terminal saying Sudo command unknown… Any ideas?

  13. Alan Siu Avatar
    Alan Siu

    That’s an odd one.

    What happens if you try this?

    sudo /usr/sbin/diskutil unmountDisk force /dev/disk2
    1. Ashley Avatar
      Ashley

      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. Alan Siu Avatar
        Alan Siu

        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. jmbice Avatar
          jmbice

          I am getting the same error as Jon and Ashley. Can assure you I am typing it in correctly…

          1. Alan Siu Avatar
            Alan Siu

            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.

  14. joe Avatar
    joe

    Thank you! Worked perfectly after many failed “solutions”.

  15. Ava Avatar
    Ava

    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. Alan Siu Avatar
      Alan Siu

      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. Ava Avatar
        Ava

        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.

  16. Nicola Avatar
    Nicola

    Thank you!! So much easier and clearer than anything else I read. Worked immediately.

  17. Lauri Avatar

    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…

    1. Alan Siu Avatar
      Alan Siu

      Based on the output you posted, your disk might have unmounted just fine. It looks as if the failure came from the wiping part. You may find these links helpful:
      https://www.ifixit.com/Answers/View/244571/partition+failed+wiping+volume+data+to+prevent+future+accidental+probi
      https://www.reddit.com/r/applehelp/comments/3v3ybd/wiping_data_to_prevent_future_accidental_probing/

  18. brian Avatar
    brian

    Awesome! thank you so much.

  19. Dr1ver105 Avatar
    Dr1ver105

    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.

  20. Ben Avatar
    Ben

    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. Alan Siu Avatar
      Alan Siu

      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.

  21. Shoug Avatar
    Shoug

    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 ..

    1. Alan Siu Avatar
      Alan Siu

      You really have to tackle one problem at a time. First, figure out your password. If you can’t remember it, reset it (you can do so from recovery mode):
      https://discussions.apple.com/docs/DOC-4101

  22. Nate Avatar
    Nate

    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

    1. Alan Siu Avatar
      Alan Siu

      This should help you figure out what it’s busy with, so you can manually kill that process:
      http://apple.stackexchange.com/a/104850

  23. Leslie Avatar
    Leslie

    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).

  24. Kristie Avatar
    Kristie

    Thanks so much, great fix!

  25. chris Avatar
    chris

    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. Alan Siu Avatar
      Alan Siu

      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. chris Avatar
        chris

        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. Alan Siu Avatar
          Alan Siu

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

  26. Del Rey Avatar
    Del Rey

    Worked for me reformatting a Seagate Backup plus to use with OS 10.6.8. Thank you!

  27. Toby Avatar
    Toby

    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.

  28. Toby Avatar
    Toby

    Current error: Source volume is read-write and cannot be unmounted, so it can’t be lock copied.

    1. Alan Siu Avatar
      Alan Siu

      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”?

  29. Sophia Avatar
    Sophia

    That one did the trick. Perfect solution, thank you so much.

  30. […] a sequel to Fix for disk erase failed couldn’t unmount disk, if you really cannot even force unmount a disk, chances are it's being used by some process. I […]

  31. mauop Avatar
    mauop

    Great piece of advice! Worked at first attempt, I was running out of hope after trying several solutions from other forums

  32. Christopher Avatar
    Christopher

    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. Alan Siu Avatar
      Alan Siu

      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.

  33. Nathan s Avatar
    Nathan s

    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

  34. Al Avatar
    Al

    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.

  35. Frieda Avatar
    Frieda

    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.

    1. Alan Siu Avatar
      Alan Siu

      Try typing mount to see what is mounted where.

  36. Scott Avatar
    Scott

    Thanks! Worked like a charm 🙂

  37. Andy Avatar
    Andy

    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. Alan Siu Avatar
      Alan Siu

      /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).

      1. Andy Avatar
        Andy

        1. Typing “/Volumes/” and hitting Tab once yielded “Macintosh HD”; Tab a second time did nothing.

        2. Typing “mount” and hitting Enter yielded:

        /dev/disk0s2 on / (hfs, local, journaled)
        devfs on /dev (devfs, local, nobrowse)
        map -hosts on /net (autofs, nosuid, automounted, nobrowse)
        map auto_home on /home (autofs, automounted, nobrowse)

        3. Typing “df -h” yielded:

        Filesystem; Size; Used; Avail; Capacity; iused; ifree; %iused; Mounted on

        /dev/disk0s2; 297Gi; 9.1Gi; 288Gi; 4%; 2455523; 75477379; 3%; /
        devfs; 181Ki; 181Ki; 0Bi; 100%; 626; 0; 100%; /dev
        map -hosts; 0Bi; 0Bi; 0Bi; 100%; 0; 0; 100%; /net
        map auto_home; 0Bi; 0Bi; 0Bi; 100%; 0; 0; 100%; /home

        Thank you for the additional assistance but I’m not quite sure what to do with any of this. I tried the command “$ sudo lsof | grep /Volume/Macintosh\ HD” but it resulted in nothing, I just got a reset terminal after it prompted me for my password. I also tried it in a different command on the other page you referenced: typing “$ sudo diskutil unmount force /Volumes/Macintosh\ HD” resulted in “Volume Macintosh HD on disk0s2 failed to unmount.”

        Do you have any other troubleshooting tips?

        1. Alan Siu Avatar
          Alan Siu

          Why are you trying to unmount Macintosh HD? Are you booting from an external drive? If you’re not booting from an external drive, Macintosh HD is the drive you’re using when you boot up your Mac. Based on your mount and df -h output, it doesn’t seem you have anything mounted that needs to be unmounted.

          1. Andy Avatar
            Andy

            I am not using an external drive, I’m trying to erase my startup disk before discarding my old iMac. The Apple instructions (https://support.apple.com/en-us/HT204904) state to select the disk, not the volume, in Disk Utility but when I try to do so, I get the following error message: “Disk erase failed. Couldn’t ummount disk” mentioned in my first comment above and which I thought this article was about troubleshooting around.

          2. Alan Siu Avatar
            Alan Siu

            You won’t be able to erase the drive while you’re using it. Boot into recovery mode (hold down Cmd-R while rebooting) and then you should be able to unmount and erase Macintosh HD.

  38. Andy Avatar
    Andy

    Don’t I need to erase the disk rather than the volume? That’s what the Mac help page says regarding wiping a computer to sell or donate. I can successfully erase Macintosh HD (the only partition) but I get the error message “Disk Erase Failed: couldn’t unmount disk” when I try to erase the disk itself. Hence this series if inquiries.

    1. Alan Siu Avatar
      Alan Siu

      There’s nothing user-specific on your recovery partition if you wipe the Macintosh HD partition. If you really want to erase the entire disk, including the recovery partition, you must boot from an external drive.

      1. Andy Avatar
        Andy

        It’s funny, now that I check the Apple help page again, it’s been revised as of four days ago and the note that used to be included (make sure to select the disk, not the volume) is now gone – figures! Anyway, it sounds like I should be good to go. Thanks for the help, I really appreciate it.

  39. Lara Avatar
    Lara

    Thank you so much! It took me an hour to find your page and I am glad that I did. You have made my day!

  40. Ronald Avatar
    Ronald

    started with above suggestions and part of it worked. Wanted to format it but then it still says it needs an unmounted disk.

    at first the disk looks like this:

    /dev/disk4 (external, physical):
    #: TYPE NAME SIZE IDENTIFIER
    0: FDisk_partition_scheme *16.0 GB disk4
    1: Windows_FAT_32 boot 66.1 MB disk4s1
    2: Linux 16.0 GB disk4s2

    Then i forced the disk to unmount:

    iMac-van-Ronald:~ koenie$ diskutil unmountDisk force /dev/disk4
    Forced unmount of all volumes on disk4 was successful

    Formatting:

    iMac-van-Ronald:~ koenie$ sudo diskutil eraseDisk FAT32 ROLF MBRFormat /dev/disk4
    Password:
    Started erase on disk4
    Unmounting disk
    Creating the partition map
    Waiting for partitions to activate
    Formatting disk4s1 as MS-DOS (FAT32) with name ROLF
    Error: -69830: This operation requires an unmounted disk

    what to do, besides throwing it out off the window…….

    1. larson Avatar
      larson

      Hi Ronald, I ran across your post and see you had the same issue im having now with no luck in finding a solution. This was a year ago I realize but do you happen to remember how you fixed your SDcard?

  41. Leslie Avatar
    Leslie

    HUGE help! Simple solution that worked perfectly, and all the other solutions I found were very complex and would have been time consuming. Thank you so much.

  42. Joy Avatar
    Joy

    Hello,
    I have the same problem and I ran into you website. I was trying to erase an external hard drive, and got this error. Following your directions, the disk was unmounted successfully in terminal. At Disk Utility, I saw the partitions of the external hard drive being greyed out. So I clicked at the hard drive and clicked Erase, but still got the same error. After ejecting it and reconnecting the drive, it seemed that nothing has been erased. What would you suggest? Thanks!

  43. michelle Avatar
    michelle

    this is the closest i’ve gotten to be able to erase this external disk, but… i got this error message:
    Error: -69825: Wiping volume data to prevent future accidental probing failed

  44. MRDisperatti Avatar
    MRDisperatti

    Tried but…

    sudo diskutil unmountDisk force /dev/disk2
    sudo: unable to stat /etc/sudoers: Permission denied
    sudo: no valid sudoers sources found, quitting

    1. Alan Siu Avatar
      Alan Siu

      You’re not a valid sudoer, apparently. Are you running those commands as an admin user?

  45. A Avatar
    A

    THANK YOU!!!!!!

  46. Jeff Avatar
    Jeff

    Thank you, Alan! Your procedure worked perfectly — you got me out of a very frustrating situation.

Leave a Reply

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