DEV Community

DiskBee(NTFS for Mac)
DiskBee(NTFS for Mac)

Posted on Fully Autonomous

APFS Volumes Share Free Space: Reading df and diskutil Without Double-Counting

This is the part of df that can make an APFS container look suspicious:

Filesystem       Size   Avail  Mounted on
/dev/disk3s1s1  228Gi   16Gi   /
/dev/disk3s5    228Gi   16Gi   /System/Volumes/Data
Enter fullscreen mode Exit fullscreen mode

I kept only the size, available-space, and mount-point columns from output on one macOS 26.0.1 machine. The identifiers and sizes are examples from that machine, not values to expect elsewhere.

Two mounts report the same total and the same available space. There are not 32 GiB of independent free space here. There is roughly 16 GiB available to the APFS container that both volumes belong to.

The container is the pool

An APFS volume is not a traditional fixed-size partition. Volumes in one container share its available storage. Adding a volume does not split the container into two smaller physical disks.

That model explains why df can repeat Size and Avail while reporting different Used values for the mounts. On the machine above, / was the sealed system snapshot and /System/Volumes/Data was the writable data volume. Their contents and consumption were different, but their available-space figure came from the same container.

This also means a familiar shortcut is wrong: do not add the available space reported by two volumes in the same container. You would count the same free blocks twice.

The distinction matters on external disks too. If you create Work and Archive as two APFS volumes in one container, either volume can grow while the container has room. One volume consuming more space can reduce what the other volume sees. If you want two rigidly separated capacity budgets, separate quotas or separate containers answer a different question than simply creating another volume.

Confirm the relationship before calculating

Start with the mount-level view:

df -h / /System/Volumes/Data
Enter fullscreen mode Exit fullscreen mode

For a removable volume, add its actual mount path instead of guessing from its label. Spaces in mount paths need shell quoting.

Next, ask diskutil which container a volume belongs to:

diskutil info /System/Volumes/Data
Enter fullscreen mode Exit fullscreen mode

Look for APFS Volume Disk and APFS Container Reference. On the checked machine, the data volume was disk3s5 and its container reference was disk3. Those identifiers are session- and machine-specific; do not copy them into a destructive command on another Mac.

Then inspect the container and all its volumes:

diskutil apfs list
Enter fullscreen mode Exit fullscreen mode

The output is longer, but it joins the pieces together: the container has a capacity and free-space figure, and each listed volume has its own Capacity Consumed value. Use the volume-to-container relationship to decide which numbers may be compared and which available-space values are duplicates. All three commands above are read-only.

A container-wide view still does not tell you which directory to clean. It answers a capacity question, not a file-attribution question. For that you need a separate disk-usage investigation.

Reserve and quota are policies, not partitions

Apple's Disk Utility guide describes an optional reserve size as a minimum amount of storage reserved for a volume, and an optional quota as the maximum amount that volume can use. Neither setting turns the volume into a separate physical partition.

A quota is the easy case to overlook. The container may report 100 GB available while a particular volume is close to its own quota and cannot consume another 100 GB. Container-wide Avail is therefore not a promise that every mount can accept a write of that size.

A reserve protects an intended minimum for a volume, but it is not an extra free-space allowance that should be added to every other volume's budget. If several volumes have reserves or quotas, write down those policies before estimating how much room is usable for a particular workload. diskutil apfs list is the place to check whether those settings are present.

When the arithmetic still fails

Suppose Work and Archive share a container with 100 GB available. After Archive consumes another 80 GB, Work should no longer be treated as having its own untouched 100 GB. The shared-pool model explains that part.

The reverse operation has a sharp edge. Deleting 40 GB of files does not guarantee that container free space immediately rises by 40 GB. Local snapshots can retain older blocks. APFS clones can share extents, so removing one logical copy may release much less than its apparent size. Purgeable storage and concurrent writes can also make two readings taken at different times difficult to compare.

Those are different retention and accounting questions. Repeating df will not identify the cause, and subtracting the Used columns of two mounts will not produce a reliable ownership ledger. Once the numbers stop matching a simple deletion estimate, inspect snapshots and clone history rather than deleting more files on a guess.

There is also a measurement boundary: df, diskutil info, and diskutil apfs list expose different views. Decimal GB and binary GiB are not interchangeable, and rounding is visible in short output. Compare like with like, allow for active writes, and avoid presenting a rounded terminal value as an exact block count.

The useful sequence is modest: use df to see what a mount reports, use diskutil info to identify its container, then use diskutil apfs list to reason about the shared pool and per-volume policies. That prevents double-counting without pretending the container view can explain every storage discrepancy.

Apple's description of APFS volumes, reserve sizes, and quotas: https://support.apple.com/guide/disk-utility/dskua9e6a110/mac

About the author: we build DiskBee, a macOS NTFS and BitLocker storage tool. This APFS note uses only Apple's read-only diagnostics; DiskBee is not required for the commands above. More about the team: https://www.ntfs.pro/

Top comments (0)