ZFS-ROLLBACK(8)

πŸ“¦
version 2.4.4 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

zfs-rollback β€” roll ZFS dataset back to snapshot πŸ’«


🌸 SYNOPSIS 🌸

zfs rollback [-Rfr] snapshot

πŸ’– DESCRIPTION πŸ’–

okay bestie, listen. when you roll a dataset back, all the data that has changed since the snapshot gets yeeted into the void, and the dataset reverts to exactly the state it was in at the time of the snapshot. time travel but make it storage πŸ¦‹

by default, the command is kinda stubborn β€” it refuses to roll back to a snapshot that isn't the most recent one. wanna go further back? then all intermediate snapshots and bookmarks must be destroyed by specifying the -r option. no skipping ahead in the group chat, you have to read every message 😭

⚠️ important, and the way this trips people up: the -rR options do not recursively destroy the child snapshots of a recursive snapshot. Only direct snapshots of the specified filesystem get destroyed by either of these options. so if you wanna completely roll back a recursive snapshot, you have to roll back the individual child snapshots yourself. one by one. by hand. iconic behaviour honestly πŸ’…

the flags, bestie:

  • -R β€” destroys any more recent snapshots and bookmarks, plus any clones of those snapshots. it's giving "clean slate" πŸ”₯
  • -f β€” used with the -R option to force an unmount of any clone file systems that are about to be destroyed. it's the "no, actually, we're doing this" button πŸ’€
  • -r β€” destroys any snapshots and bookmarks more recent than the one you specified. the classic πŸŽ€

🌈 EXAMPLES 🌈

πŸ“ Example 1: Rolling Back a ZFS File System

the following command reverts the contents of pool/home/anne to the snapshot named yesterday, deleting all intermediate snapshots:

# zfs rollback -r pool/home/anne@yesterday

look at her go. main character energy fr fr πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ


and that's the whole vibe!! this lil page lives in the OpenZFS System Manager's Manual, dated April 28, 2025, and its man page name is ZFS-ROLLBACK(8). go forth and roll back responsibly, bestie πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from