ZFS, Actually Storage you can finally reason about.

Snapshots

concept
depth 2/4 − deeper + surface

A snapshot freezes a dataset at a moment in time, so you can look at— or return to—exactly how things were. The word sounds like a photograph: a duplicate, costing what the data costs. Actually, a ZFS snapshot copies nothing. Because ZFS never writes over existing data anyway, everything the dataset looked like a moment ago is already sitting on disk. A snapshot is just a name attached to that moment, plus a promise: don't throw any of this away while I'm holding it. Taking one is instant and free, no matter how much data is involved.

The cost is deferred, not absent: it builds up slowly, as the live data drifts away from the kept moment and the old pieces can't be thrown out.

Living with them:

  • zfs snapshot tank/services/postgres@before-upgrade—the @name suffix is the whole syntax. Instant, safe, take one before anything risky.
  • zfs list -t snapshot to see them; zfs list -o space to see what they're costing (the USEDSNAP column)—the number that explains the mystery in Snapshots and Disappearing Space.
  • Read the past without commitment: every dataset hides a .zfs/snapshot/<name>/ directory—the snapshot's contents, browsable read-only. Copy one file back out of last Tuesday without any rollback drama.
  • At scale you don't take snapshots by hand; a policy tool (sanoid) takes hourlies/dailies/monthlies and prunes them. Snapshots are cheap; keeping every snapshot forever is how pools quietly fill.