TL;DR
zfs hold keep pool/dataset@snap — zfs destroy fails with dataset is busy. Release with zfs release.
Retention scripts (zfs destroy -r …@auto-…) do not ask. A hold is a named lock on a snapshot: destroy fails until you drop the tag.
Use it on the snapshot you are zfs sending, or on the only known-good rollback after an upgrade.
Take the hold
| |
Recursive on a whole tree (snapshot first, then hold):
| |
The tag (keep) is yours, but unique per snapshot. You can have both keep and offsite on the same @now.
What destroy does
| |
That is the hold, not a mounted filesystem. zfs destroy -d defers deletion until holds are gone; it does not override them.
List
| |
| |
Release, then destroy
| |
If a long send is still running, wait: the hold exists so prune cannot eat your incremental cursor.
Oracle’s description (same mechanism on OpenZFS): Holding ZFS snapshots.
See also: send into an encrypted dataset.