Pcornel
Storage · ZFS

Scrub

Cheat sheet · https://pcornel.dk/topic.php?topic=4029

Back to the Topic

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 scrub
  • zpool status <pool> | grep scan — progress/result
  • systemctl 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 boundaryWhat to verifyProof limit
Identity / topologyPool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective propertiesObject presence alone does not prove integrity, performance or recovery
Capacity / protectionPool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver stateFree space or ONLINE state at one layer does not prove end-to-end health
Failure boundaryA 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
AcceptanceHealthy 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

Confirmation

Confirm action

Continue?