Understanding Free Space on APFS Volumes

What

This article explains how free space is calculated on APFS volumes and how it differs from traditional file systems like HFS+.

When/Why

Understanding free space on APFS volumes is essential for managing storage on macOS devices, as it helps users and administrators make informed decisions about disk usage and maintenance.

How

  1. Traditional file systems (HFS+): Calculating free space on HFS+ volumes involves subtracting the total occupied storage blocks from the total volume capacity.

  2. Snapshots: APFS snapshots complicate free space calculations as they dynamically occupy storage blocks. Deleting snapshots can free up space, but the amount depends on other snapshots and their deletion.

  3. Clones: Cloned files in APFS initially share storage blocks, but as their data diverges, they consume additional space. Finder reports cloned files as separate entities, but APFS accounts for shared storage blocks.

  4. Sparse files: These files contain little data relative to their overall size. Copying or saving sparse files without preserving their format causes them to expand to full size, consuming more space.

  5. Other volumes: APFS containers share free space among their volumes, unlike HFS+ volumes. Data and VM volumes, in particular, share free space, with macOS determining the VM volume's usage.

  6. Free space control: APFS and macOS control free space, with figures changing depending on snapshots, clones, sparse files, and VM volume usage. APFS provides estimates for "important usage" and "opportunistic usage" free space.

The impact of these factors on APFS free space calculations makes it challenging to precisely determine available storage. It's crucial for users and administrators to understand these complexities to effectively manage storage and device performance. By being aware of snapshots, clones, sparse files, and shared volumes, users can make more informed decisions regarding storage allocation and maintenance, ensuring optimal device performance and efficient use of resources.

There is also an open-source tool that can aid in seeing more accurate free space information linked to below.

  1. Free space on an APFS volume is an illusion – The Eclectic Light Company
  2. GitHub - scriptingosx/diskspace: macOS command line tool to return the available disk space on APFS volumes

Revision #2
Created 13 June 2023 18:34:35 by Josh Levitsky
Updated 24 July 2023 14:21:54 by Josh Levitsky