how to shrink/resize apfs?
Asked Answered
M

1

9

I want to shrink the boot file system's size(formatted as APFS), how to do it?


In macOS Sierra, HFS+ can be shrunk without reboot/remount(in disk utility), but in macOS High Sierra, it seems impossible.

Micromillimeter answered 11/6, 2017 at 16:12 Comment(2)
I'm also looking to figure this out. Have you found a fix?Deeann
@CharlesTruluck not yet.Micromillimeter
L
3

The command you are looking for is diskutil apfs resizeContainer:

Usage:  diskutil APFS resizeContainer <inputDisk> <newSize> [<triple>*]
        where <inputDisk> = A Container Reference DiskIdentifier (preferred)
              or a Physical Store DiskIdentifier
              <newSize> = the desired new Container or Physical Store size
              <triple> = a { fileSystemPersonality, name, size } tuple
Resize an APFS Container. One of the Container's Physical Store disks will be
resized, and therefore its Container will be resized by an equal amount. You
can specify a new size of zero to request an automatic grow-to-fit operation.
If the new size implies a shrink, you can specify ordered triples in the same
manner as diskutil partitionDisk, etc, to fill the partition map's free space
gap that would otherwise result. If there is more than one Physical Store and
you specify a Container Reference, the appropriate Physical Store will be
chosen automatically. Ownership of the affected disks is required.
Example:  diskutil apfs resizeContainer disk5 110g
          diskutil apfs resizeContainer disk5 110g jhfs+ foo 10g ms-dos BAR r
          diskutil apfs resizeContainer disk0s2 90g jhfs+ foo 10g ms-dos BAR r
Lyingin answered 28/7, 2017 at 4:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.