Mac Disk Unitlity Unable To Unmount Volume For Repair

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.

Mac Disk Utility Unable To Unmount Volume For Repair 69673

Fortunately, I figured out how to do it, using some help from a StackExchange post I found. See below for the details.

Mac Disk Utility Unable To Unmount Volume For Repair Disk

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

Repair
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:

Mac

Mac Disk Utility Unable To Unmount Volume For Repair

Mac

In the Disk Utility app on your Mac, select the disk set that you want to unmount in the sidebar. Click the Unmount button in the toolbar or beside the disk set name. After unmounting a disk set, you can disconnect the disk members of the set from your computer. Launch the Disk Utility app on your Mac and highlight the hard drive icon under ‘ External’ (for external hard drives). If you choose any other drive, the partition option will become unclickable. Now click Partition on the top toolbar. A window that has partition information will pop up.

  1. 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.
  2. 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.)
  3. 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”.
  4. 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.
  5. 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.
  6. 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.
  7. 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”.
Mac disk utility unable to unmount volume for repair parts

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 Cost

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.