Checksums
conceptYou trust a disk the way you trust a filing cabinet: what you put in is what you'll get back. Mostly, that's true. But disks age and glitch, and once in a long while one hands back subtly wrong data while reporting that everything is fine—no error, no warning, just wrong bytes. Keeping duplicate copies doesn't escape this: with two copies that disagree and no referee, which one is right?
ZFS's referee is the checksum: a tiny fingerprint computed from every piece of data as it's written. Every time anything is read back, ZFS re-computes the fingerprint and compares—so wrong data gets caught the moment anything touches it. Hold two powers apart, because everything downstream depends on the split: noticing damage is guaranteed, everywhere, always. Fixing damage requires a spare copy to fix it from. Fingerprints alone can only tell you what you lost—they can't give it back.
Where you meet them: zpool status has three error columns—READ, WRITE,
CKSUM. A rising CKSUM count means a device returned data that failed
verification: silent corruption, caught in the act. With redundancy present,
ZFS already repaired it from the good copy ("For replicated (mirror, raidz,
or draid) devices, ZFS automatically repairs any damage discovered"—zpool-scrub(8)) and the count is your notification. Persistent CKSUM errors
on one disk mean a dying disk or a bad cable—SATA cables are the classic
false villain, cheap to swap first.
A scrub is this same verification, forced over everything, including cold data nothing has read in years—so corruption gets found while the redundancy to fix it still exists.
What this replaces and what it neighbors:
- Traditional RAID mirrors bytes, not truth. Feed it silent corruption and it mirrors the corruption faithfully; ask it which side of a disagreement is right and the interface has no such question. Checksums are the missing arbiter—this is what "self-healing" actually is: detection (checksum) plus a decidable repair (the copy that verifies).
- Bit rot is the phenomenon checksums exist for—media degrading in place, cosmic-ray flips, firmware lies. Rare per-block, near-certain at pool-scale over years.
- The ECC question—checksums verify the disk's honesty; RAM sits above them. The panic version of that observation is mostly myth, but the layering is real (see The ECC Question).