macom
May 26, 2022, 3:36pm
#1
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
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
Show output of
blkid
cat /etc/fstab
snapper list
btrfs subvolume get-default /
btrfs subvolume list /
macom
May 26, 2022, 4:27pm
#3
Here you go:
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:~ #
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).
macom
May 26, 2022, 4:53pm
#5
Do you mean, the next time I have to do a rollback, it should be possible to do without the “classic” option?
macom
May 26, 2022, 4:57pm
#7
Ok, sounds good. Thanks for taking your time having a look at it!!!
macom
May 28, 2022, 9:26pm
#8
Now it is messed up:
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
macom:
Now it is messed up:
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:
**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:~ #**
macom
May 29, 2022, 8:35am
#10
Hopefully and yes
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!!
macom:
Now it is messed up
You did not describe what you did, what response do you expect?
opensuse:~ # snapper list
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
You current root is snapper snapshot 923 which is read-only. Snapshot 922 is read-write and was target of rollback. Without knowing what you did it is impossible to guess what may have happened.
Set default subvolume to snapshot 922:
btrfs subvolume set-default /.snapshots/922/snapshot /
and reboot.
Default snapshot is flagged readonly. You may create a writeable one by running:
mkdir /.snapshots/925
[FONT=monospace]btrfs subvolume snapshot /.snapshots/924/snapshot /.snapshots/925/snapshot[/FONT]
[FONT=monospace]
[/FONT]Make the new snapshot the default one and reboot.[FONT=monospace]
[/FONT]
macom
May 29, 2022, 9:10am
#13
Ok, now I am back to a writeable snapshot
EDIT: after
btrfs subvolume set-default /.snapshots/922/snapshot
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:~ #
Anything else to do? Or is this a state the system is supposed to be?
macom:
Ok, now I am back to a writeable snapshot
EDIT: after
btrfs subvolume set-default /.snapshots/922/snapshot
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:~ #
Anything else to do? Or is this a state the system is supposed to be?
Check your list of subvolumes for garbage and delete if any:
**erlangen:~ #** btrfs subvolume list -t /
ID gen top level path
-- --- --------- ----
256 217660 5 @
257 249191 256 @/var
258 248864 256 @/usr/local
259 245921 256 @/srv
260 249131 256 @/root
261 247057 256 @/opt
262 249193 256 @/home
263 247712 256 @/boot/grub2/x86_64-efi
264 247712 256 @/boot/grub2/i386-pc
265 249160 256 @/.snapshots
266 249190 265 @/.snapshots/1/snapshot
1422 240336 265 @/.snapshots/850/snapshot
1423 240336 265 @/.snapshots/851/snapshot
1428 240336 265 @/.snapshots/856/snapshot
1429 240336 265 @/.snapshots/857/snapshot
1430 240336 265 @/.snapshots/858/snapshot
1431 240336 265 @/.snapshots/859/snapshot
1432 240336 265 @/.snapshots/860/snapshot
1433 240336 265 @/.snapshots/861/snapshot
1434 240336 265 @/.snapshots/862/snapshot
1435 240336 265 @/.snapshots/863/snapshot
1436 240336 265 @/.snapshots/864/snapshot
1437 240336 265 @/.snapshots/865/snapshot
1438 240717 265 @/.snapshots/866/snapshot
1439 240789 265 @/.snapshots/867/snapshot
1440 241015 265 @/.snapshots/868/snapshot
1441 241017 265 @/.snapshots/869/snapshot
1442 242352 265 @/.snapshots/870/snapshot
1443 242409 265 @/.snapshots/871/snapshot
1444 243293 265 @/.snapshots/872/snapshot
1445 243330 265 @/.snapshots/873/snapshot
1446 244678 265 @/.snapshots/874/snapshot
1447 244751 265 @/.snapshots/875/snapshot
1448 246094 265 @/.snapshots/876/snapshot
1449 249148 265 @/.snapshots/877/snapshot
**erlangen:~ #**
Check whether snapper now works by installing a random package:
**erlangen:~ #** zypper install perl-Mozilla-LDAP
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
perl-Mozilla-LDAP
1 new package to install.
Overall download size: 142.1 KiB. Already cached: 0 B. After the operation, additional 449.5 KiB will be used.
**Continue? [y/n/v/...? shows all options] (y): **
Retrieving package perl-Mozilla-LDAP-1.5.3-5.43.x86_64 (1/1), 142.1 KiB (449.5 KiB unpacked)
Retrieving: perl-Mozilla-LDAP-1.5.3-5.43.x86_64.rpm ........................................................................................................................[done]
Checking for file conflicts: ...............................................................................................................................................[done]
(1/1) Installing: perl-Mozilla-LDAP-1.5.3-5.43.x86_64 ......................................................................................................................[done]
**erlangen:~ #**
Snapper should kick in properly:
**erlangen:~ #** snapper list
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
-----+--------+-------+--------------------------+------+---------+-----------------------+--------------
0 | single | | | root | | current |
1* | single | | Wed Nov 24 21:33:32 2021 | root | | first root filesystem |
850 | pre | | Mon May 16 21:21:30 2022 | root | number | zypp(zypper) | important=yes
851 | post | 850 | Mon May 16 21:21:32 2022 | root | number | | important=yes
856 | pre | | Thu May 19 19:24:52 2022 | root | number | zypp(zypper) | important=yes
857 | post | 856 | Thu May 19 19:25:24 2022 | root | number | | important=yes
858 | pre | | Fri May 20 17:28:21 2022 | root | number | zypp(zypper) | important=no
859 | post | 858 | Fri May 20 17:28:24 2022 | root | number | | important=no
860 | pre | | Sat May 21 07:56:21 2022 | root | number | zypp(zypper) | important=yes
861 | post | 860 | Sat May 21 07:56:50 2022 | root | number | | important=yes
862 | pre | | Sun May 22 00:03:28 2022 | root | number | zypp(zypper) | important=no
863 | post | 862 | Sun May 22 00:03:54 2022 | root | number | | important=no
864 | pre | | Sun May 22 11:18:35 2022 | root | number | zypp(zypper) | important=no
865 | post | 864 | Sun May 22 11:18:37 2022 | root | number | | important=no
866 | pre | | Mon May 23 05:35:32 2022 | root | number | zypp(zypper) | important=yes
867 | post | 866 | Mon May 23 05:35:56 2022 | root | number | | important=yes
868 | pre | | Mon May 23 07:29:31 2022 | root | number | zypp(zypper) | important=yes
869 | post | 868 | Mon May 23 07:29:34 2022 | root | number | | important=yes
870 | pre | | Tue May 24 13:47:17 2022 | root | number | zypp(zypper) | important=no
871 | post | 870 | Tue May 24 13:47:25 2022 | root | number | | important=no
872 | pre | | Wed May 25 04:18:46 2022 | root | number | zypp(zypper) | important=no
873 | post | 872 | Wed May 25 04:18:58 2022 | root | number | | important=no
874 | pre | | Thu May 26 10:52:47 2022 | root | number | zypp(zypper) | important=no
875 | post | 874 | Thu May 26 10:53:01 2022 | root | number | | important=no
876 | pre | | Thu May 26 22:32:51 2022 | root | number | zypp(zypper) | important=no
877 | post | 876 | Thu May 26 22:33:01 2022 | root | number | | important=no
**879 | pre | | Sun May 29 09:18:24 2022 | root | number | zypp(zypper) | important=no
880 | post | 879 | Sun May 29 09:18:25 2022 | root | number | | important=no
****erlangen:~ #**
macom
May 29, 2022, 10:00am
#15
Installed a package. 926 and 927 have been created as expected.
After a reboot I get
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 | | |
926 | pre | | Sun May 29 09:30:09 2022 | root | number | zypp(zypper) | important=no
927 | post | 926 | Sun May 29 09:30:11 2022 | root | number | | important=no
opensuse:~ # btrfs subvolume get-default /
ID 1262 gen 422414 top level 271 path @/.snapshots/922/snapshot
opensuse:~ #
Default snapshot is still 922. Shouldn’t it be 927 (the latest one)?
macom:
Installed a package. 926 and 927 have been created as expected.
After a reboot I get
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 | | |
926 | pre | | Sun May 29 09:30:09 2022 | root | number | zypp(zypper) | important=no
927 | post | 926 | Sun May 29 09:30:11 2022 | root | number | | important=no
opensuse:~ # btrfs subvolume get-default /
ID 1262 gen 422414 top level 271 path @/.snapshots/922/snapshot
opensuse:~ #
Default snapshot is still 922. Shouldn’t it be 927 (the latest one)?
Default on host erlangen is:
**erlangen:~ #** btrfs subvolume get-default /
ID 266 gen 249273 top level 265 path @/.snapshots/1/snapshot
**erlangen:~ #**
I don’t mind given ample disk space:
**erlangen:~ #** btrfs filesystem usage -T /
Overall:
Device size: 1.72TiB
Device allocated: 454.07GiB
** Device unallocated: 1.28TiB **
Device missing: 0.00B
Used: 430.74GiB
Free (estimated): 1.30TiB (min: 676.68GiB)
Free (statfs, df): 1.30TiB
Data ratio: 1.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Multiple profiles: no
Data Metadata System
Id Path single DUP DUP Unallocated
-- -------------- --------- -------- -------- -----------
1 /dev/nvme0n1p2 448.01GiB 6.00GiB 64.00MiB 1.28TiB
-- -------------- --------- -------- -------- -----------
Total 448.01GiB 3.00GiB 32.00MiB 1.28TiB
Used 426.72GiB 2.01GiB 64.00KiB
**erlangen:~ #**
macom
May 29, 2022, 10:39am
#18
Seems like I have a misunderstanding of the “default snapshot”. I was thinking that the systems boots into the default snapshot and that therefore the default snapshot should be the latest one after an installation of a package or zypper dup,
What does the default snapshot do?
macom
May 29, 2022, 10:51am
#19
From man snapper:
rollback [options] [number]
Creates two new snapshots and sets the default subvolume. **Per default the system boots from the default
subvolume of the root filesystem.** The exact actions depend on whether a number is provided or not:
• Without a number, a first read-only snapshot of the default subvolume is created. A second read-write
snapshot of the current system is created. **The system is set to boot from the second snapshot.**
• With a number, a first read-only snapshot of the current system is created. A second read-write
snapshot is created of number. The system is set to boot from the second snapshot.
So does that mean, by default the system boots from the default snapshot, but in normal operation the system is set to boot from the latest snapshot?
Default boot on host 6700k has:
**6700K:~ #** journalctl -b -u dracut-cmdline.service --full --no-pager
May 26 16:00:48 6700K systemd[1]: Starting dracut cmdline hook...
May 26 16:00:48 6700K dracut-cmdline[255]: dracut-dracut-056+suse.275.g4ce7a6a7-2.3
May 26 16:00:48 6700K dracut-cmdline[255]: Using kernel command line parameters: rd.driver.pre=btrfs root=UUID=227128c2-8703-4859-a006-30dccf5b299c rootfstype=btrfs rootflags=rw,relatime,ssd,space_cache,subvolid=1727,**subvol=/@/.snapshots/1250/snapshot,subvol=@/.snapshots/1250/snapshot** BOOT_IMAGE=/boot/vmlinuz-5.17.9-1-default root=UUID=227128c2-8703-4859-a006-30dccf5b299c quiet plymouth.enable=0 net.ifnames=0 mitigations=auto
May 26 16:00:48 6700K systemd[1]: Finished dracut cmdline hook.
May 26 16:00:49 6700K systemd[1]: dracut-cmdline.service: Deactivated successfully.
May 26 16:00:49 6700K systemd[1]: Stopped dracut cmdline hook.
**6700K:~ #**
Latest snapshot doesn’t matter:
**6700K:~ #** snapper list
# | Type | Pre # | Date | User | Cleanup | Description | Userdata
------+--------+-------+--------------------------+------+---------+------------------------+--------------
0 | single | | | root | | current |
**1250* | single | | Tue May 10 19:04:55 2022 | root | | writable copy of #1247 | **
1293 | pre | | Mon May 16 21:41:54 2022 | root | number | zypp(zypper) | important=yes
1294 | post | 1293 | Mon May 16 21:42:21 2022 | root | number | | important=yes
1303 | pre | | Thu May 19 22:16:50 2022 | root | number | zypp(zypper) | important=yes
1304 | post | 1303 | Thu May 19 22:21:13 2022 | root | number | | important=yes
1305 | pre | | Sat May 21 07:37:53 2022 | root | number | zypp(zypper) | important=yes
1306 | post | 1305 | Sat May 21 07:40:19 2022 | root | number | | important=yes
1309 | pre | | Mon May 23 05:16:09 2022 | root | number | zypp(zypper) | important=yes
1310 | post | 1309 | Mon May 23 05:18:47 2022 | root | number | | important=yes
1311 | pre | | Mon May 23 05:19:19 2022 | root | number | zypp(zypper) | important=yes
1312 | post | 1311 | Mon May 23 05:19:37 2022 | root | number | | important=yes
1313 | pre | | Tue May 24 14:26:40 2022 | root | number | zypp(zypper) | important=no
1314 | post | 1313 | Tue May 24 14:27:29 2022 | root | number | | important=no
1315 | pre | | Wed May 25 04:48:34 2022 | root | number | zypp(zypper) | important=no
1316 | post | 1315 | Wed May 25 04:49:13 2022 | root | number | | important=no
1317 | pre | | Thu May 26 07:25:38 2022 | root | number | zypp(zypper) | important=no
1318 | post | 1317 | Thu May 26 07:27:05 2022 | root | number | | important=no
1319 | pre | | Fri May 27 05:04:12 2022 | root | number | zypp(zypper) | important=no
1320 | post | 1319 | Fri May 27 05:05:06 2022 | root | number | | important=no
1321 | pre | | Sat May 28 17:25:35 2022 | root | number | zypp(zypper) | important=no
1322 | post | 1321 | Sat May 28 17:25:38 2022 | root | number | | important=no
1323 | pre | | Sat May 28 17:28:27 2022 | root | number | zypp(zypper) | important=no
1324 | post | 1323 | Sat May 28 17:28:31 2022 | root | number | | important=no
**6700K:~ #**