I have a problem with my Bootcamp partition. I decided to delete it because I don't use Windows anymore. I went through Bootcamp Assistant, tried to uninstall Windows but didn't work that way.

So I formated with Disk Utility my 40 GB Bootcamp Partition and it's now empty.

Now, I struggle in reuniting the 2 partitions and have my full 128 GB space back. --> I tried to follow this tutorial but in vain :

I deleted my Bootcamp partition but can't resize my OS X partition

I unmounted both volumes and I'm stuck at the 2nd step of the tutorial :

gpt add -b <disk0s4 start position> -t windows /dev/disk0

It says " No space available". Does anyone know what's going on here?

The output of sudo gpt -r show disk0:

    start       size  index  contents
        0          1         PMBR
        1          1         Pri GPT header
        2         32         Pri GPT table
       34          6         
       40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
   409640  147408336      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
147817976    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
149087512        744         
149088256   87627736      4  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
236715992     262151         
236978143         32         Sec GPT table
236978175          1         Sec GPT header
  • Hi klano thanks for the answer. Sorry I'm beginner in this, when should I type your command? Thanks – ShqKa Jun 5 '17 at 16:30
  • Ok I add the information on a separate answer – ShqKa Jun 5 '17 at 17:12

The linked method to create a fake Boot Camp partition doesn't work because the former partition is no empty space but an HFS volume (disk0s4). The gpt command won't add partitions in allocated disk space.

To resize your main partition (disk0s2) to the full ~120 GB, boot to your main macOS volume, delete the second HFS+ volume and expand your main partition:

diskutil eraseVolume Free Space disk0s4

Try to expand the main volume:

diskutil resizeVolume disk0s2 R

If the R size option fails try to use a real size like 120g or the percentage 100% (on some external disks this may fail because of some 2 TiB limit).

diskutil resizeVolume disk0s2 120473m

or more exactly:

diskutil resizeVolume disk0s2 120473067520b


diskutil resizeVolume disk0s2 100%
  • DAMN IT WORKED THANKS A LOT ! Actually the full size of the disk is 121.33 GB. diskutil resizeVolume disk0s2 100% didn't work ( MediaKit reports partition (map) too small) nor diskutil resizeVolume disk0s2 121g ( MediaKit reports not enough space on device ) But with 120g it worked fine. Thanks again klanomath, so quick and efficient! – ShqKa Jun 5 '17 at 21:36
  • @ShqKa Full size means full available size here: 121.33 GB - EFI - Recovery HD - 2*40*512 Byte (partition tables + unallocated disk space to align to 4k blocks) – klanomath Jun 5 '17 at 21:41

You must log in to answer this question.

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