APFS Internals
A deep dive into the Apple File System. The series began as the
2022 APFS Advent Challenge and has
since grown into a 27-part reference covering the container layer, B-Trees, the
volume and file-system layer, integrity and encryption, and APFS’s advanced
features. The original posts have been revised and kept up to
date rather than left as 2022
snapshots. The on-disk structures documented throughout are current as of macOS
27 Beta (apfs-3277.0.0.0.1).
Foundations
- Anatomy of an ObjectAPFS is a copy-on-write file system, consisting of a set of immutable objects that are...
- Kinds of ObjectsAs we discussed in our last post, objects are the fundamental building blocks of APFS....
The Container Layer
- ContainersAPFS is a pooled storage, transactional, copy-on-write file system. Its design relies on a core...
- NX Superblock ObjectsThe NX Superblock Object is a key component of APFS. It stores key information about...
- Checkpoint Maps and Ephemeral ObjectsIn our last post, we discussed NX Superblock Objects and how they can be used...
B-Trees and Indexing
- B-Trees (Part 1)In yesterday’s post, we discussed Checkpoint Maps, the simple linear-time data structures that APFS uses...
- B-Trees (Part 2)Mastering the skill of B-Tree traversal is essential in parsing information from APFS. Our last...
- Object MapsEarlier in this series, we discussed APFS Containers and how they address physical objects via...
Container Internals
- Space ManagerIn our earlier post on Containers, we introduced the Space Manager as the subsystem responsible...
- The ReaperIn our post on Containers, we introduced the Reaper as the subsystem responsible for garbage...
- EFI JumpstartAPFS containers include an embedded EFI driver that allows UEFI firmware to boot from APFS...
The Volume and File-System Layer
- Volume Superblock ObjectsThe Volume Superblock is a data structure containing key information about an individual APFS volume....
- File System TreesEach APFS volume has a logical file system stored on disk as a collection of...
- Inode and Directory RecordsEach APFS file system entry has both an inode and directory record. The inode record...
- Hard Links and SiblingsIn our post on Inode and Directory Records, we noted that a single inode may...
- Data StreamsData in APFS that is too large to store within records is stored elsewhere on...
- Transparent Compression (DECMPFS)APFS supports transparent file compression through the DECMPFS (Decompression File System) framework, shared with HFS+....
- ClonegroupsIn our post on Data Streams, we discussed how APFS implements file cloning through shared...
Integrity and Encryption
- Sealed VolumesWith the release of macOS 11, Apple added a security feature to APFS called sealed...
- KeybagsAPFS is designed with encryption in mind and removes the need for the Core Storage...
- Wrapped KeysIn our last post, we discussed both Volume and Container Keybags and how they protect...
- DecryptionNow that we know how to parse the File System Tree, analyze keybags, and unwrap...
- Encryption RollingIn our posts on Keybags, Wrapped Keys, and Decryption, we covered the static encryption architecture...
Snapshots and Advanced Features
- Snapshot MetadataEarlier in this series, we covered how Object Maps facilitate the implementation of point-in-time Snapshots...
- Volume GraftingVolume grafting is a mechanism introduced in macOS 13 that mounts a disk image’s APFS...
- Fusion ContainersAs we discussed in an earlier post, Apple’s Fusion Drives combine the storage capacity of...
- Speculative TelemetrySpeculative telemetry is an APFS feature that tracks the lifecycle of speculatively downloaded files: content...