Corrupted Time Machine backups; zfs to the rescue
Since upgrading to OS X Lion, I’ve been getting corrupted Time Machine backups now and again, where OS X declares it must erase the entire backup volume and start again. Apparently this is not uncommon. Erasing the backup volume means the entire backup history is lost, which is not nice at all.
Well, my Time Machine volume is actually a network share, hosted by my trusty BSD server at home. The filesystem used on the server is zfs and as such, supports its own built-in backup scheme: snapshots. The server is configured to create and maintain daily snapshots of the file system where the Time Machine backups are stored (up to one week’s worth). Here is how zfs comes to the rescue: when OS X throws up the I’m going to eat your Time Machine backup and start over error, I simply say Thank you, but no. Then I
- Unmount the Time Machine volume in OS X:
sudo umount /Volumes/TimeMachine
- Rollback to a recent zfs snapshot on the server:
zfs rollback timemachine@daily.0
- Choose Back up now from the Time Machine menu
In this way I might have lost the most recent Time Machine backup, but not all backups. Thank you, zfs, and shame on you, Time Machine.