Using ZFS Snapshots on rpool/ROOT/pve-1?

Just wanted to confirm: It works even without reboot to rollback '/' while running proxmox (no live distro needed):

zfs snapshot -r rpool@rightNow
touch ~/NEW!
zfs rollback -r rpool/ROOT/pve-1@rightNow

Worked instantly! The file ~/NEW! is gone. I've tested it with pre/post apt install of stuff.
Awesome! Great thanks to all developers who make this possible! :cake:
 
  • Like
Reactions: Johannes S
Just wanted to confirm: It works even without reboot to rollback '/' while running proxmox (no live distro needed):

zfs snapshot -r rpool@rightNow
touch ~/NEW!
zfs rollback -r rpool/ROOT/pve-1@rightNow

Worked instantly! The file ~/NEW! is gone. I've tested it with pre/post apt install of stuff.
Awesome! Great thanks to all developers who make this possible! :cake:
BEWARE: Rolling back the root filesystem on a running system is serious footgun territory. After the rollback, running userspace is in an undefined/inconsistent state: open file descriptors, mapped binaries/libraries, daemons, logs, package state, etc. may no longer correspond to what is now on disk.

If you absolutely must roll back root from the running system, I would shut down/migrate all VMs/CTs first, perform the rollback, then immediately trigger a SysRq reboot, and treat it like recovering from a reset/power loss into the rolled-back snapshot.


I would not try to do a normal "clean" reboot after live-rolling back of root, because that asks a potentially half-cooked userspace to run shutdown logic, stop services, write state, and unmount filesystems from a filesystem view that was just rewound underneath it.