Mac – Can’t delete Logical Volume Group on Fusion drive

disk-utilityfusion-driverestoreterminaltime-machine

I have a 2014 iMac Retina running OS X Yosemite and a 3TB Fusion drive. I am attempting to restore it from a Time Machine backup, but when I try to do so, I get the error message, "The disk can't be erased." referring to the Macintosh HD Fusion drive. Trying to use disk utility to delete the drive also doesn't work.

I had previously had this problem when I had to restore my computer, and managed to use the solution found here using Terminal to manually delete the Logical Volume Group. However, now when I use the command:

diskutil cs deleteLVG UUID

The process begins and says "Destroying Logical Volume Group" but it only gets to 20% and then nothing happens. Even after letting it sit for hours it shows no further progress.

I also found this solution here, which recommends using the command

diskutil cs deleteVolume UUID

to delete the Logical Volume first, prior to deleting the Logical Volume Group, but when I do so I get the following message:

Error: -69779: Unable to delete the CoreStorage Logical Volume

So at this point I'm stuck. If anyone has any other suggestions for how I can delete the Fusion drive and restore from my Time Machine backup, I would appreciate any help. Thanks.

Best Answer

If all other means fail to remove a CoreStorage Volume Group you can always use gpt to remove the CS partition (or the CS partitions if it is a Fusion Drive).

Preparation:

  • Detach your backup drive
  • Restart to Internet Recovery Mode by pressing alt cmd R at startup.

    The prerequisites are the latest firmware update installed, either ethernet or WLAN (WPA/WPA2) and a router with DHCP activated.
    On a 50 Mbps-line it takes about 4 min (presenting a small animated globe) to boot into a recovery netboot image which usually is loaded from an Apple/Akamai server.

    I recommend ethernet because it's more reliable. If you are restricted to WIFI and the boot process fails, just restart your Mac until you succeed booting.

    Alternatively you may start from a bootable installer thumb drive (preferably Yosemite or El Capitan) or a thumb drive containing a full system (preferably Yosemite or El Capitan). If you boot to a full system and login as admin you have to prepend sudo to execute some commands like gpt ... or newfs_hfs ...!

Modify the GUID partition table and replace your current LVG

  • Enter diskutil list and gpt -r show /dev/diskX (with diskX: the disk identifiers of your internal disks (probably disk0 SSD/disk1 HDD) to get an overview. In the commands below I assume the disk identifiers are disk0/disk1.
  • To delete a partition use:

    diskutil umountDisk /dev/disk2 #unmount the Logical Volume(s)
    diskutil umountDisk /dev/disk0
    diskutil umountDisk /dev/disk1
    gpt remove -i index_number /dev/disk0
    gpt remove -i index_number /dev/disk1
    

    Usually the Physical Volumes of a Fusion Drive have the index number 2:

    gpt remove -i 2 /dev/disk0
    gpt remove -i 2 /dev/disk1
    
  • Re-add the partitions with the same start block and sizes as they had previously

    gpt add -b StartBlock -i 2 -s size -t 48465300-0000-11AA-AA11-00306543ECAC /dev/disk0
    gpt add -b StartBlock -i 2 -s size -t 48465300-0000-11AA-AA11-00306543ECAC /dev/disk1
    
  • Format the new partition:

    newfs_hfs -v "SSD" -J /dev/disk0s2
    newfs_hfs -v "HDD" -J /dev/disk1s2
    
  • Create a new Logical Volume Group (or "Fusion Drive"):

    diskutil cs create name disk0s2 disk1s2 #name: name of the future LVG (e.g. FusinDrive)
    
  • Create a new Logical Volume:

    diskutil cs list
    diskutil cs createVolume lvgUUID jhfs+ name 100% #lvgUUID: the UUID of the Logical Volume Group, name: name of the future LV (e.g. MacintoshHD)
    

    or

    diskutil cs createVolume lvgUUID jhfs+ name size #size in t, g, m (e.g. 3100g)
    
  • To quit Terminal enter:

    exit
    

    and quit Terminal

  • Open Disk Utility to verify the new LVG/LV

  • Attach the backup drive
  • Open Time Machine and restore your backup