APFS Containers, Object Maps and Recovery States
APFS never modifies on-disk objects in place, so older versions of metadata can remain on disk after newer ones are written. Recovery means choosing a state of the container and volume that can be resolved coherently through checkpoints and object maps, then extracting files from it. Readable metadata or a valid checksum does not by itself show that this state is current or that the files in it are complete.
- A coherent view does not need every object to carry the same transaction ID; object maps resolve each virtual object as of a chosen point.
- Physical, virtual and ephemeral objects are located in different ways; not everything goes through one object map.
- Older checkpoints and object versions can survive, but they may also be reclaimed; APFS is not an archive.
- A valid checksum shows a block is intact, not that it belongs to the chosen view or that file content is complete.
- Extract from a preserved copy to other storage; do not rewrite block zero or checkpoints, or mount the source to diagnose it.
Container, volumes and a simplified model
An APFS container holds one or more volumes that share its free space, along with features such as cloning, snapshots and encryption. A simplified model runs from a GPT partition through the container superblock and checkpoints, the container object map and space manager, to each volume with its own superblock, object map and file-system trees. More of these layers are shared between volumes than in a single NTFS or ext4 volume.
A single partition is the simplest case, not the only one. Apple’s File System Reference describes Fusion containers built from partitions on a hard drive and a solid-state drive, each with its own copy of the container superblock at block zero. Where a container spans devices, every member is part of the evidence; this page does not cover those layouts in detail.
Physical, virtual and ephemeral objects
The reference states that, regardless of storage type, objects on disk are never modified in place; modified copies are written to a new location. How an object is found depends on its type:
- Physical objects are identified by their block address. A modified copy is at a new address, so it has a different object identifier.
- Virtual objects keep the same identifier across versions. Their location is looked up in an object map, using a transaction identifier (XID) as well as the object identifier (OID) to say which point in time is wanted.
- Ephemeral objects live in memory while the container is mounted and are persisted in a checkpoint when it is not.
So an object map is not a single index of everything on the container. A reconstruction that treats all objects as virtual, or looks every one of them up the same way, will misread physical and ephemeral structures.
What a coherent view requires
A coherent state does not mean that every object carries the same XID. The reference’s lookup rule for a virtual object is to search the object map for a key with the desired OID and an XID less than or equal to the desired one, and, if several qualify, to use the one with the largest XID. Objects that did not change in the latest transactions are therefore legitimately resolved through older entries. Mapping flags also matter: a mapping can, for example, be marked as a deleted-object placeholder rather than a usable location.
Illustration: resolving two objects for one view
For a view at XID 120, object A’s newest mapping at or below 120 has XID 117; object B has a mapping at XID 120.
Both mappings belong to the same view. A was simply not changed after transaction 117.
Resolve each object by the lookup rule and its flags, rather than searching for a copy of A stamped exactly 120.
A teaching example. Real lookups also depend on mapping flags, object types and format details not shown here.
The reverse error is just as real. The newest readable copy of an object is not automatically part of the newest valid view: a write may have been interrupted, or the object may belong to a transaction that never completed. A valid object checksum shows that a block is internally intact. It does not show that the block is the one the chosen view references, and a checksummed metadata object says nothing about whether the file content it describes is complete.
Checkpoints and older states
At mount, the reference describes reading block zero, which holds a copy of the container superblock that may be the latest or an older version, using it to find the checkpoint descriptor area, and choosing the container superblock there with the largest XID that is not malformed, for example by checking its magic number and checksum. The descriptor area is a ring buffer, so older checkpoints are overwritten as new ones are written.
Damage to block zero therefore does not necessarily mean that no usable container state exists. Older checkpoints, and older versions of volume superblocks and trees, may still be on disk. They may also already have been reclaimed, overwritten or left inconsistent; a checkpoint area is not an indefinite archive. Rewriting block zero or a checkpoint to make a container mount can destroy exactly the older states that recovery needs, as described in Why Mounting a Damaged File System Can Be Risky.
Trees can fail at different levels
APFS keeps inode, directory, extent and extended-attribute records in B-trees. “Volume corrupt” is not one condition: the volume superblock can be readable while the root tree is not reachable, the root tree can be reachable while some nodes are damaged, an inode can exist while its extents are missing, and extent records can survive while the content they point to has been overwritten. Diagnosis identifies which tree, and which version of it, cannot be resolved. Recovery can deliberately choose an older, complete state over a newer broken one, the same principle described in Storage Metadata Generations and Consistency.
Snapshots are metadata branches
A snapshot keeps an earlier view of a volume by keeping its metadata and the blocks it references alive, not by copying every file. The reference defines a snapshot metadata tree for each volume and object-map snapshot records. An active volume can be damaged while an earlier snapshot is still coherent, and deleting a file from the active view does not free blocks a snapshot still references. Snapshots live on the same container as the data, so they are not an independent backup; see Recovering Data from Snapshots and Previous Versions.
Shared space, clones and encryption
Apple describes volumes in one container as sharing its free space, and clones as sharing unmodified blocks, with changes written elsewhere. Summing logical file sizes therefore overstates unique physical storage, and container capacity, per-volume allocation, snapshots and clones have to be tracked separately; see Allocation Metadata, Orphaned Files and Lost Space.
Encryption is a separate dependency. The reference describes container and volume keybags, and object-map values carry flags for encrypted objects. A structurally complete reconstruction of an encrypted volume still produces ciphertext without the right key context. Which keys are involved, and how they depend on the Mac’s hardware, is covered in FileVault, APFS Encryption and Hardware-Bound Keys.
Working on a chosen state
Work from a preserved image of every device in the container. Choose a candidate state, resolve it read-only in a tool that parses APFS without mounting the source, and extract files to other storage. Then check the result:
- the chosen checkpoint and XID are recorded, with the reason for choosing them;
- the files needed are present, and their content opens and matches expected sizes and structures across their whole length;
- files that come from an older state than the user expects are labelled as such;
- any ranges that could not be resolved, or that depended on missing keys, are listed.
Look for the newest state that resolves coherently through checkpoints and object maps, not the newest object that happens to be readable, and do not expect every object in that state to share one transaction ID.
Technical references: Apple File System Reference — Objects (storage types, copy-on-write); Object Maps (lookup by OID and largest XID ≤ requested, value flags); Mounting an Apple File System Partition (block zero, latest valid checkpoint); Container (checkpoint ring buffer, Fusion, keybags) · Apple: About Apple File System — clones share unmodified blocks, volumes share free space. The reference is dated June 2020 and was checked October 2026; features added in later macOS releases may not be described in it.
Related: APFS Container or Volume Corruption (macOS) · Filesystem Journals and Crash Consistency · Allocation Metadata, Orphaned Files and Lost Space · Storage Metadata Generations and Consistency · Recovering Data from Snapshots and Previous Versions · File-System Recovery vs. File Carving · FileVault, APFS Encryption and Hardware-Bound Keys · Why Mounting a Damaged File System Can Be Risky