Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: snapper rollback works only with --ambit classic option

  1. #1
    Join Date
    Aug 2020
    Location
    Germany
    Posts
    43

    Default snapper rollback works only with --ambit classic option

    Hi,
    today's update of qemu gave me a buffer overflow error. So I decided to rollback to a previous snapshot. I booted into the snapshot and tried rollback but got
    Code:
    Cannot detect ambit since default subvolume is unknown.
    This can happen if the system was not set up for rollback.
    The ambit can be specified manually using the --ambit option.
    After some searching I found this

    In rare cases rolling back with fail as snapper is not able to find the default sub-volume (this may happen if snapper's configuration and the state of your system have diverged in a problematic way, in most cases caused by user error). To perform a rollback nonetheless you can use the following command:

    $ sudo snapper --ambit classic rollback <id>
    here.

    That worked in my case. However, I would appreciate if anyone would have an idea how to converge the snapper configuration and the state of the system again?

    Thanks

  2. #2
    Join Date
    Sep 2012
    Posts
    7,673

    Default Re: snapper rollback works only with --ambit classic option

    Quote Originally Posted by macom View Post
    how to converge the snapper configuration and the state of the system again?
    Show output of
    Code:
    blkid
    cat /etc/fstab
    snapper list
    btrfs subvolume get-default /
    btrfs subvolume list /

  3. #3
    Join Date
    Aug 2020
    Location
    Germany
    Posts
    43

    Default Re: snapper rollback works only with --ambit classic option

    Here you go:

    Code:
    opensuse:~ # blkid
    /dev/sdb4: BLOCK_SIZE="512" UUID="EEA89A36A899FD71" TYPE="ntfs" PARTUUID="f2702e50-d20a-4f70-ba9a-9ecb526e4ae7"
    /dev/sdb2: PARTLABEL="Microsoft reserved partition" PARTUUID="7102c9c6-11b3-452b-8eb2-6fe3c424b06f"
    /dev/sdb9: LABEL="virtualmachines" UUID="96f64567-eb2f-4232-9342-44918088939c" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="virtualmachines" PARTUUID="d0ce733b-af77-4acc-bc5f-76e290b0d0ee"
    /dev/sdb7: LABEL="openSUS_home" UUID="746987f5-fefd-4a00-ab7f-4b4a08a60a47" UUID_SUB="c016a0d3-be05-47cf-9760-b7412d62f558" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="home for openSUSE" PARTUUID="5bda1a71-8684-4dbe-8f16-7223d5fd3412"
    /dev/sdb5: UUID="e6906942-69f9-4356-8874-9ec6eac08257" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Bodhi" PARTUUID="28eb2203-098f-4ce6-ae22-ccaf17fa146b"
    /dev/sdb3: LABEL="WindowsOS" BLOCK_SIZE="512" UUID="583277BA32779C26" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d752c970-e321-4aa6-9f9b-280e542a34da"
    /dev/sdb1: UUID="666F-8B44" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="45fc3ec7-8d7f-4354-836b-c1d739188ecf"
    /dev/sdb8: SEC_TYPE="msdos" LABEL_FATBOOT="OPENSUS_EFI" LABEL="OPENSUS_EFI" UUID="CCB1-C656" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="efi_openSUSE" PARTUUID="8650801e-35fe-4685-a1be-0b968eb68be1"
    /dev/sdb6: LABEL="openSUSE_OS" UUID="c9337238-4564-485f-9cb7-47a9a7fa5158" UUID_SUB="1c8ad0aa-40b7-48de-b25b-427622dda5dc" BLOCK_SIZE="4096" TYPE="btrfs" PARTLABEL="openSUSE" PARTUUID="ea983ba3-e8bc-4993-b787-3e68a3553d00"
    /dev/sda2: LABEL="backup_of_os" UUID="bf385529-f2cc-43fd-a076-72e14958d2c7" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="18753cc3-02"
    /dev/sda1: LABEL="Data" BLOCK_SIZE="512" UUID="22FE371FFE36EAA5" TYPE="ntfs" PARTUUID="18753cc3-01"
    opensuse:~ # cat /etc/fstab
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /                       btrfs  defaults                      0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /var                    btrfs  subvol=/@/var                 0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /usr/local              btrfs  subvol=/@/usr/local           0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /srv                    btrfs  subvol=/@/srv                 0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /root                   btrfs  subvol=/@/root                0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /opt                    btrfs  subvol=/@/opt                 0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /.snapshots             btrfs  subvol=/@/.snapshots          0  0
    UUID=746987f5-fefd-4a00-ab7f-4b4a08a60a47  /home                   btrfs  defaults                      0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
    UUID=c9337238-4564-485f-9cb7-47a9a7fa5158  /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
    UUID=CCB1-C656                             /boot/efi               vfat   utf8                          0  2
    opensuse:~ # snapper list
       # | Type   | Pre # | Date                     | User | Cleanup | Description           | Userdata     
    -----+--------+-------+--------------------------+------+---------+-----------------------+--------------
      0  | single |       |                          | root |         | current               |              
    877  | pre    |       | Thu May 19 18:04:19 2022 | root | number  | zypp(zypper)          | important=yes
    878  | post   |   877 | Thu May 19 18:05:09 2022 | root | number  |                       | important=yes
    879  | pre    |       | Sat May 21 10:33:45 2022 | root | number  | zypp(zypper)          | important=yes
    880  | post   |   879 | Sat May 21 10:36:32 2022 | root | number  |                       | important=yes
    885  | pre    |       | Mon May 23 18:51:50 2022 | root | number  | zypp(zypper)          | important=yes
    886  | post   |   885 | Mon May 23 18:54:03 2022 | root | number  |                       | important=yes
    887  | pre    |       | Tue May 24 18:00:31 2022 | root | number  | zypp(zypper)          | important=yes
    888  | post   |   887 | Tue May 24 18:01:39 2022 | root | number  |                       | important=yes
    893  | pre    |       | Thu May 26 04:50:54 2022 | root | number  | zypp(zypper)          | important=no 
    894  | post   |   893 | Thu May 26 04:51:59 2022 | root | number  |                       | important=no 
    895  | pre    |       | Thu May 26 12:17:27 2022 | root | number  | zypp(ruby.ruby3.1)    | important=no 
    896  | post   |   895 | Thu May 26 12:17:31 2022 | root | number  |                       | important=no 
    897  | pre    |       | Thu May 26 12:24:23 2022 | root | number  | zypp(zypper)          | important=no 
    898  | post   |   897 | Thu May 26 12:24:28 2022 | root | number  |                       | important=no 
    899  | pre    |       | Thu May 26 12:24:40 2022 | root | number  | zypp(zypper)          | important=no 
    900  | post   |   899 | Thu May 26 12:24:41 2022 | root | number  |                       | important=no 
    901  | pre    |       | Thu May 26 12:44:48 2022 | root | number  | zypp(zypper)          | important=no 
    902  | post   |   901 | Thu May 26 12:45:19 2022 | root | number  |                       | important=no 
    903  | single |       | Thu May 26 12:58:08 2022 | root | number  | rollback backup       | important=yes
    904* | single |       | Thu May 26 12:58:08 2022 | root |         | writable copy of #891 |              
    opensuse:~ # btrfs subvolume get-default /
    ID 1244 gen 420197 top level 271 path @/.snapshots/904/snapshot
    opensuse:~ # btrfs subvolume list /
    ID 256 gen 419991 top level 5 path @
    ID 257 gen 420198 top level 256 path @/var
    ID 258 gen 420061 top level 256 path @/usr/local
    ID 259 gen 419218 top level 256 path @/srv
    ID 260 gen 420198 top level 256 path @/root
    ID 261 gen 419239 top level 256 path @/opt
    ID 262 gen 419651 top level 256 path @/boot/grub2/x86_64-efi
    ID 263 gen 419218 top level 256 path @/boot/grub2/i386-pc
    ID 271 gen 420069 top level 256 path @/.snapshots
    ID 323 gen 323085 top level 257 path @/var/lib/machines
    ID 1217 gen 416967 top level 271 path @/.snapshots/877/snapshot
    ID 1218 gen 416971 top level 271 path @/.snapshots/878/snapshot
    ID 1219 gen 417437 top level 271 path @/.snapshots/879/snapshot
    ID 1220 gen 417583 top level 271 path @/.snapshots/880/snapshot
    ID 1225 gen 418811 top level 271 path @/.snapshots/885/snapshot
    ID 1226 gen 418890 top level 271 path @/.snapshots/886/snapshot
    ID 1227 gen 418975 top level 271 path @/.snapshots/887/snapshot
    ID 1228 gen 418979 top level 271 path @/.snapshots/888/snapshot
    ID 1233 gen 419548 top level 271 path @/.snapshots/893/snapshot
    ID 1234 gen 419644 top level 271 path @/.snapshots/894/snapshot
    ID 1235 gen 419922 top level 271 path @/.snapshots/895/snapshot
    ID 1236 gen 419927 top level 271 path @/.snapshots/896/snapshot
    ID 1237 gen 419939 top level 271 path @/.snapshots/897/snapshot
    ID 1238 gen 419951 top level 271 path @/.snapshots/898/snapshot
    ID 1239 gen 419952 top level 271 path @/.snapshots/899/snapshot
    ID 1240 gen 420010 top level 271 path @/.snapshots/900/snapshot
    ID 1241 gen 419977 top level 271 path @/.snapshots/901/snapshot
    ID 1242 gen 419989 top level 271 path @/.snapshots/902/snapshot
    ID 1243 gen 420010 top level 271 path @/.snapshots/903/snapshot
    ID 1244 gen 420197 top level 271 path @/.snapshots/904/snapshot
    opensuse:~ #

  4. #4
    Join Date
    Sep 2012
    Posts
    7,673

    Default Re: snapper rollback works only with --ambit classic option

    Quote Originally Posted by macom View Post
    Code:
    904* | single |       | Thu May 26 12:58:08 2022 | root |         | writable copy of #891 |              
    opensuse:~ # btrfs subvolume get-default /
    ID 1244 gen 420197 top level 271 path @/.snapshots/904/snapshot
    The error means that default subvolume is not one of snapper snapshots. As expected, this is fixed now, nothing needs to be done in this state.

    And we do not have the previous system state. Comment on snapshot 904 says "writable copy of #891" but this snapshot does not exist (at least, now).

  5. #5
    Join Date
    Aug 2020
    Location
    Germany
    Posts
    43

    Default Re: snapper rollback works only with --ambit classic option

    Quote Originally Posted by arvidjaar View Post
    As expected, this is fixed now, nothing needs to be done in this state.
    Do you mean, the next time I have to do a rollback, it should be possible to do without the "classic" option?

  6. #6
    Join Date
    Sep 2012
    Posts
    7,673

    Default Re: snapper rollback works only with --ambit classic option

    Quote Originally Posted by macom View Post
    Do you mean, the next time I have to do a rollback, it should be possible to do without the "classic" option?
    Yes, I expect it.

  7. #7
    Join Date
    Aug 2020
    Location
    Germany
    Posts
    43

    Thumbs up Re: snapper rollback works only with --ambit classic option

    Ok, sounds good. Thanks for taking your time having a look at it!!!

  8. #8
    Join Date
    Aug 2020
    Location
    Germany
    Posts
    43

    Default Re: snapper rollback works only with --ambit classic option

    Now it is messed up:
    Code:
    opensuse:~ # snapper list
       # | Type   | Pre # | Date                     | User | Cleanup | Description             | Userdata     
    -----+--------+-------+--------------------------+------+---------+-------------------------+--------------
      0  | single |       |                          | root |         | current                 |              
    918  | post   |   917 | Sat May 28 11:23:18 2022 | root |         |                         | important=no 
    919  | single |       | Sat May 28 20:46:10 2022 | root | number  | rollback backup of #904 | important=yes
    920  | single |       | Sat May 28 20:46:10 2022 | root | number  | writable copy of #918   |              
    921  | single |       | Sat May 28 20:47:17 2022 | root | number  | rollback backup of #920 | important=yes
    922  | single |       | Sat May 28 20:47:17 2022 | root |         | writable copy of #918   |              
    923* | single |       | Sat May 28 21:02:07 2022 | root |         |                         |              
    924  | single |       | Sat May 28 21:15:21 2022 | root |         |                         |              
    opensuse:~ #
    When I try to edit /etc/fstab as root, I get that the file is "unwritable". Same for /etc/autofs.conf

  9. #9
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    3,837

    Default Re: snapper rollback works only with --ambit classic option

    Quote Originally Posted by macom View Post
    Now it is messed up:
    Code:
    opensuse:~ # snapper list
       # | Type   | Pre # | Date                     | User | Cleanup | Description             | Userdata     
    -----+--------+-------+--------------------------+------+---------+-------------------------+--------------
      0  | single |       |                          | root |         | current                 |              
    918  | post   |   917 | Sat May 28 11:23:18 2022 | root |         |                         | important=no 
    919  | single |       | Sat May 28 20:46:10 2022 | root | number  | rollback backup of #904 | important=yes
    920  | single |       | Sat May 28 20:46:10 2022 | root | number  | writable copy of #918   |              
    921  | single |       | Sat May 28 20:47:17 2022 | root | number  | rollback backup of #920 | important=yes
    922  | single |       | Sat May 28 20:47:17 2022 | root |         | writable copy of #918   |              
    923* | single |       | Sat May 28 21:02:07 2022 | root |         |                         |              
    924  | single |       | Sat May 28 21:15:21 2022 | root |         |                         |              
    opensuse:~ #
    When I try to edit /etc/fstab as root, I get that the file is "unwritable". Same for /etc/autofs.conf
    Nothing is messed up. You are lost I presume. Get default subvolume and show its properties:
    Code:
    erlangen:~ # btrfs subvolume get-default /                 
    ID 266 gen 249032 top level 265 path @/.snapshots/1/snapshot 
    erlangen:~ # btrfs subvolume show /.snapshots/1/snapshot   
    @/.snapshots/1/snapshot 
            Name:                   snapshot 
            UUID:                   579f5de4-d385-d64b-a3b6-a6a09aca3fc6 
            Parent UUID:            - 
            Received UUID:          - 
            Creation time:          2021-11-24 21:33:32 +0100 
            Subvolume ID:           266 
            Generation:             249032 
            Gen at creation:        30 
            Parent ID:              265 
            Top level ID:           265 
            Flags:                  - 
            Send transid:           0 
            Send time:              2021-11-24 21:33:32 +0100 
            Receive transid:        0 
            Receive time:           - 
            Snapshot(s): 
                                    @/.snapshots/850/snapshot 
                                    @/.snapshots/851/snapshot 
                                    @/.snapshots/856/snapshot 
                                    @/.snapshots/857/snapshot 
                                    @/.snapshots/858/snapshot 
                                    @/.snapshots/859/snapshot 
                                    @/.snapshots/860/snapshot 
                                    @/.snapshots/861/snapshot 
                                    @/.snapshots/862/snapshot 
                                    @/.snapshots/863/snapshot 
                                    @/.snapshots/864/snapshot 
                                    @/.snapshots/865/snapshot 
                                    @/.snapshots/866/snapshot 
                                    @/.snapshots/867/snapshot 
                                    @/.snapshots/868/snapshot 
                                    @/.snapshots/869/snapshot 
                                    @/.snapshots/870/snapshot 
                                    @/.snapshots/871/snapshot 
                                    @/.snapshots/872/snapshot 
                                    @/.snapshots/873/snapshot 
                                    @/.snapshots/874/snapshot 
                                    @/.snapshots/875/snapshot 
                                    @/.snapshots/876/snapshot 
                                    @/.snapshots/877/snapshot 
    erlangen:~ #
    i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X (2022) openSUSE Tumbleweed, KDE Plasma

  10. #10
    Join Date
    Aug 2020
    Location
    Germany
    Posts
    43

    Default Re: snapper rollback works only with --ambit classic option

    Quote Originally Posted by karlmistelberger View Post
    Nothing is messed up. You are lost I presume.
    Hopefully and yes

    Code:
    opensuse:~ # btrfs subvolume get-default /
    ID 1263 gen 422264 top level 271 path @/.snapshots/923/snapshot
    opensuse:~ # btrfs subvolume show /.snapshots/923/snapshot
    @/.snapshots/923/snapshot
        Name:             snapshot
        UUID:             bb4a6e62-3b6c-7e46-b977-1b15b4abead7
        Parent UUID:         1b6bad21-7c0d-694f-9f07-28c54a38b6f5
        Received UUID:         -
        Creation time:         2022-05-28 21:02:07 +0200
        Subvolume ID:         1263
        Generation:         422264
        Gen at creation:     422240
        Parent ID:         271
        Top level ID:         271
        Flags:             readonly
        Send transid:         0
        Send time:         2022-05-28 21:02:07 +0200
        Receive transid:     0
        Receive time:         -
        Snapshot(s):
                    @/.snapshots/924/snapshot
    opensuse:~ #
    Thanks for your help!!

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •