1

I'm using snapper in openSUSE.

For learning purpose I did % snapper rollback. It was more like a curiosity reason about snapper, but become a blunder.

After % snapper rollback, my % snapper list become empty. It seems like root filesystem mounted to a snapshot volume as shown in command below.

% sudo snapper list
Type   | # | Pre # | Date | User | Cleanup | Description | Userdata
-------+---+-------+------+------+---------+-------------+---------
single | 0 |       |      | root |         | current     |     

% sudo snapper rollback
IO error (.snapshots is not a btrfs subvolume).

% mount | grep '/dev/sda8 on / type'
/dev/sda8 on / type btrfs (rw,relatime,space_cache,subvolid=400,subvol=/@/.snapshots/75/snapshot)

How do I solve the issue without altering /etc/fstab?

How do I undo the rollback to my normal filesystem?

How to use rollback properly?

2
  1. First I need to add this line to /etc/fstab

    % sudo nano /etc/fstab
    UUID=e901452a-b3ea-48d2-acdb-6687fad0be50 /.snapshots btrfs subvol=@/.snapshots   0 0
    

    and mount it, no need to reboot.

    % sudo mount /.snapshots
    
  2. Get current snap

    In my case, previously I have snapshot number 75.

    % sudo btrfs subvolume show /
    
    @/.snapshots/45/snapshot
        Name:           snapshot
        UUID:           29d4436b-72d1-f14d-a9e9-f04b70c0ebe0
        Parent UUID:        efa9f21b-f3b7-3543-9649-3897e083b39d
        Received UUID:      -
        Creation time:      2018-01-03 00:15:01 +0700
        Subvolume ID:       355
        Generation:         5677
        Gen at creation:    3968
        Parent ID:      301
        Top level ID:       301
        Flags:          -
        Snapshot(s):
                    @/.snapshots/50/snapshot
                    @/.snapshots/51/snapshot
    

    and

    % sudo btrfs subvolume get-default /
    
    ID 355 gen 5682 top level 301 path @/.snapshots/45/snapshot 
    
  3. list snapper % sudo snapper list

    Type   | #  | Pre # | Date                            | User | Cleanup  | Description  | Userdata     
    -------+----+-------+---------------------------------+------+----------+--------------+--------------
    single | 0  |       |                                 | root |          | current      |              
    single | 3  |       | Mon 01 Jan 2018 02:45:03 PM WIB | root | timeline | timeline     |              
    single | 7  |       | Mon 01 Jan 2018 04:30:01 PM WIB | root | timeline | timeline     |              
    single | 40 |       | Tue 02 Jan 2018 10:15:01 PM WIB | root | timeline | timeline     |              
    single | 41 |       | Tue 02 Jan 2018 10:52:35 PM WIB | root |          | backup.epsi  |              
    pre    | 42 |       | Tue 02 Jan 2018 11:01:48 PM WIB | root | number   | zypp(zypper) | important=yes
    post   | 43 | 42    | Tue 02 Jan 2018 11:07:23 PM WIB | root | number   |              | important=yes
    single | 44 |       | Tue 02 Jan 2018 11:15:01 PM WIB | root | timeline | timeline     |              
    single | 45 |       | Wed 03 Jan 2018 12:15:01 AM WIB | root | timeline | timeline     |              
    pre    | 46 |       | Wed 03 Jan 2018 12:16:34 AM WIB | root | number   | zypp(zypper) | important=no 
    post   | 47 | 46    | Wed 03 Jan 2018 12:19:38 AM WIB | root | number   |              | important=no 
    pre    | 48 |       | Wed 03 Jan 2018 12:47:47 AM WIB | root | number   | zypp(zypper) | important=no 
    post   | 49 | 48    | Wed 03 Jan 2018 12:48:10 AM WIB | root | number   |              | important=no 
    ...
    

    I decide to go back to 45.

  4. BTRFS ID

    % sudo btrfs subvolume list -a /
    
    ID 257 gen 4804 top level 5 path <FS_TREE>/@
    ID 258 gen 5096 top level 257 path <FS_TREE>/@/opt
    ID 259 gen 4157 top level 257 path <FS_TREE>/@/srv
    ID 260 gen 5672 top level 257 path <FS_TREE>/@/tmp
    ID 261 gen 5538 top level 257 path <FS_TREE>/@/usr/local
    ID 262 gen 5688 top level 257 path <FS_TREE>/@/var/cache
    ID 263 gen 4157 top level 257 path <FS_TREE>/@/var/crash
    ID 264 gen 4157 top level 257 path <FS_TREE>/@/var/lib/libvirt/images
    ID 265 gen 4157 top level 257 path <FS_TREE>/@/var/lib/machines
    ID 266 gen 4157 top level 257 path <FS_TREE>/@/var/lib/mailman
    ID 267 gen 4157 top level 257 path <FS_TREE>/@/var/lib/mariadb
    ID 268 gen 4157 top level 257 path <FS_TREE>/@/var/lib/mysql
    ID 269 gen 4157 top level 257 path <FS_TREE>/@/var/lib/named
    ID 270 gen 4157 top level 257 path <FS_TREE>/@/var/lib/pgsql
    ID 271 gen 5688 top level 257 path <FS_TREE>/@/var/log
    ID 272 gen 4157 top level 257 path <FS_TREE>/@/var/opt
    ID 273 gen 5688 top level 257 path <FS_TREE>/@/var/spool
    ID 274 gen 5672 top level 257 path <FS_TREE>/@/var/tmp
    ID 301 gen 5674 top level 257 path <FS_TREE>/@/.snapshots
    ID 304 gen 3008 top level 301 path <FS_TREE>/@/.snapshots/3/snapshot
    ID 311 gen 3160 top level 301 path <FS_TREE>/@/.snapshots/7/snapshot
    ID 345 gen 3737 top level 301 path <FS_TREE>/@/.snapshots/40/snapshot
    ID 350 gen 3849 top level 301 path <FS_TREE>/@/.snapshots/41/snapshot
    ID 351 gen 3862 top level 301 path <FS_TREE>/@/.snapshots/42/snapshot
    ID 353 gen 3874 top level 301 path <FS_TREE>/@/.snapshots/43/snapshot
    ID 354 gen 3887 top level 301 path <FS_TREE>/@/.snapshots/44/snapshot
    ID 355 gen 5688 top level 301 path <FS_TREE>/@/.snapshots/45/snapshot
    ID 356 gen 3972 top level 301 path <FS_TREE>/@/.snapshots/46/snapshot
    ID 357 gen 3980 top level 301 path <FS_TREE>/@/.snapshots/47/snapshot
    ID 358 gen 4021 top level 301 path <FS_TREE>/@/.snapshots/48/snapshot
    ID 359 gen 4022 top level 301 path <FS_TREE>/@/.snapshots/49/snapshot
    

    I find the ID of 45, it is 355.

  5. Change default

    To make it writable

    % sudo btrfs property set -ts /.snapshots/45/snapshot ro false
    

    And make it default

    % sudo btrfs subvolume set-default 355 /
    

    Then reboot

  6. Remove the annoying rollback snapshot.

    % sudo snapper delete 75
    
    % sudo snapper delete 76
    
    % sudo snapper delete 77
    
    % sudo snapper list
    

That's all

Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.