MacOS – Cannot delete or merge old boot camp partition in El Capitan

bootcampdisk-utilitymacospartition

So i've battled with this for quite some time, look up various topics with various solutions, however i have yet to succeed with merging my partitions into one. I had previously installed windows 10 on it, but after i partitioned for a mutual accessible drive (for dropbox), windows stalled and i had to reformat it, resulting in a sort of "locked" partition.

If i click on "Partition" in Disk Utility, there are two major partitions, where neither of them have the "-" option available(greyed out). I have tried to partition DeleteThis into both ExFat, Fat and Journaled OS X, with no difference.

diskutil list reveals this:
Diskutil list

and gpt -r show -l /dev/disk0 shows this:
enter image description here

I've also tried to reboot into recovery mode and use the Disk Utility there, with no different result than from normal.

EDIT: I have of course also tried using Boot Camp Assistant, but it just says "The start disk cannot be partitioned or restored as a single partition".

Best Answer

  • Hold down the Command ⌘OptionR keys at startup to boot to OS X Internet Recovery. Once you have started your Mac in OS X Internet Recovery mode, you need to use the gpt command to remove the unneeded partitions. You can then expand your core storage partition to recovery the freed space back into your OS X partition.

    To use the gpt command, you need to unmount your physical internal disk. If you are using core storage, then you have to unmount the virtual internal disk first. The commands are shown below. Note: Once booted to internet recovery, the disk numbers may change. The disk numbers used below are based the the values shown in your posted question. The partitions to be removed are 4, 5 and 6 on disk0.

    To remove partition 6, enter the commands.

    diskutil  unmountDisk  /dev/disk1
    diskutil  unmountDisk  /dev/disk0
    gpt  remove  -i  6  /dev/disk0
    

    To delete the remaining partitions, repeat the commands.

    diskutil  unmountDisk  /dev/disk1
    diskutil  unmountDisk  /dev/disk0
    gpt  remove  -i  5  /dev/disk0
    diskutil  unmountDisk  /dev/disk1
    diskutil  unmountDisk  /dev/disk0
    gpt  remove  -i  4  /dev/disk0
    

    Now, when executing the command

    gpt  -r  show  /dev/disk0
    

    the removed partitions should not appear. You can restart back to El Capitan.

    Use the Disk Utility application to recover the freed space. Use the steps below.

    1. Highlight the internal disk.
    2. Click on the icon labeled "Partition".
    3. Highlight the free space shown in the pie chart. See example below.

      321

    4. Click on the "-" symbol. Your OS X partition should fill the pie chart. See example below.

      322

    5. Click on the "Apply" button.
  • Related Question