Deduplication
Cheat sheet · https://pcornel.dk/topic.php?topic=4027
Answer
When deduplication is enabled, ZFS identifies identical block content by checksum and maintains references through the DDT rather than storing duplicate physical blocks repeatedly. The DDT can become large and performance-sensitive; its working set, metadata placement and memory/cache behavior must be planned before enabling dedup on large datasets.
Remember
- Deduplication ≠ compression.
- Deduplication ≠ backup.
- High dedup ratio ≠ low DDT memory/metadata cost.
- Turning dedup off affects future writes; it does not automatically expand existing shared blocks into duplicates.
First checks
zpool list— DEDUP ratiozpool status -D <pool>— DDT histogramzdb -S <pool>— simulate dedup savings
Verify in this order
write → hash → DDT lookup → store or reference
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 → Deduplication 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 dedup hit proves a matching block representation was reused; it does not prove backup independence, low metadata cost or that dedup is beneficial for the overall workload. | Correlate ZFS evidence with both workload and lower device/path evidence |
| Acceptance | Healthy evidence: dedup ratio justifies cost, DDT working set and latency fit available resources, DDT storage is properly protected, and workload remains within baseline. | 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=4027