disk utility

Disk utility tip: Fix ‘couldn’t unmount disk’ errors

I have found myself recently experiencing a couple of Macs which would not allow me to repair the directory or permissions in Disk Utility, or erase/partition the drive with an error such as: ‘Disc erase failed couldn’t unmount disc’ or ‘Disk Erase failed with the error: Couldn’t unmount disk.’

couldnt unmount disk osx

Even trying to use Network Deployment tools such as Apple’s Netinstall service or DeployStudio have also failed to deploy due to these errors.

Normally, any ‘Couldn’t Unmount Disk’ error is attributed to circumstances where the boot drive is being modified or is being used by an application or process. So the first thing to do is to startup the Mac from another bootable drive such as an external drive or OS X Recovery. You can then run Disk Utility from there.

An external drive or a network drive is preferred if it is the internal hard drive you have an issue with, since the OS X Recovery is a partition on the same physical drive which may not be able to successfully unmount or modify your internal disk.

To create your own bootable disk, refer to our blog ‘Creating a Mavericks bootable install disk’.

I would strongly recommend at this stage attempting to back up any data that is required before proceeding with the following steps. Some of the following steps are destructive and will lose ALL data on your drive.

  1. If you have an external bootable disk, connect this to your Mac and power your Mac up whilst holding down the OPTION/ALT key. Then select the desired external drive from the startup manager screen and press the enter key.
  2. If you have used our method above to create a bootable installer, choose ‘Disk Utility’ from the available menu. If you have created your own bootable drive with a full system, open Disk Utility from /Applications/Utilities.
  3. Select the ‘First Aid’ tab and verify the troublesome disk, repairing if needed. Also perform a permissions repair if required.
  4. Attempt again to perform whichever task caused your ‘Couldn’t Unmount Disk’ error. (For example to Erase/Partition the disk).

Still not playing ball?

You can try booting from OS X Recovery (by holding ‘CMD’ + ‘R’ keys at startup) or an external drive and use the command line to attempt to unmount or erase the disk:

1) Once booted from OS X Recovery, select Terminal from the Utilities pull down menu. (Or if you are booting to your own bootable drive with a full system, open Disk Utility from /Applications/Utilities).

At the unix prompt enter:

diskutil list

Press RETURN. From the listing, look in the Identifier column for your disk identifier. It will look like ‘diskx’ where ‘x’ is an integer starting at 0. You should also see the name of the disk such as ‘Macintosh HD’. In my example below, the disk name is ‘Server’. Note down the disk identifier. For a single drive system this will probably be ‘disk0’ :

diskutil list

2) Now enter the following where ‘x’ is your disk identifier:

sudo diskutil unmountDisk /dev/diskx

3) Press RETURN. Enter your admin password if prompted. This should unmount all volumes of the physical drive:

unmount all volumes of the physical drive

4) Attempt again to perform whichever task caused your ‘Couldn’t Unmount Disk’ error. (For example to Erase/Partition the disk).

Still unable to work on the disk? Still getting those pesky disk errors?

Bit more drastic, but you can attempt to force a volume or the entire physical disk to unmount:

FOR A VOLUME:

1) Using the Terminal application again, booting from OS X Recovery or an external bootable drive,

Enter the following where ‘x’ is your disk identifier and ‘y’ is your volume identifier, (remember to use the ‘diskutil list’ command if you need to find out your disk and volume identifiers):

sudo diskutil unmount force /dev/diskxsy

2) Press RETURN. Enter your admin password if prompted. This should force unmount the volume:

force unmount the volume

3) Attempt again to perform whichever task caused your ‘Couldn’t Unmount Disk’ error. (For example to Erase/Partition the disk).

FOR AN ENTIRE PHYSICAL DISK:

1) Using the Terminal application again, booting from OS X Recovery or an external bootable drive.

Enter the following where ‘x’ is your disk identifier. (Remember to use the ‘diskutil list’ command if you need to find out your disk identifiers):

sudo diskutil unmount force /dev/diskx

2) Press RETURN. Enter your admin password if prompted. This should force unmount the entire physical disk and all its related volumes:

orce unmount the entire physical disk and all its related volumes

3) Attempt again to perform whichever task caused your ‘Couldn’t Unmount Disk’ error. (For example to Erase/Partition the disk).

OK, we’ve tried to be nice, but is the disk STILL not letting you work with it?

Be sure you backup your files to an external drive or second internal drive, the following procedure will remove everything from the hard drive!

We are now going to force erase the physical disk, creating a single Mac OS Extended (Journaled) volume. This should then allow you to partition and work with the physical disk again.

1) Using the Terminal application again, booting from OS X Recovery or an external bootable drive.
Enter the following where ‘MacintoshHD’ is the name of the newly created Mac formatted partition, and where ‘x’ is your disk identifier, (remember to use the ‘diskutil list’ command if you need to find out your disk identifiers):

sudo diskutil eraseDisk JHFS+ MacintoshHD diskx

2) Press RETURN. Enter your admin password if prompted. This should force erase the entire physical disk and all its related volumes, then create a single Mac OS Extended (Journaled) volume:

create a single Mac OS Extended (Journaled) volume

3) Hopefully you can now perform your desired erase, partition, installation or deployment on this drive.

NOTE: Use of the ‘sudo’ command may not be necessary for some of these actions, however, as long as you know the administrator account’s password, starting any unix command with ‘sudo’ will force the command to be run as the unix root user, so you shouldn’t have any permission issues executing the command.

To learn more about the Mac OS file system: Take Mac Support for PC and Support Essentials

 

Disclaimer:

While the author has taken care to provide our readers with accurate information, please use your discretion before acting upon information based on the blog post. Amsys will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.

This feature has been tested using OS X v10.9.2 which was the latest Mac OS release at the time of writing.

16 Replies to "Disk utility tip: Fix ‘couldn’t unmount disk’ errors"

  • Crystal M.

    After installing an update, I couldn’t get past the screen you see when doing recovery. Tried everything under disk utility, couldn’t unmounted disk or said couldn’t open disk, depending which disk. Couldn’t repair, said to reformat, but couldn’t erase anything either. Tried every single thing above. Looks like it starts erasing, but then quits and says at least one volume could not be unmounted. Tried to force unmount to no avail. Any idea what else I can do? I really can’t afford to pay someone $300 when I’m this close! Thank you.

  • Alysha S.

    I’ve got mine booted into a Yosemite installation USB. Even after I tried your final option, I got this message:

    Error: -69888: Couldn’t unmount disk

    I’ve already recovered my files from the computer—all I want to do is wipe it and try to do a clean install. At this point I’m not sure what else to try.

    • George W.

      >Alysha S. (9th August 2015 at 7:12 pm)
      >I’ve got mine booted into a Yosemite installation USB. Even after I tried your final option, I got this message:
      >Error: -69888: Couldn’t unmount disk

      Same here.

  • bala

    Awesome. Having struggled with Couldn’t Unmount Disk for hours, I re-started my mac with cmd+r, opened terminal and unmounted disk. Went back to disk utilities, erased it (this time it did not complain at all), re-installed OS. Very smooth. Thanks a lot

  • Kelvin

    I got same error:-69888. You can use “sudo lost | grep dev/disk?” where “? is the drive number. This lists which process is run on the drive?. Then use activity monitor to force the process to quite and then redo the partitioning. This resolve my case. The original link is in “http://archive.macfixitforums.com/ubbthreads.php/posts/346000”

  • Eduardo Ferraz

    Thanks a lot! It worked! The only different thing I needed to do in terminal was to write the commands without the word “sudo”.

  • Jan

    For me it worked finally quite simpel, first I unmounted the logical disc “under” the physical disk0, then the erase for disk0 was a piece of cake

  • Jan

    For me finally the solution was simple, after the unmourned of the logical disk under the disk0, the erase didn’t complain anymore

  • C Allen

    I had a Mac Mini that I needed to reformat and could not get the disk to unmount. So I found this page and tried everything. No joy.

    In a moment of “what the heck, try this,” while in Disk Recovery mode, I ran Fix Disk Permissions, then, voila! I was able to force an unmount and could wipe the disk.

    I’ve saved this page for future — really appreciate the clear instructions as well as screenshots.

  • Same troubles here, just trying to wipe and do a fresh install at this point. I’ve tried literally everything, and am at the point where I have both partitions completely wiped. Doing the list command shows up to 15 disk images? I’ve even tried the forced command parameters–no luck, it refuses to unmount. This is the main internal hard drive, so in the meantime I’m without a computer…

  • Graham

    Thanks Man,, managed to force unmount a drive offline and run a repair 😀

  • Dag Spicer

    Bought a HGST 1TB USB 3.0 7200 RPM external drive. sudo diskutil eraseDisk JHFS+ MacintoshHD diskx fixed the issue with me having the “Partition” button in Mac Disk Utility greyed out. YAY! Thanks!!

  • A clients was installing a System update when his iMac wouldn’t restart past a No Entry Symbol. I recovered the data via Target Disk Mode, then got stuck with the above error. Found this page and it was persistence that got me past the problem. It took 5 repeated attempts with a Restart after 3 goes, but eventually worked. But I ended up with a fractured Fusion Drive, showing both SSD and HDD volumes separately. I used this link to join them back together – http://www.techrepublic.com/article/pro-tip-how-to-create-and-disable-a-fusion-drive/

    Great tip – cheers Russell

Leave a Reply

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