Hello everybody.
I have FreeBSD 10.0 with rooted ZFS installed on a KVM machine with a single (virtual) disk (vtbd0) . I named my root pool: zroot, which is compressed and copies=2.
Though I can create a snapshot of zroot without any errors, the rollback does not work.
First of all: Is there a good manual for working with the (FreeBSD) root pool somewhere? I can not find anything about that.
What I try to reach is to be able to backup the system files to a snapshot so that, in case an upgrade for some of the system files and/or installed user software goes wrong, I can rollback to the snapshot.
Underneath is the exact code shown of the creation of the snapshot and control files and the rollback I did.
First problem: if I do
But when I do:
So, because that was not working, I made a recursive snapshot.
These are the snapshots that were created
and now there are maps and files in zroot@snap1:
Next I will alter the file snaptest1 to see if rollback is working.
After adding 5 lines to snaptest1:
Next I installed Midnight Commander:
MC is installed which is shown with:
Next I do rollback:
But the new version of snaptest still exists:
And Midnight Commander is still working:
So the rollback did not do anything. What am I doing wrong?
I have FreeBSD 10.0 with rooted ZFS installed on a KVM machine with a single (virtual) disk (vtbd0) . I named my root pool: zroot, which is compressed and copies=2.
Though I can create a snapshot of zroot without any errors, the rollback does not work.
First of all: Is there a good manual for working with the (FreeBSD) root pool somewhere? I can not find anything about that.
What I try to reach is to be able to backup the system files to a snapshot so that, in case an upgrade for some of the system files and/or installed user software goes wrong, I can rollback to the snapshot.
Underneath is the exact code shown of the creation of the snapshot and control files and the rollback I did.
Code:
[CMD]root@server1:/ # zfs list[/CMD]
NAME USED AVAIL REFER MOUNTPOINT
zroot 2.52G 927G 148K none
zroot/ROOT 1.32G 927G 144K none
zroot/ROOT/default 1.32G 927G 1.32G /
zroot/tmp 264K 927G 264K /tmp
zroot/usr 813M 927G 148K /usr
zroot/usr/home 196K 927G 196K /usr/home
zroot/usr/ports 813M 927G 813M /usr/ports
zroot/usr/src 144K 927G 144K /usr/src
zroot/var 418M 927G 417M /var
zroot/var/crash 148K 927G 148K /var/crash
zroot/var/log 840K 927G 840K /var/log
zroot/var/mail 208K 927G 208K /var/mail
zroot/var/tmp 156K 927G 156K /var/tmp
First problem: if I do
zfs snapshot zroot@snap1
, I get no errors and zfs list -t snapshot
shows the snapshot exists:
Code:
root@server1:~ # zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
zroot@snap1 0 - 148K -
ls /.zfs/snapshot
. The /.zfs/snapshot map is empty? Why?So, because that was not working, I made a recursive snapshot.
Code:
root@server1:/ # zfs snapshot -r zroot@snap1
These are the snapshots that were created
Code:
root@server1:/ # zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
zroot@snap1 0 - 148K -
zroot/ROOT@snap1 0 - 144K -
zroot/ROOT/default@snap1 0 - 1.32G -
zroot/tmp@snap1 0 - 264K -
zroot/usr@snap1 0 - 148K -
zroot/usr/home@snap1 0 - 196K -
zroot/usr/ports@snap1 0 - 813M -
zroot/usr/src@snap1 0 - 144K -
zroot/var@snap1 0 - 417M -
zroot/var/crash@snap1 0 - 148K -
zroot/var/log@snap1 0 - 840K -
zroot/var/mail@snap1 0 - 208K -
zroot/var/tmp@snap1 0 - 156K -
and now there are maps and files in zroot@snap1:
Code:
root@server1:/ # ls /.zfs/snapshot /snap1/
.cshrc bin etc media root tmp
.profile boot home mnt sbin usr
.rnd dev lib proc snaptest1 var
COPYRIGHT entropy libexec rescue sys
Next I will alter the file snaptest1 to see if rollback is working.
Code:
root@server1:/ # cat /.zfs/snapshot/snap1/snaptest1
line 1
line 2
line 3
line 4
line 5
After adding 5 lines to snaptest1:
Code:
root@server1:/ # cat snaptest1
line 1
line 2
line 3
line 4
line 5
line 6
line 6
line 8
line 9
line 10
Next I installed Midnight Commander:
Code:
root@server1:/ # pkg install mc
Updating FreeBSD repository catalogue...
............................=>
Message for mc-4.8.13_3:
========================================================
Midnight Commander has been installed.
If you have problems, please reinstall Midnight Commander
MC is installed which is shown with:
Code:
root@server1:/ # ls /usr/local/bin/mc
/usr/local/bin/mc
Next I do rollback:
zfs rollback -r zroot@snap1
But the new version of snaptest still exists:
Code:
root@server1:/ # cat snaptest1
line 1
line 2
line 3
line 4
line 5
line 6
line 6
line 8
line 9
line 10
And Midnight Commander is still working:
Code:
root@server1:/ # ls /usr/local/bin/mc
/usr/local/bin/mc
So the rollback did not do anything. What am I doing wrong?
Last edited: