I am on 11.1 Big Sur beta. I have a partition with no disk identifier called (free space) I would like to remove this, and then make the APFS container take up the free space.
Here is a screenshot of my GPT and Disks
I am on 11.1 Big Sur beta. I have a partition with no disk identifier called (free space) I would like to remove this, and then make the APFS container take up the free space.
Here is a screenshot of my GPT and Disks
This answer was tested using Big Sur (macOS 11.0.1). For Catalina, set this question.
Boot to Big Sur.
Close all applications. Open the Terminal application.
You can create a new APFS container. An example is given below. Assume the output from diskutil list
is as follows.
The command to enter would be as follows.
diskutil addpartition disk0s1 apfs NewAPFS 0
Clone (replicate) your existing Big Sur installation to the new APFS container. An example is given below. Assume the output from diskutil list
is as follows.
The command to enter would be as follows.
sudo asr --source /dev/disk1s5s1 --target /dev/disk2 --erase
An alternative to the
asr
command would be to use the Carbon Copy Cloner.
Restart the Mac and hold down the option key until the Mac Startup Manager icons appear. Hold down the control key while selecting the Big Sur that is not shown as the current default.
An alternative would be to select the startup disk from macOS Recovery.
Remove the original. An example is given below. Assume the output from diskutil list is as follows.
The command to enter would be as follows.
diskutil apfs deletecontainer disk2
Reclaim the free space. An example is given below. Assume the output from diskutil list is as follows.
The command to enter would be as follows.
diskutil apfs resizecontainer disk1 0
The final result is given below.
Installed both Catalina and Monterey on a small 120 GB NVMe disk, and decided to stay with Monterey assuming that I could use the space left after deleting Catalina, but could not find a way to do it, the point was that the space needed to be available after the partition, not before.
This post sent me in the right direction, but How To Clone Your Mac Using ASR from Apple Support Community included the right options for ASR to do the cloning.
I can confirm @david's step work on Ventura 13.7.1 as well.
I only followed the first 3 steps.
In Step 3, choose the disk appropriate to the results of your diskutil list.
For me, since the free space was after disk0s3 I modified the command to
diskutil addpartition disk0s3 apfs NewAPFS 0
and result was
Post this I was able to claim the space by expanding the partition using diskutility. (did not have to run through clone steps from above)