The File System: APFS

macOS

Chapter 7 · The File System: APFS

Everything the last six chapters covered — Darwin, the Unix toolset, Homebrew's installs, .app bundles — ultimately sits on top of a filesystem. This chapter goes there directly: APFS, Apple's own modern replacement for the decades-old HFS+, and the one place on this site where macOS's own filesystem choices can be set directly against Linux Filesystems' real, detailed coverage of ext4, Btrfs, and ZFS.

From HFS+ to APFS

APFS (Apple File System) shipped in 2017 with macOS High Sierra (10.13), replacing HFS+ — a filesystem whose lineage traces back to the original 1985 HFS, extended in 1998, and never fundamentally redesigned for the storage hardware that had taken over by the 2010s. HFS+ was built with spinning hard drives in mind; APFS was purpose-built for flash/SSD storage (while still working fine on spinning disks), and fixed several real, concrete limitations along the way — most notably HFS+'s 32-bit inode numbering, which put a hard, practical ceiling on how many files a volume could ever hold. APFS uses 64-bit inode numbers instead, removing that ceiling for any realistic modern use.

Snapshots: Copy-on-Write, Apple's Way

APFS's standout feature is the snapshot — a point-in-time, read-only capture of a volume's state, made possible by copy-on-write: creating a snapshot doesn't copy the whole volume, it just marks the current state and only starts consuming extra space once existing data actually changes afterward. This is the exact same underlying idea Linux Filesystems 3 covered in real depth for Btrfs — copy-on-write snapshots as a headline filesystem feature, not a bolted-on backup tool.

macOS leans on this constantly, often invisibly: Time Machine (Chapter 9) keeps hourly local snapshots on the internal drive even before a Time Machine backup disk is ever connected, and macOS's own installer can snapshot the current system state before a major OS update, enabling a rollback if the update goes wrong.

tmutil listlocalsnapshots / # list local Time Machine snapshots on the boot volume diskutil apfs list # inspect APFS containers and volumes directly
The same warning Linux Filesystems 3 already gave, unchanged
A snapshot lives on the same physical disk as the data it captured — if that disk fails entirely, the snapshot is gone along with everything else. Linux Filesystems 3 was explicit that "snapshots are not backups," and that holds exactly as true for APFS: a snapshot protects against accidental deletion or a bad update, not against disk failure. Real redundancy still requires an actual separate backup destination — for macOS, that's Time Machine's own external or network disk, covered in Chapter 9.

Containers & Space Sharing: A Different Model Than Fixed Partitions

Rather than carving a disk into fixed-size partitions the way traditional partitioning schemes do, APFS groups related volumes inside one container, and every volume in that container dynamically shares the same underlying free space. Creating a new APFS volume doesn't require deciding a fixed size up front the way creating a new partition would — every volume in the container can grow or shrink as needed, up to the container's total capacity.

The Signed System Volume: Integrity Built Into the Filesystem

Since macOS Big Sur (11), the entire system volume — the read-only portion of macOS holding the OS itself — is cryptographically hashed at the block level into what Apple calls the Signed System Volume. Any unauthorized modification to system files is detectable, because the volume's own cryptographic seal would no longer match. This extends Chapter 6's own signing/notarization/Gatekeeper trust chain one level deeper: it isn't just individual apps being checked for integrity anymore, but the operating system's own files, verified at the filesystem layer itself.

APFS vs. ext4, Btrfs & ZFS

FilesystemDesign era/targetCopy-on-write?Snapshots
ext4 (Linux Filesystems 2)Traditional default, journaling, not CoWNoNot natively supported
Btrfs (Linux Filesystems 3)Modern CoW filesystem with subvolumes and checksummingYesNear-instant, near-free, native
ZFS (Linux Filesystems 4)A different philosophy entirely — integrated volume management + filesystemYesNative, plus send/receive replication
APFS (macOS)Purpose-built for flash/SSD, released 2017YesNative, powering Time Machine and OS-update rollback
Where APFS actually sits among the site's other filesystems
APFS isn't a fourth, unrelated design — it's Apple's own single-vendor answer to exactly the same modern filesystem problem Btrfs and ZFS were each independently built to solve: copy-on-write, cheap snapshots, and integrity checking, all as native filesystem features rather than something layered on top afterward the way ext4 relies on separate tools like LVM (Linux Filesystems 5-6) for snapshot-like functionality at all.

Where This Course Is Headed

The built-in security stack in full — Gatekeeper's own neighbors XProtect, FileVault, and System Integrity Protection — Time Machine and Recovery (leaning directly on this chapter's own snapshot material), networking and sharing, everyday troubleshooting tools, and a capstone setting up and securing a complete new Mac end to end.

Hands-On Exercises

Exercise 1

Explain the specific technical limitation of HFS+ that APFS's 64-bit inode numbering fixed, and why that limitation existed in the first place given when HFS+'s design originated.

📄 View solution
Exercise 2

This chapter repeats Linux Filesystems 3's own warning that "snapshots are not backups." Explain specifically why an APFS snapshot doesn't protect against disk failure, and what actually would.

📄 View solution
Exercise 3

Explain how an APFS container's space-sharing model differs from traditional fixed-size disk partitioning, and how this chapter's own finding-box positions APFS relative to Btrfs and ZFS rather than treating it as an unrelated fourth design.

📄 View solution

Chapter 7 Quick Reference

  • APFS — replaced HFS+ in 2017 (High Sierra); built for flash/SSD, 64-bit inodes (no more HFS+ file-count ceiling)
  • Snapshots — copy-on-write, near-instant, near-free; power Time Machine and OS-update rollback — but are not a substitute for a real backup, exactly per Linux Filesystems 3's own warning
  • Containers — volumes dynamically share free space, unlike fixed-size traditional partitions
  • Signed System Volume — the OS's own files cryptographically hashed at the block level since Big Sur, extending Chapter 6's trust chain into the filesystem itself
  • tmutil listlocalsnapshots / diskutil apfs list — inspect snapshots and containers from Terminal
  • This chapter's own throughline: APFS is Apple's single-vendor answer to the same CoW/snapshot/integrity problem Btrfs and ZFS were each independently built to solve
  • Next chapter: Built-in Security Features — Gatekeeper Revisited, XProtect, FileVault & System Integrity Protection