MacOS – Resize APFS (encrypted) container

apfscatalinamacospartition

I am having trouble "attributing" some free space I have available on the Files partition to the volume which contains system files: an APFS encrypted container.

I would like to do this because I am no longer able to update some large application from within the App Store. I have already read some articles addressing the issue concerning resizing APFS containers but they still don't answer my question (or maybe I didn't clearly get the idea). I am running a Macbook Air under Catalina.

I put some screenshots that may give more useful information.

Reduce this volume to 90 GB:

Reduce this volume to 90GB

Increase the capacity of the container to 160 GB:

Increase the capacity of the container to 160GB

diskutil list:

diskutil list

diskutil resizeVolume disk0s3 limits:

diskutil resizeVolume disk0s3 limits

Best Answer

Simply resizing Files (disk0s3) and then expanding the container (disk0s2) while "shifting" disk0s3 won't work.

You have to take this path:

  1. Resize disk0s3 with diskutil:

    diskutil resizeVolume disk0s3 40g
    
  2. Create a fourth partition Files2 (HFS+) with Disk Utility at the end of the disk
  3. Copy all files from Files to Files2
  4. Remove disk0s3 (Files) with Disk Utility
  5. Rename Files2 to Files
  6. Expand disk0s2 (if not already done automatically in step 4):

    diskutil ap resizeContainer disk0s2 0