8

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".

12
  • You need to delete the last 3 partitions. The easiest command to use is gpt. I believe you have to execute this command while booted to internet recovery. Are you familiar with using internet recovery? Also what is the model/year of your Mac? Older mac's can not use internet recovery. Commented Apr 16, 2016 at 7:27
  • Do i also need to delete the OSXRESERVED partition? If it's the reinstall options from recovery mode, then it says "Could not find installation information for this machine"... EDIT: Switched wifi, now i can access it. It shows me three different options: Macintosh HD(my current), OSXRESERVED and DeleteThis.
    – Benjamin
    Commented Apr 16, 2016 at 7:32
  • Just realised i was in local recovery(cmd+r) and not internet recovery(cmd+opt+r). Internet recovery is currently progressing as we speak. The model is 2016.
    – Benjamin
    Commented Apr 16, 2016 at 7:41
  • OSXRESERVED is created by the Boot Camp Assistant. The Windows iso file is copied there. That is how Apple manages to install Windows without a DVD or USB flash drive. Some partitions you need to delete are hidden and do not appear in the Disk Utility. Commented Apr 16, 2016 at 7:42
  • Ohh.. When i try to delete it from disk utility it says "The target Core Storage volume is locked"
    – Benjamin
    Commented Apr 16, 2016 at 7:48

3 Answers 3

8

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.
5
  • So i managed to remove the OSX Reserved partition, so it's gone now. Now how do i find it again?
    – Benjamin
    Commented Apr 16, 2016 at 8:45
  • The gpt remove command sets the partition type id to 00000000-0000-0000-0000-000000000000. This partition will no longer appear when using diskutil list or gpt show commands. The partition information is still in the gpt and the contents of the removed partition is unchanged on your internal disk. I assume you no longer what the data stored on the removed partition. You are freeing the space to later be reclaimed. Commented Apr 16, 2016 at 9:03
  • I ran the repair tool and it is now appearing again as free available space, able to merge. Thanks for your help!
    – Benjamin
    Commented Apr 16, 2016 at 9:03
  • Awesome, this is the only way I could retrieve the windows partition after Bootcamp failed to do it. Lesson of the day: never EVER put Windows on your beautiful Mac
    – Guillaume
    Commented Jan 19, 2017 at 14:26
  • Thanks, it helps me. Don't forget to get the correct partition number before deleting. Commented Dec 13, 2017 at 12:08
9

The answer is so simple. Forget terminals and internet recovery. Here's what you gotta do:

  1. Format the BOOTCAMP-partition through disk utility to MS-DOS (FAT)
  2. Press cmd + space and write bootcamp-assistant, open bootcamp
  3. Erase windows and merge the partitions as one mac HD-partition.
3
  • 1
    This worked for me!
    – cfs
    Commented Oct 4, 2016 at 8:42
  • Simple. Worked. Excellent. Bye bye Windows, hello usable disk space!
    – Streamline
    Commented Apr 5, 2019 at 18:33
  • Didn't work here, option to remove Windows (partition) is disabled in Bootcamp Assistant. Commented Aug 28, 2021 at 8:26
1

You can not use DiskUtility on a Bootcamp partition, whatever you want to do. Only use BootcampAssistant when you want to change or delete the Bootcamp partition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .