ZFS test rollback doesn't work as expected

by Thoughtcraft   Last Updated November 09, 2018 00:00 AM

I am confused about how ZFS snapshots and rollback are supposed to work. I have a zpool containing a couple zvols (each made from partitions of a mirrorvdev). I make a snapshot like this:

~$ sudo zfs snapshot [email protected]_test

Then I boot a VM located on one of the zvols in the zpool and create a test file

~$ echo "This is a test of the rollback system" > rbtest.txt

Then I shut down the VM and do the rollback. As I understand the concept, the rollback should revert everything in nvme-tank to the state it was when I took the snapshot, before making rbtest.txt.

~$ sudo zfs rollback [email protected]_test

I then reboot the vm, check for rbtest.txt, and there it is, still there! enter image description here

The snapshot is there:

~$ zfs list -t all -r nvme-tank
NAME                  USED  AVAIL  REFER  MOUNTPOINT
nvme-tank             887G  12.1G    24K  /media/nvme-tank
[email protected]      0B      -    24K  -
[email protected]_test     0B      -    24K  -
nvme-tank/ext4-zvol   474G   449G  37.8G  -
nvme-tank/ntfs-zvol   413G  23.9G   401G  -

So, am I misunderstanding what snapshots are supposed to do, using them incorrectly, or is something broken with my zfs?



Related Questions


Updated November 23, 2017 12:00 PM

Updated June 15, 2017 07:00 AM

Updated May 26, 2017 05:00 AM