# zroot doesn't rollback



## bsus (May 10, 2012)

Hi,

I have created a recursiv*e* snapshot of all zfs datasets:

```
# zfs list -t snapshot
NAME                                     USED  AVAIL  REFER  MOUNTPOINT
zroot@stock                              504K      -   344M  -
zroot@stockUpdated                       545K      -   346M  -
zroot@configured                          50K      -   635M  -
zroot/swap@stock                            0      -    16K  -
zroot/swap@stockUpdated                     0      -    16K  -
zroot/swap@configured                       0      -    16K  -
zroot/tmp@stock                           20K      -    35K  -
zroot/tmp@stockUpdated                    20K      -    35K  -
zroot/tmp@configured                      25K      -    36K  -
zroot/usr@stock                         8.76M      -   248M  -
zroot/usr@stockUpdated                   228K      -   248M  -
zroot/usr@configured                     579K      -  2.54G  -
zroot/usr/home@stock                        0      -    31K  -
zroot/usr/home@stockUpdated                 0      -    31K  -
zroot/usr/home@configured                 20K      -    43K  -
zroot/usr/jails@stock                       0      -    31K  -
zroot/usr/jails@stockUpdated                0      -    31K  -
zroot/usr/jails@configured                  0      -    31K  -
zroot/usr/local@stock                       0      -    31K  -
zroot/usr/local@stockUpdated                0      -    31K  -
zroot/usr/local@configured                  0      -    31K  -
zroot/usr/ports@stock                    306M      -   310M  -
zroot/usr/ports@stockUpdated               1K      -   246M  -
zroot/usr/ports@configured                 1K      -   246M  -
zroot/usr/ports/distfiles@stock             0      -    31K  -
zroot/usr/ports/distfiles@stockUpdated      0      -    31K  -
zroot/usr/ports/distfiles@configured        0      -    31K  -
zroot/usr/ports/packages@stock              0      -    31K  -
zroot/usr/ports/packages@stockUpdated       0      -    31K  -
zroot/usr/ports/packages@configured         0      -    31K  -
zroot/usr/src@stock                      154M      -   349M  -
zroot/usr/src@stockUpdated              9.43M      -   350M  -
zroot/usr/src@configured                  83K      -   350M  -
zroot/var@stock                           21K      -   127K  -
zroot/var@stockUpdated                    21K      -   127K  -
zroot/var@configured                    37.5K      -   131K  -
zroot/var/crash@stock                       0      -  31.5K  -
zroot/var/crash@stockUpdated                0      -  31.5K  -
zroot/var/crash@configured                  0      -  31.5K  -
zroot/var/db@stock                        71K      -    78K  -
zroot/var/db@stockUpdated                 70K      -   104M  -
zroot/var/db@configured                   80K      -   104M  -
zroot/var/db/pkg@stock                      0      -    31K  -
zroot/var/db/pkg@stockUpdated               0      -    31K  -
zroot/var/db/pkg@configured                 0      -    31K  -
zroot/var/empty@stock                       0      -    31K  -
zroot/var/empty@stockUpdated                0      -    31K  -
zroot/var/empty@configured                  0      -    31K  -
zroot/var/log@stock                       29K      -    44K  -
zroot/var/log@stockUpdated              29.5K      -  44.5K  -
zroot/var/log@configured                36.5K      -  51.5K  -
zroot/var/mail@stock                        0      -    31K  -
zroot/var/mail@stockUpdated                 0      -    31K  -
zroot/var/mail@configured                   0      -    31K  -
zroot/var/pacman@stock                      0      -    32K  -
zroot/var/pacman@stockUpdated               0      -    32K  -
zroot/var/pacman@configured                 0      -    32K  -
zroot/var/pacman/pkg@stock                  0      -    31K  -
zroot/var/pacman/pkg@stockUpdated           0      -    31K  -
zroot/var/pacman/pkg@configured             0      -    31K  -
zroot/var/run@stock                     21.5K      -    61K  -
zroot/var/run@stockUpdated              21.5K      -    61K  -
zroot/var/run@configured                  37K      -    51K  -
zroot/var/tmp@stock                       20K      -    32K  -
zroot/var/tmp@stockUpdated                20K      -    32K  -
zroot/var/tmp@configured                  21K      -    32K  -
```

*T*hese are the current zfs datasets:

```
# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
zroot                      21.6G   565G   635M  /
zroot/swap                 8.25G   573G  15.8M  -
zroot/tmp                   112K   565G    43K  /tmp
zroot/usr                  3.69G   565G  2.54G  /usr
zroot/usr/home               82K   565G    43K  /usr/home
zroot/usr/jails              49K   565G    31K  /usr/jails
zroot/usr/local            22.4M   565G  22.4M  /usr/local
zroot/usr/ports             628M   565G   246M  /usr/ports
zroot/usr/ports/distfiles  24.2M   565G  24.1M  /usr/ports/distfiles
zroot/usr/ports/packages     51K   565G    31K  /usr/ports/packages
zroot/usr/src               514M   565G   350M  /usr/src
zroot/var                  9.05G   565G   131K  /var
zroot/var/crash            31.5K   565G  31.5K  /var/crash
zroot/var/db                122M   565G   104M  /var/db
zroot/var/db/pkg            126K   565G   106K  /var/db/pkg
zroot/var/empty              31K   565G    31K  /var/empty
zroot/var/log               170K   565G    75K  /var/log
zroot/var/mail               50K   565G    31K  /var/mail
zroot/var/pacman           8.93G   565G    32K  /var/pacman
zroot/var/pacman/pkg       8.93G   565G  8.93G  /var/pacman/pkg
zroot/var/run               166K   565G  60.5K  /var/run
zroot/var/tmp                94K   565G    32K  /var/tmp
```

When I now use `# zfs rollback -rf zroot@configured` I don't get any error messages but files I added after the snapshot configured still exist.

Did I missunderst*an*d the idea of rollbacks or is something going wrong?

Best Regards,
bsus


----------



## usdmatt (May 10, 2012)

How were you logged in when you did the rollback? I would be very wary of trying to rollback the root filesystem while the system is running off it. Although, you'd hope for some sort of  error message if they didn't want you to be able to do it.

Also I assume you're aware that while -r takes recursive snapshots of all datasets when using the snapshot command, it unfortunately has a different meaning for the rollback command. Anything under the /usr and /var filesystems will still be as it was. There is no recursive rollback option according to the man page.



> To completely roll back a recursive snapshot, you must rollback the  individual  child  snap-shots.


----------



## bsus (May 10, 2012)

Ok, I think this will be it. Was just wondering why `# zfs rollback` provides -rR as options if they aren't for the recursiv*e*.

Are there some additional hints how I should do the rollback? From child to parent? Over livecd? No /tmp rollbacks?


----------



## bsus (May 10, 2012)

Hi,

I rolled back all children to the parents (also the /tmp's) and rebooted.

Worked without issues


----------

