With the cost of storage soaring, ample free space is becoming a luxury few can afford. The cost of each extra terabyte in your Mac mini is now an eye-watering $/€/£ 500 or so. This article looks at how to measure that precious commodity, free space.
The internal SSD in Apple silicon Macs is partitioned into three, with sizes given for a standard 2 TB SSD and macOS 26.6.2:
- iSCPreboot of about 524 MB,
- Recovery of about 5.4 GB,
- Macintosh HD of the remainder, about 1.995 TB.
Container free space
Each of those partitions is a single APFS container, within which all its volumes share common free space. Thus, free space available in the Macintosh HD container is the container’s total capacity, less the size used by each of its volumes. That’s simple to calculate from the listing produced by diskutil apfs list, where there’s also a figure provided for Capacity In Use By Volumes, although that’s usually slightly different from the total Capacity Consumed for each of the container’s volumes.
For example, my Mac mini’s internal SSD has a total capacity of 2 TB, of which 1.995 TB is the Macintosh HD partition/container. diskutil reports that container has 1.158 TB free, giving a difference of 837.101 GB. But the total used by each of those volumes is slightly less at 837.027 GB. Those figures are used by my latest free utility DeltaFree.
Figures reported by the Finder and Disk Utility are in agreement with those, although you need to be careful as to which are given for volumes, and which for containers. Continuing with the same example, the Finder’s Get Info dialog for the Macintosh HD ‘volume’ reports only 826.67 GB as used and Disk Utility claims even less at 814.03 GB.
Although they don’t alter the amount of free space within a container, setting Reserve or Quota Size when creating a volume will affect the amount that individual volumes can use.
Purgeable space
Those figures assume use of the volumes in a container is static, and none of their contents are removed. In reality, macOS volumes usually contain items that are ephemeral and can readily be removed without resulting in any data loss, such as cached web pages. macOS distinguishes this as being purgeable, and its size can vary widely and change rapidly. Should a file operation, such as copying a file to a volume, require more space than is currently free, then macOS may opt to delete items deemed purgeable to augment free space and enable the operation to complete.
This has always been a murky area, as it isn’t clear what operations might justify purging items, nor what items get purged automatically. This is confounded by the statement in Disk Utility’s Help book, that “you can’t manually remove the files that are designated purgeable, but macOS removes them as space is required.”
Three years ago, I looked in detail at snapshots, one category commonly held to be purgeable although they can be removed manually, and found inconsistencies that are confusing. I think I need to revisit that demonstration to see if anything has changed since.
In the case of my Mac mini’s internal SSD, both Disk Utility and the Finder’s Get Info claim that 47.04 GB of the space used by the Data volume is purgeable, amounting to 0.02% of container capacity.
Special files
Some special types of file can also influence the amount of free space actually available for use. In APFS, those include:
- clone files which initially share data with the original, but grow apart as they’re changed;
- sparse files which only store non-null data in a file that is nominally larger;
- files that are compressed by macOS, which appears common in the System volume but unusual outside it;
- dataless files whose data is kept in cloud storage and may be materialised to local storage on demand; these only apply to the Data volume.
Although I have only verified this for the first two categories, APFS uses the space actually taken on disk at the time for the purpose of calculating free space, so any change to those files that requires additional storage would reduce free space, and should be allowed for in planning container sizing and use.
Conclusion
Container free space is a generally reliable guide to the amount of free space available, but allowance should be made for the economies of special files, and the potential for additional space to be purged when required. In practice, those allowances are likely to be small.
