I removed a container disk 1, in order to allocate more space to Container Disk 2. but still cannot increase the size of container disk 1 which is 100G. my disk capacity is 251G.
Here is the detail of diskutil.
Best Answer
To add the space from the deleted container to the existing container, the deleted container would at least have to physically reside after the existing container. In your case, this probably was not true. You can confirm this by viewing the output from the command given below.
diskutil info disk0s3 | grep -e Size -e Offset
Here, I assume the existing container has disk0s3 as the identifier for the physical partition. If you restart your Mac, this will probably change to disk0s2. The offset should show the partition starts at around 151 GB. If so, then all the free space you created resides before the container and therefore can not be added to the container.
Apple's intent by creating APFS was for a computer to have only one APFS container. You can create additional volumes within a container and install more than one macOS operating system. If you had done this, then deleting the APFS volume(s) would have automatically made the free space available for other volumes.
Apple's tools won't shrink the Bootcamp partition, so you have several options:
get a third party tool to back up Bootcamp and/or shrink it outright
install OS X on an external drive and run it there (basically punt)
There's a slight chance you have a siruation that could be remedied from he command line. Post the diskutil list details that Disk Utility doesn't show by default. Also, can you lose no data on Windows side? If you could delete that partition the side Mac could resize without any data loss.
Your Recovery HD is a leftover of a previous system version and probably unwanted.
High Sierra's recovery partition is inside the container:
3: APFS Volume Recovery 506.6 MB disk1s3
The command diskutil apfs resizeContainer disk0s2 1g jhfs+ Media 0b tries to resize disk0s2 containing all subsequent APFS Volumes to 1 GB and reclaim all freed-up space (150.4 GB - 1 GB = 149.4 GB) for another HFS+ partition Media).
This will fail because the basic operating system (disk1s1) alone has a size of at least ~10 GB.
Best Answer
To add the space from the deleted container to the existing container, the deleted container would at least have to physically reside after the existing container. In your case, this probably was not true. You can confirm this by viewing the output from the command given below.
Here, I assume the existing container has
disk0s3
as the identifier for the physical partition. If you restart your Mac, this will probably change todisk0s2
. The offset should show the partition starts at around 151 GB. If so, then all the free space you created resides before the container and therefore can not be added to the container.Apple's intent by creating APFS was for a computer to have only one APFS container. You can create additional volumes within a container and install more than one macOS operating system. If you had done this, then deleting the APFS volume(s) would have automatically made the free space available for other volumes.