How to reclaim free space partition on macOS High Sierra? I was trying to expand my main drive by deleting a third partition I used to have after deleting and formatting with free space:

sudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0s2


I could not expand my drive and now I can't find the drive I formatted "free space"
To convert an APFS container to free space you'd have to delete the container first:

diskutil ap deleteContainer disk1


Then you can demote the partition to unallocated disk space with:

diskutil eraseVolume "Free Space" %noformat% /dev/disk0s2




You won't be able to reclaim more disk space for your remaining container disk2 (disk0s3) though, because you can't expand disk0s3 to lower block numbers.

As of today you can't move APFS volumes between APFS containers.

Your options are then:


Reboot to Internet Recovery Mode


create a partition disk0s2 in the unallocated disk space with gpt. The partition has to have the same size and type as disk0s3.
unmount all container disk2 volumes
dd disk0s3 to disk0s2
delete Container disk2
expand the remaining container 

Install High Sierra to container disk1 (the container disk1 mustn't be erased as described in the first part then) and import data from container disk2.


delete Container disk2 afterwards
expand the remaining Container disk1

Backup Mac 2 with Time Machine and restore it after booting to Internet Recovery Mode to a completely erased and repartitioned disk0