Go to Disk Utility and mount your Mac volume. Close Disk Utility and go to the command line terminal. Do diskutil umount force /Volumes/Macintosh HD/ Take note of your disk id. Disk1 in my case. Run diskutil apfs convert /dev/disk1s1 (replace disk1 with your disk id if needed) 6. How to Fix Disk Utility Errors via Mac Recovery Partition If the Unable to Unmount Error is triggered by first aid or formatting a non-boot partition, you may be able to fix the error by booting from the Recovery partition that is included with all new versions of Mac OS X.
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.’
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.
- 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.
- 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.
- Select the ‘First Aid’ tab and verify the troublesome disk, repairing if needed. Also perform a permissions repair if required.
- 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:
Mac Disk Utility Unable To Unmount Volume For Repair Disk
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’ :
2) Now enter the following where ‘x’ is your disk identifier:
3) Press RETURN. Enter your admin password if prompted. This should 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):
2) Press RETURN. Enter your admin password if prompted. This should 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):
2) Press RETURN. Enter your admin password if prompted. This should force 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.
Mac Disk Utility Unable To Unmount Volume For Repair Cost
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):
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):
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:
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.
![Disk Disk](/uploads/1/1/7/8/117807465/359145031.jpg)
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.
My Mac Mini w/ Fusion Drive (that’s a hard disk and an SSD pretending to be a single volume for better performance) froze and wouldn’t boot. Nothing would make it boot normally again. Recovery mode was OK but couldn’t erase the boot volume nor mount it via Disk Utility (I just got “Unable to delete the core storage logical volume”), so reinstalling seemed impossible.
Fortunately, I figured out how to do it, using some help from a StackExchange post I found. See below for the details.
The magic incantation that fixed it was inspired by instructions I found here:
http://apple.stackexchange.com/questions/136590/how-can-i-delete-a-partition-corestorage-logical-volume-from-the-terminal
http://apple.stackexchange.com/questions/136590/how-can-i-delete-a-partition-corestorage-logical-volume-from-the-terminal
Note: THIS WILL WIPE YOUR HARD DISK. Only do this if you’re completely ready to just burn it all down to the ground and start over with a blank boot disk.
Here are the steps:
- Boot the recovery volume, which will take you to an OS X Utilities page that shows four options: “Restore From Time Machine Backup”, “Reinstall OS X”, “Get Help Online”, and “Disk Utility”. If you have gotten to this article you have probably already been into Disk Utility a few times already without success, so don’t open Disk Utility.
- From the Utilities menu of the “OS X Utilities” app, open Terminal. (Maximize the terminal window that opens so it’s easier to see the output of the next step.)
- Run diskutil cs list . Using the mouse, copy the long alphanumeric string that’s on the third line of output after “Logical Volume Group”. That’s the Logical Volume Group’s universally unique identifier, a.k.a. its “lvgUUID”.
- LAST WARNING: FROM HERE ON OUT THIS DELETES ALL OF THE DATA ON THE HFS+ LOGICAL VOLUME (but it doesn’t delete the recovery partition).
Run diskutil cs delete FOO-BAR-BIZ-BAZ, where FOO-BAR-BIZ-BAZ was your lvgUUID. This deletes the logical volume group. diskutil will print things about erasing the physical partitions that made up the logical volumes, which in my case were /dev/disk0s2 (a 931GB partition on the internal hard disk) and /dev/disk1s2 (a 113GB partition on the internal SSD). Pay attention to the names of the devices that it just liberated on your system, since you’ll use those device names in the next step.
At this point you have two empty HFS+ partitions that are not a Fusion drive anymore, so you’ll want to rebuild the LVG from those two physical partitions. - Run this: diskutil cs create'Macintosh HD'/dev/disk0s2/dev/disk1s2 and adjust the /dev/.. stuff to include the partitions that diskutil said it erased & mounted in the prior step.
On my Mac Mini it took about a minute to finish.
At this point if you run diskutil cs list you should see just a Logical Volume Group and as many Physical Volumes as you added (which is two in my case, disk0s2 and disk1s2), without any Logical Volumes yet. - Quit Terminal.app and run Disk Utility from the main “OS X Utilities” app.
Disk Utility should show “Fusion Drive” without any partitions in it, which is expected since we just created the Logical Volume Group without any Logical Volumes in it. - Select the Fusion Drive and run First Aid on it.
First Aid will immediately create a Logical Volume and format it, leaving one big partition of type”OS X Extended (Journaled)” named “Untitled”.
Now you’re free to do whatever you want with this empty disk. In my case, I erased it and created a new partition named “Untitled” of type “OS X Extended (Journaled, Encrypted)” since I want full-disk encryption.
(I tried to call it “Macintosh HD” during the erase step, but Disk Utility failed to erase the disk and complained that name was invalid, so I just left it as “Untitled”, erased the disk, and then renamed it by selecting the Untitled volume in the left-hand-side list of devices, then clicking on the right-hand-side pane where the name Untitled was shown and editing it there.)
Mac Disk Utility Unable To Unmount Volume For Repair
After this, I quit out of Disk Utility, and ran the “Reinstall Install OS X” app. That does a network install which first required me to log in with my Apple ID and then downloaded the install files.