macOS Partition – Reclaim Unallocated Free Space from Recovery Partition

bootcampdisk-spacemacospartition

So, I have a pretty grave problem that I really need help with. Earlier today, I decided to remove my old and buggy bootcamp partition and reinstall windows. Problem was, bootcamp assistant didn't allow me to pick the same size as I previously had, so I decided to try to forcibly resize the Mac partition using diskutil resizevolume and then format the unallocated space into FAT32.

That's when my real problem started. I was unable to use disk utility to convert that unallocated space afterwards, and a few boots later, I even think that the recovery partition seems to have taken the unallocated space for itself.

This is my main partition, for reference:

My main partition

And this is what diskutil list shows:

closer look

So my question now is this: how do I return things to normal on my hd and reclaim all the space for the main partition? Do I have to delete the Recovery HD partition and reinstall it afterwards? Or am I making a mistake and the space is still somehow unallocated?

Best Answer

You somehow merged disk0s3 and disk0s4 (the Windows partition) to one big recovery partition - consequently there is no unallocated disk space. With your published commands this shouldn't have happened though.

The fastest way to get a default partition scheme is to merge disk0s2 with disk0s3 and later recreate Recovery HD with a tool like Recovery Partition Creator.

The merge command is:

diskutil mergePartitions JHFS+ "Macintosh HD" disk0s2 disk0s3

The command will merge Macintosh HD and Recovery HD to one big Macintosh HD while retaining the content of your main system volume.