Or maybe I'm misunderstanding what's supposed to be happening. Here's what I've done for this test:
1. Look at my datasets
2. Create a file to modify:
3. I snapshot data/usr:
4. modify my file:
5. Rollback
6. check my modified file:
So what did I do wrong here? My belief was that when I ran the rollback command, any changes should have been eliminated, meaning the rollback line in /usr/test.txt should not be there anymore.
Am I misunderstanding what zfs snapshotting does? Or did I do something wrong in this process?
1. Look at my datasets
Code:
root@nightmaremoon:~ # zfs list
NAME USED AVAIL REFER MOUNTPOINT
backup2 1.69T 3.57T 1.69T /mnt/backup2
data 5.82T 1.21T 117G /data
data/ROOT 13.6G 1.21T 96K none
data/ROOT/default 13.6G 1.21T 13.6G /
data/shared 14.3G 1.21T 14.3G /data/shared
data/tmp 112K 1.21T 112K /tmp
data/usr 2.39G 1.21T 96K /usr
data/usr/home 1.21G 1.21T 1.21G /usr/home
data/usr/ports 1.18G 1.21T 1.18G /usr/ports
data/usr/src 96K 1.21T 96K /usr/src
data/var 1.35M 1.21T 96K /var
data/var/audit 96K 1.21T 96K /var/audit
data/var/crash 96K 1.21T 96K /var/crash
data/var/log 492K 1.21T 492K /var/log
data/var/mail 480K 1.21T 480K /var/mail
data/var/tmp 120K 1.21T 120K /var/tmp
2. Create a file to modify:
Code:
root@nightmaremoon:~ # echo hello > /usr/test.txt
root@nightmaremoon:~ # cat /usr/test.txt
hello
3. I snapshot data/usr:
Code:
root@nightmaremoon:~transmission # zfs snapshot data/usr@29MAY17
root@nightmaremoon:~transmission # zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
data/usr@29MAY17 0 - 96K -
4. modify my file:
Code:
root@nightmaremoon:~ # echo rollback >> /usr/test.txt
root@nightmaremoon:~ # cat /usr/test.txt
hello
rollback
5. Rollback
Code:
root@nightmaremoon:~ # zfs rollback data/usr@29MAY17
6. check my modified file:
Code:
root@nightmaremoon:~ # cat /usr/test.txt
hello
rollback
So what did I do wrong here? My belief was that when I ran the rollback command, any changes should have been eliminated, meaning the rollback line in /usr/test.txt should not be there anymore.
Am I misunderstanding what zfs snapshotting does? Or did I do something wrong in this process?