Wednesday, February 23, 2022

How to Check an APFS Backup Store

Howard Oakley:

Checking dozens or even hundreds of backup snapshots stored on hard disks can take many hours.

If you don’t check the snapshots, there’s little point in checking your backup storage, as all your backups are stored in snapshots.

As snapshots are read-only, if they develop errors, it appears that they can’t be repaired anyway.

If a backup snapshot develops an error, there’s no way to replace it, as snapshots can’t be copied from another volume.

Howard Oakley:

Checking and repairing disks is one of the more important tasks performed by Disk Utility, but ever since the introduction of APFS, it has been more fraught than it should have been. One of its most persistent and pervasive problems has been complete failure because Disk Utility has been unable to unmount volumes or containers.


The best news of all is that [in Recovery] you can still use the command tool fsck_apfs directly, and work around this bug in Disk Utility. The bizarre twist is that you can use Disk Utility’s Unmount tool to unmount volumes and containers which the app itself appears unable to unmount successfully.


Apple recommends that you first check and repair volumes within a container, then the container itself, and finally the disk (which you can do completely within Disk Utility). That is oddly the exact opposite order previously recommended by many, and duplicates checks on volumes which are normally repeated when you check their container.

Howard Oakley:

All you can then do [if fsck_apfs finds an error] is delete the whole snapshot, knocking a hole in your backups which can never be replaced. Disk Utility’s typical response only rubs salt into the wound by telling the user to make a backup of the affected disk. As it’s currently impossible to copy backup snapshots to another disk, a single error on that storage compromises all your backups stored there: every single one of them, and there’s absolutely nothing that macOS offers to help that.

I think it’s best to use multiple Time Machine drives and rotate them regularly.

Howard Oakley:

Neither the Time Machine menu nor tmutil verifychecksums work with regular backups to APFS volumes. I’m very grateful to winmaciek for pointing out that this is possible for a special backup using the contextual menu which appears when you Control-Shift-Click on the disk icon in the Time Machine pane.

This produces a special backup which might contain checksums and therefore could be verifiable. However, kapitainsky has checked the log, and reports that all this does is verify the FSEvents database, which has nothing at all to do with integrity checking. Without documentation from Apple, we’re left to guess what this feature does. In any case, there’s no apparent way to make these the default, so even if they do check integrity, they’re of very limited use.

Although APFS does use checksums within file system metadata, it currently has no option to store or check them for file data.


1 Comment RSS · Twitter

This makes me glad that my main systems are still running macOS 10.14 and backing up to an HFS+ formatting external drive.

Leave a Comment