Free Space after merging Partitons on Macintosh HD

I have a 256GB SSD El Capitan (the last iteration of it) on MacBook 12" late 2016 Model.

Before I had it, someone made an aditional partition of 125GB which I've deleted using various methods here described (Terminal commands).

The good is now I have one partition. The bad is less storage is usable.

enter image description here enter image description here

Of the 256GB Storage device, only ~125GB is available : enter image description here

How can I "merge" that space to the main disk in order to have again full 256GB of storage?

enter image description here


Solution 1:

In order to add free space to the Apple_CoreStorage partition, a significant amount of free space must resize immediately after the Apple_Boot partition. Based on the error message you posted, this appears to be not true. If the free space resides above the Apple_CoreStorage partition, then this space can not be added to the Apple_CoreStorage partition.

You can determine where the free space exists by entering the command given below.

sudo gpt -r show /dev/disk0

This command can be entered while booted to El Capitan, because SIP under this version of OS X allows reading from /dev/disk0, but not writing.

From the table published in the Wikipedia article GUID Partition Table, one can determine a type of partition based on the GUID. From the command sudo gpt -r show /dev/disk0 output, one can determine the partitions with indices 1, 2, and 3 are types EFI System partition, Apple Core Storage Container, and Apple Boot partition, respectively. The 30,617,650 sectors of free space can be converted to bytes by multiplying by 4096 bytes per sector, which is 125.4 GB. Since this free space is above the Apple_CoreStorage partition, the space can not be merged into the Apple_CoreStorage partition.

Unless your are an expert, the safest solution is to backup your data to an external drive, erase the internal drive, reinstall OS X and restore your data from backup. One possible alternative is given below. This alternative has not been tested.

  1. Boot to Big Sur recovery or from a Big Sur installer and enter the command below.

    diskutil addPartition disk0s1 JHFS+ NewVolume 0
    
  2. Install El Capitan or newer to the new partition.

  3. Copy you data to the new installation or use the Migration Assistant.

  4. Erase to free space the old Apple_CoreStorage and Apple_Boot partitions.

  5. Merge the free space into the new partition.