unable to create partition on free space using disk utility

Running 10.13.4 on a MBP with 750GB SSD.

The problem i started with a single APFS container that spanned the whole 750GB of the internal SSD disk. Only half of it was in use so i decided to free the unused half and use it to create an additional APFS container (for reasons, please see below). I ran the diskutil resizecontainer command to free the space and that succeeded. I then ran disk utility guy and selected the whole disk and then partition. This shows the free space and the existing APFS container. I was hoping that when i click on the free space i would be able to partition it and go from there but the add functionality (+ sign) is greyed out as are the partition information details. Why is that? Is there a way to regain access to this free space and assign it to a new partition without zapping the whole disk and starting again? Pictures below.

Why I want to create extra APFS partitions. I see lots of admonitions to only create one APFS container as APFS is designed to share space and volumes will grow and shrink and you don't have to worry, etc. But i also see that 'your startup disk is filling up' is quite a common occurrence after a while. Seems to me that the solution to that is to ring fence the space that your startup disk is sitting on so that the rest of the disk can fill up without any risk to the system. I have no control over the creation of the 'Macintosh HD' volume (or the other 3 volumes that are created at install) and it seems that once an APFS volume has been created there is no way to resize it.The best I can hope for is to resize the container of the startup disk and use the free space to create an additional APFS container which will then house the user data.

Thanks in advance.

diskutil apfs list before i started

diskutil apfs list before i started

diskutil list before i started

diskutil list before i started

diskutil list after resizecontainer shrinkage diskutil list after resizecontainer shrinkage

Disk Utility GUI showing free space and + button as well as Name, Format and Size fields greyed out Disk Utility GUI showing free space and + button as well as Name, Format and Size fields greyed out


Solution 1:

Both the Disk Utility application and diskutil command do not allow free space to be converted to a new partition. Instead, you are suppose to create new partitions by splitting an existing partition.

So first of all, enter the command given below to reclaim the free space to the existing APFS partition.

diskutil apfs resizecontainer disk0s2 0

Open the Disk Utility application and highlight the container disk1, then click on the Partition button. You should get an image similar to what is shown below.

Next, click on the Partition button in the popup window. You should get an image similar to what is shown below.

Click on the +button, then enter a name. I chose Macintosh HD 2. Make sure the format is APFS and the size is 350 GB. The result should be an image similar to what is shown below.

Next, click on the Apply button. You should get an image similar to what is shown below.

Next, click on the Partition button in the popup window. The result should be an image similar to what is shown below.

Note: The Disk Utility application may show incorrect results. You may need to quit and reopen the Disk Utility application to see the correct results.