You have to create a script or manually rollback each of ..........
the zfs rollback -r zroot@snap
rolls back only the zroot filesystem. The -r
switch does not mean recursive...
Hello HarryE
I believe my problem is much more fundamental as I can't create a snapshot of zroot/usr at all because zroot/usr is not mounted. And ofcourse, if I can't create a snapshot, I also can't do rollback
But I really need a snapshot of zroot/usr because when I get, for example, problems with (an upgrade of) any of my installed user software, I just can do a rollback to return to the situation before the problem originated.
This is one of the most important reasons why I started using ZFS.
So the core of my problem is that I only have one
zpool which is called
"zroot" that is generated by FreeBSD on my
rooted ZFS FreeBSD installation on a single disk.
My disk layout is as follows
gpart show
Code:
[NOPARSE]=> 34 2047999933 vtbd0 GPT (977G)
34 1024 1 freebsd-boot (512K)
1058 67108864 2 freebsd-swap (32G)
67109922 1980890045 3 freebsd-zfs (945G)
[/NOPARSE]
Thus it is not possible to create another pool. Which means I have to create and work with datasets like zroot/usr in order to achieve the above.
But as I will show underneath, it seems to be
impossible to create a snapshot of zroot/usr.
This is what happens:
First I will display all datasets in my system after a clean install:
zfs list
Code:
[NOPARSE]NAME USED AVAIL REFER MOUNTPOINT
zroot 2.65G 927G 148K none
zroot/ROOT 1.49G 927G 144K none
zroot/ROOT/default 1.49G 927G 1.49G /
zroot/tmp 264K 927G 264K /tmp
zroot/usr 813M 927G 144K /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 375M 927G 374M /var
zroot/var/crash 148K 927G 148K /var/crash
zroot/var/log 748K 927G 748K /var/log
zroot/var/mail 216K 927G 216K /var/mail
zroot/var/tmp 200K 927G 200K /var/tmp
[/NOPARSE]
then:
zfs mount
Code:
[NOPARSE]zroot/ROOT/default /
zroot/tmp /tmp
zroot/usr/home /usr/home
zroot/usr/ports /usr/ports
zroot/usr/src /usr/src
zroot/var /var
zroot/var/crash /var/crash
zroot/var/log /var/log
zroot/var/mail /var/mail
zroot/var/tmp /var/tmp
[/NOPARSE]
zroot/usr seems not to be mounted:
zfs get mounted zroot/usr
Code:
[NOPARSE]NAME PROPERTY VALUE SOURCE
zroot/usr mounted no -
[/NOPARSE]
which means:
canmount=off
So now I do:
zfs set canmount=on zroot/usr
see what is in /usr:
ls /usr
Code:
bin games home include lib lib32 libdata libexec local obj ports sbin share src tests
but when zroot/usr is not mounted I can not make a snapshot!
zfs snapshot -r zroot/usr/snap1
Code:
[NOPARSE]usage:
snapshot [-r] [-o property=value] ... <filesystem@snapname|volume@snapname> ...
For the property list, run: zfs set|get
For the delegated permission list, run: zfs allow|unallow
[/NOPARSE]
When I do:
zfs mount -a
zroot/usr will be mounted
zfs get mounted zroot/usr
Code:
[NOPARSE]NAME PROPERTY VALUE SOURCE
zroot/usr mounted yes -
[/NOPARSE]
But now, when I do:
ls /usr
zroot/usr is completely empty and also lost the connections with all files in /usr
I really don't know what is happening that I can't make a new dataset at zroot/usr
Also I don't understand, though zroot/usr is not mounted, everything is normally working in /usr
Is there really nobody who can tell me what is going on here, or what I am doing wrong? Or went something wrong with the installation of FreeBSD??