Scrub
Cheat sheet · https://pcornel.dk/topic.php?topic=4029
Answer
A scrub systematically traverses allocated pool blocks and validates them against ZFS checksums. It is distinct from normal foreground reads and from resilvering missing/out-of-date replicas after topology changes. Scrub duration and impact depend on pool size, allocation, workload and device performance.
Remember
- Scrub ≠ backup.
- Scrub ≠ resilver.
- Scrub complete with errors repaired ≠ application consistency proof.
- No scrub errors ≠ future device failure impossible.
First checks
zpool scrub <pool>— start scrubzpool status <pool> | grep scan— progress/resultsystemctl list-timers | grep -i scrub— scheduled scrubs
Verify in this order
scrub → read all blocks → verify → repair
Where it usually breaks
First mismatch in member media → metadata/layout → allocation/placement → redundancy/recovery → logical object → consumer; preserve identity/pre-state before mutation.
ZFS → Scrub ZFS map
| ZFS boundary | What to verify | Proof limit |
|---|---|---|
| Identity / topology | Pool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective properties | Object presence alone does not prove integrity, performance or recovery |
| Capacity / protection | Pool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver state | Free space or ONLINE state at one layer does not prove end-to-end health |
| Failure boundary | A clean scrub proves allocated blocks read during that scan matched checksums or were successfully repaired; it does not prove application-level consistency, backup recoverability or blocks created afterward. | Correlate ZFS evidence with both workload and lower device/path evidence |
| Acceptance | Healthy evidence: scrub completes within expected window with zero unexplained permanent errors, redundancy stays intact, and workload remains within acceptable latency. | Close only after original workload plus checksum/read-back/recovery verification succeeds |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4029