How do you INCREASE the size of an APFS volume?

24.8k Views Asked by At

I've created an APFS volume on a MBP running High Sierra in order to use it as a Time Machine drive for the iMac I use at work (we don't have a backup solution so this is my hacky way to keep myself safe as the MPB itself is backed up separately).

I foolishly assumed 100GB would be enough (as I only back up certain folders) however in less than a week the iMac has filled it and Time Machine is complaining about insufficient disk space.

I am trying to figure out a way to expand the volume (to say 150GB) however every help page and blog I can find shows you how to shrink a container.

I've tried using Disk Utility but it doesn't give me the option to resize individual volumes (only the overall container). Disk Utility Screenshot

I've also tried using the diskutil in terminal but don't want to break things.

I'd prefer not to dump and re-create the partition of possible, but if it's the only option I will deal with it.

Cheers

Matt

3

There are 3 best solutions below

2
On

Find out your container first with: diskutil apfs list

Say you found out its disk0, then you do:

sudo diskutil apfs resizeContainer disk0 0

In my example (see screenshots) you see that disk1 container grew, and this was the one line in the output that indicates a happier you:

"Growing APFS Physical Store disk0s2 from 864,999,997,440 to 1,000,345,825,280 bytes"

Before and after output of diskutil list: (note disk1)

enter image description here enter image description here

2
On

The longer story is true.

But does not mention two facts about APFS volumes.

Quota: When creating a volume, the use can specify the maximum space that new volume will be allowed to use, of the total space in that volume's container. That volume can not use more space.

Reserve: When creating a volume, the use can specify an amount of space in the container, which will be reserved for that new volume. No other volume in the container can use space that would reduce the available space below the sum of the reservations of the other volumes.

So, the next question is: can the quota or reserve be changed? Not using Disk Utility. How about using diskutil in the Terminal interface? (Answer: maybe so. But, dear reader, be very careful. And know that Apple Care says: "We do not support Terminal.")

0
On

Short answer: APFS volumes cannot be resized, only APFS containers.

Longer story: An APFS volume exists inside an APFS container but not outside of it. That APFS container is the "thing" that in reality occupies space, i.e. bytes, on a medium, not the APFS volume. Hence only APFS containers can be resized but not APFS volumes. If one thinks of APFS volumes as being "just fancy labels for virtual space", then it becomes much clearer what is what. The direct effect of this is that within an APFS container the volumes coexist and compete for the remaining/free/unallocated space of the container.