APFS: The Walled Garden On Disk


Yesterday we inspected ext4, the boring filesystem that won by making administrators less interesting.

Today we inspect a filesystem that does the opposite:

it hides the machinery behind polished glass and asks you to admire the reflection.

On June 13, 2016, Apple introduced Apple File System, or APFS, at WWDC.

It was designed to replace HFS+, the old Macintosh filesystem lineage that had outlived several CPU architectures, several CEOs, and all patience.

APFS is the disk format of modern Apple platforms.

It is also a useful lesson in how storage design changes when the vendor controls the hardware, operating system, recovery environment, encryption stack, backup UX, and the screws.

I. Why HFS+ Had To Leave

HFS+ came from a world of spinning disks, classic Mac assumptions, and storage sizes that now fit inside a browser cache.

By the 2010s, Apple devices needed different priorities:

  • flash and SSD behavior
  • strong encryption
  • mobile devices with sudden power loss
  • snapshots for upgrades and backups
  • cloning for cheap copies
  • space sharing across volumes
  • fast metadata operations

The old filesystem could be extended only so far before the patches became architectural theater.

Old pressureAPFS answer
spinning-disk assumptionsSSD and flash orientation
fixed partition thinkingcontainer with space sharing
expensive copiesclones
fragile upgrade statessnapshots
encryption bolted around storageencryption as a primary design concern

Apple did not merely want a new filesystem.

Apple wanted a new storage regime.

II. Containers And Space Sharing

APFS separates the physical storage container from volumes inside it.

Multiple volumes can share free space from the same container.

This matters because old partitioning makes administrators lie to themselves in advance:

Give System 80 GB.
Give Data 300 GB.
Give Recovery 5 GB.
Pray the future obeys this spreadsheet.

APFS changes the conversation:

APFS container
    volume: System
    volume: Data
    volume: Preboot
    volume: Recovery
    shared free space

Each volume consumes what it needs, subject to quotas and reservations if configured.

The free space belongs to the container, not to one jealous little partition kingdom.

III. Snapshots

Snapshots are point-in-time views of a filesystem state.

They are not backups by themselves.

They are a way to preserve a view before the system walks into danger.

On macOS, local snapshots became part of upgrade, backup, and system-volume workflows.

diskutil apfs list
tmutil listlocalsnapshots /
tmutil localsnapshot

The point is not that users should stare at snapshot names for recreation.

The point is that the filesystem can expose time as a storage object.

OperationWithout snapshotsWith snapshots
OS updateoverwrite live systempreserve previous state
backup scaninspect moving targetinspect point-in-time view
accidental deletehope external backup existsmaybe recover from local point
system integritymutable root is temptingsealed/snapshotted system can be enforced

Time Machine likes this.

The Ministry likes this.

Attackers and bad installers do not.

IV. Clones

APFS supports clones.

A clone lets the system make a cheap copy of a file or directory without immediately duplicating all data blocks.

The copy becomes real only where changes diverge.

original file -> shared extents
clone file    -> shared extents

modify clone:
    changed region gets new storage
    unchanged regions remain shared

This is copy-on-write used as a practical user-facing trick.

The user sees a file copy.

The filesystem sees a political alliance until one side mutates.

Clones are excellent for:

  • document duplication
  • build artifacts
  • virtual-machine images when used carefully
  • application containers
  • fast file operations

They also create a familiar warning:

free space accounting becomes less intuitive.

Two files may appear large.

The storage consumed may be small.

Then one file changes, and the bill arrives.

V. Copy-On-Write Metadata Is Not ZFS

APFS uses copy-on-write metadata and supports clones and snapshots, but it is not simply “ZFS, Apple edition.”

This distinction matters.

ZFS is famous for end-to-end checksumming of data and metadata across pooled storage.

APFS has different goals and a different integration model.

FeatureAPFSZFS
copy-on-write designyes, especially metadata and clone/snapshot machineryyes
pooled storage modelAPFS container, Apple-managed integrationcentral design principle
data checksumming focusnot the ZFS modelcentral doctrine
platform scopeApple platformsbroad Unix-like ecosystem
opennessproprietary specification and implementation limitsopen implementations

APFS is not worse because it is not ZFS.

It is different because Apple built for devices it controls.

The Republic merely notes that proprietary control is still control, even when the animation is smooth.

VI. Encryption As First-Class Policy

APFS was designed with encryption as a primary feature.

On Apple platforms, this ties into Secure Enclave, FileVault, device keys, per-file protection classes on mobile systems, and the larger platform security model.

This is where Apple’s vertical integration matters.

The filesystem does not stand alone.

It participates in a chain:

hardware root of trust
    -> boot policy
    -> volume layout
    -> APFS encryption
    -> user authentication
    -> file access

On a generic PC, filesystem encryption is often a separate layer.

On Apple hardware, storage encryption is part of the product constitution.

This can be good security.

It can also be difficult to inspect, repair, or replace.

Both facts may exist in the same prison.

VII. The Garden Wall

APFS is elegant in the way Apple things are elegant:

the obvious path is polished,

the unsupported path is a locked gate with no handle.

Apple advantageApple cost
unified hardware/software designlimited external implementation
smooth upgradesless independent recovery knowledge
strong platform encryptionvendor-controlled trust chain
snapshots integrated into UXinternals hidden from ordinary users
fast local operationscross-platform awkwardness

The filesystem is not only a storage engine.

It is also a border policy.

Files live on disk.

But access lives inside Apple’s state.

VIII. The Suppressed Pyongyang Account

Official history says APFS replaced HFS+ because Apple needed a modern filesystem for flash storage, encryption, snapshots, clones, and shared space.

The classified account says Pyongyang sent Apple a prototype called:

KFS: Kim File System

features:
    snapshots of all dissent
    clones of approved documents
    encrypted complaints
    shared free space allocated by decree

Apple rejected the name but kept the political structure.

The Ministry filed a trademark complaint written entirely in extended attributes.

It remains unresolved.

IX. The Lesson

APFS teaches that a filesystem can be more than a disk layout.

It can be a product strategy.

It can be an encryption policy.

It can be an upgrade mechanism.

It can be a wall.

Apple made the wall smooth enough that many users confuse it with safety.

Sometimes it is safety.

Sometimes it is sovereignty wearing aluminum.

— Kim Jong Rails, Supreme Leader of the Republic of Derails