Tracking down a 20.5 TiB orphaned snapshot

. Homelab, TrueNAS, ZFS

Draft. Replace the bracketed parts with your real details before publishing.

The problem

My secondary TrueNAS box, the replication target for my RAID-Z2 primary, was reporting far less free space than the data on it could explain. [Describe what you saw: the numbers, the alert, how long it had been going on.]

The setup

  • Primary: TrueNAS, RAID-Z2 pool [pool name, disk count and size]
  • Secondary: replication target [hardware, pool layout]
  • Replication: [periodic snapshot task and replication task schedule]

What I checked

The dataset sizes didn't add up to the pool usage, so the space had to be held by snapshots. Listing every snapshot by the space it holds makes the outlier obvious:

zfs list -t snapshot -o name,used,referenced,creation -s used

To see how a dataset's usage splits between live data and snapshots:

zfs list -o name,used,usedbydataset,usedbysnapshots -r [pool]

[What you found: the snapshot name, why it was orphaned, why replication and retention never cleaned it up.]

The fix

After confirming nothing depended on it (no clones, no hold, and the replication chain had a newer common snapshot), I destroyed it.

# check for holds and clones first
zfs holds [pool/dataset@snapshot]
zfs get clones [pool/dataset@snapshot]

# dry run, then the real thing
zfs destroy -nv [pool/dataset@snapshot]
zfs destroy [pool/dataset@snapshot]

[How much space came back, and how long the pool took to reflect it.]

What I'd do differently

  • [An alert on usedbysnapshots crossing a threshold]
  • [A retention policy on the target, not just the source]
  • [Anything else you'd change]

Back to projects