How to know your backup actually worked
A finished copy isn't always a good copy. Here's how checking works, and how to do it.
By Liam McGarrigle · · 5 min read


You may have seen a photo like this in a backup before. The top looks fine and the bottom is gray, or full of colored stripes. Even more often, the photo won't open at all. The strange part is that the copy usually looked perfect when it finished: same name, same size, no error.
How a copy goes bad
Usually it's something boring. A loose cable, a card reader on its way out, a drive with a weak spot, or a computer that says it saved something a moment before it really did. Most of the time nothing warns you. The copy finishes and it looks like it worked.
It happens more than you'd think. A study of 1.53 million drives in real storage systems found more than 400,000 cases where data read back from a drive didn't match the fingerprint stored with it.
Dragging a folder in Finder won't catch this. Finder copies the files and tells you about errors it runs into along the way, but it never reads the copy back to compare it with the card.
How checking works: fingerprints
The fix is to read the copy back and compare it with the original. The usual way to do that is with a fingerprint (you'll also see it called a checksum).
A fingerprint is a short code generated from every pixel of a photo. Change a single pixel anywhere and the code, that fingerprint, comes out completely different. So you generate the fingerprint of the photo on the card, then the fingerprint of the copy, and compare the two short codes.


Two details separate a real check from one that only looks like one:
- 1Read the copy from the drive itselfYour Mac keeps files it just copied in memory to speed things up. A careless check reads that memory instead of the drive, and of course the memory matches. A real check makes sure what it compares came off the drive.
- 2Check every fileComparing sizes or counting photos only tells you the copy is the right size. A broken photo usually is.
Checking your copies yourself
The simplest check is to open every photo from the import and look at it. It's slow, and it won't catch everything, but a broken copy usually shows up as a photo that won't open, or one that's gray partway down.
This next part is more advanced, but it's how you can check fingerprints by hand. Terminal on a Mac has a fingerprint tool built in called shasum, and this checks a whole card against its copy, as long as the copy keeps the same folders as the card.
1. Make a list of fingerprints from the card: cd /Volumes/CARD && find . -type f -not -path './.*' -exec shasum -a 256 {} + > ~/card.txt
2. Eject your backup drive and plug it back in, so your Mac reads the copy from the drive and not from memory.
3. Go to the copy and check it against the list: cd "/Volumes/Backup/Maya and Jonah" && shasum -a 256 -c ~/card.txt
Every line should end in OK. Swap in your own card and folder names.
If you don't want to work out fingerprints yourself, I built it into Backup Studio. An import isn't complete until every photo's fingerprint has been generated and checked against the original, so you know you're backing up your clients' memories and not files full of static.
Questions
- What does it mean to verify a backup?
- It means reading the copy back and making sure it matches the original, usually by comparing fingerprints (also called checksums). Without that, all you know is that the copy finished.
- Is comparing file sizes enough?
- No. A damaged photo is often exactly the same size as a good one, because the damage changes pixels inside the file without adding or removing any.
- Does Finder check the files it copies?
- Not the way a backup needs. Finder tells you about errors it runs into while copying, but it doesn't read the copy back afterward and compare it with the original.