Hello!
I am using openSUSE Tumbleweed and I want to make use of snasphots, without using snapper.
So, I created a manual snapshot of my system:
sudo btrfs subvol snapshot /mnt/@ /mnt/@snapshots/1/snapshot/
I added this entry to /etc/grub.d/40_custom:
menuentry 'openSUSE Tumbleweed Maio' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-58ce4ca7-01f9-4a45-aa77-b7e6567b7f69' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod btrfs
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 58ce4ca7-01f9-4a45-aa77-b7e6567b7f69
else
search --no-floppy --fs-uuid --set=root 58ce4ca7-01f9-4a45-aa77-b7e6567b7f69
fi
echo 'Loading Linux 6.3.1-1-default ...'
linux /@snapshots/1/snapshot/boot/vmlinuz-6.3.1-1-default root=UUID=58ce4ca7-01f9-4a45-aa77-b7e6567b7f69 rootflags=subvol="@snapshots/1/snapshot" ${extra_cmdline} splash=silent quiet security=apparmor nosgx mitigations=auto
echo 'Loading initial ramdisk ...'
initrd /@snapshots/1/snapshot/boot/initrd-6.3.1-1-default
}
I regenerated grub.cfg through YaST
Then, when I tried to boot the snapshot from GRUB menu but I get this error message:
https://postimg.cc/4n9LJX4d
What is /mnt
? How are we supposed to guess it?
Your menu entry is unreadable. Post computer code as preformatted text (</>
button in editor).
Also upload information to share on https://susepaste.org/
@arvidjaar ,
I mounted my root partition, which is sda4, into /mnt, like this:
sudo mount -o subvolid=5 /dev/sda4 /mnt/
I created snapshots volume:
sudo btrfs subvol create /mnt/@snapshots
I created the directory “1” inside snapshot subvolume:
sudo mkdir /mnt/@snapshots/1/
Then, I created a snapshot of my running system:
sudo btrfs subvol snapshot /mnt/@ /mnt/@snapshots/1/snapshot
My GRUB menu entry:
menuentry 'openSUSE Tumbleweed Maio' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-58ce4ca7-01f9-4a45-aa77-b7e6567b7f69' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod btrfs
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4 58ce4ca7-01f9-4a45-aa77-b7e6567b7f69
else
search --no-floppy --fs-uuid --set=root 58ce4ca7-01f9-4a45-aa77-b7e6567b7f69
fi
echo 'Loading Linux 6.3.1-1-default ...'
linux /@snapshots/1/snapshot/boot/vmlinuz-6.3.1-1-default root=UUID=58ce4ca7-01f9-4a45-aa77-b7e6567b7f69 rootflags=subvol="@snapshots/1/snapshot" ${extra_cmdline} splash=silent quiet security=apparmor nosgx mitigations=auto
echo 'Loading initial ramdisk ...'
initrd /@snapshots/1/snapshot/boot/initrd-6.3.1-1-default
}
The GRUB error message:
https://paste.opensuse.org/pastes/73b9a7e0facd
Did you try the grub sub menu that is the normal way to boot to a snapshoy
@gogalthorp ,
No, I didn’t try that. I don’t know how to do it.
JKostaRibeiro:
I mounted my root partition, which is sda4, into /mnt, like this:
sudo mount -o subvolid=5 /dev/sda4 /mnt/
Then, I created a snapshot of my running system:
sudo btrfs subvol snapshot /mnt/@ /mnt/@snapshots/1/snapshot
If you have standard installation of Tumbleweed, your root filesystem is not in /mnt/@
. Post your /etc/fstab
.
cat /etc/fstab
UUID=58ce4ca7-01f9-4a45-aa77-b7e6567b7f69 / btrfs defaults,subvol=@ 0 0
UUID=D283-1165 /boot/efi vfat utf8 0 2
UUID=fa0d790a-db0c-4f32-8f92-ec9b6f39028f /media/dados ext4 rw,noatime 0 2
I did not accept the creation of 9 subvolumes in the installation process. I have created just one subvolume, called “@”.
Show
btrfs subvolume get-default /
grep -Ev '^#|^$' /etc/default/grub
cat /boot/efi/EFI/opensuse/grub.cfg
efibootmgr -v
btrfs subvolume get-default /
ID 256 gen 1741 top level 5 path @
grep -Ev '^#|^$' /etc/default/grub
GRUB_DISTRIBUTOR=
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent quiet security=apparmor nosgx mitigations=auto"
GRUB_CMDLINE_LINUX=""
GRUB_TERMINAL="gfxterm"
GRUB_GFXMODE="auto"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_USE_LINUXEFI="true"
GRUB_DISABLE_OS_PROBER="false"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"
cat /boot/efi/EFI/opensuse/grub.cfg
set btrfs_relative_path="yes"
search --fs-uuid --set=root 58ce4ca7-01f9-4a45-aa77-b7e6567b7f69
set prefix=(${root})/boot/grub2
source "${prefix}/grub.cfg"
BootOrder: 0000,0001,0005,0014,0017,0002,0003
Boot0000* opensuse-secureboot HD(1,GPT,350c8bef-5ec4-c442-a21d-932225c0df91,0x800,0x100000)/File(\EFI\OPENSUSE\SHIM.EFI)
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 ef 8b 0c 35 c4 5e 42 c4 a2 1d 93 22 25 c0 df 91 02 02 / 04 04 32 00 5c 00 45 00 46 00 49 00 5c 00 4f 00 50 00 45 00 4e 00 53 00 55 00 53 00 45 00 5c 00 53 00 48 00 49 00 4d 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
Boot0001* arch HD(1,GPT,350c8bef-5ec4-c442-a21d-932225c0df91,0x800,0x100000)/File(\EFI\ARCH\GRUBX64.EFI)
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 ef 8b 0c 35 c4 5e 42 c4 a2 1d 93 22 25 c0 df 91 02 02 / 04 04 30 00 5c 00 45 00 46 00 49 00 5c 00 41 00 52 00 43 00 48 00 5c 00 47 00 52 00 55 00 42 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
Boot0002* Hard Drive BBS(HD,,0x0)0000474f00004e4fb5000000010000006f00530061006d00730075006e006700200053005300440020003800350030002000450056004f0020003200350030004700420000000501090002000000007fff040002010c00d041030a0000000001010600001703120a000000ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce6320053003600520042004e004a0030003400420039003900320036digite ou cole aqui o código0020005800200020002000200000007fff04000000424f
dp: 05 01 09 00 02 00 00 00 00 / 7f ff 04 00
data: 00 00 47 4f 00 00 4e 4f b5 00 00 00 01 00 00 00 6f 00 53 00 61 00 6d 00 73 00 75 00 6e 00 67 00 20 00 53 00 53 00 44 00 20 00 38 00 35 00 30 00 20 00 45 00 56 00 4f 00 20 00 32 00 35 00 30 00 47 00 42 00 00 00 05 01 09 00 02 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 00 17 03 12 0a 00 00 00 ff ff 00 00 7f ff 04 00 01 04 3e 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 32 00 53 00 36 00 52 00 42 00 4e 00 4a 00 30 00 34 00 42 00 39 00 39 00 32 00 36 00 20 00 58 00 20 00 20 00 20 00 20 00 00 00 7f ff 04 00 00 00 42 4f
Boot0003* CD/DVD Drive BBS(CDROM,,0x0)0000474f00004e4fb3000000010000006f00540053005300540063006f007200700020004300440044005600440057002000530048002d005300320030003300500000000501090003000000007fff040002010c00d041030a0000000001010600001703120a000100ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce62000200020002000200020002000200020002000200020002000200020002000200020002000200000007fff04000000424f
dp: 05 01 09 00 03 00 00 00 00 / 7f ff 04 00
data: 00 00 47 4f 00 00 4e 4f b3 00 00 00 01 00 00 00 6f 00 54 00 53 00 53 00 54 00 63 00 6f 00 72 00 70 00 20 00 43 00 44 00 44 00 56 00 44 00 57 00 20 00 53 00 48 00 2d 00 53 00 32 00 30 00 33 00 50 00 00 00 05 01 09 00 03 00 00 00 00 7f ff 04 00 02 01 0c 00 d0 41 03 0a 00 00 00 00 01 01 06 00 00 17 03 12 0a 00 01 00 ff ff 00 00 7f ff 04 00 01 04 3e 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 d0 1b 4c e6 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 00 00 7f ff 04 00 00 00 42 4f
Boot0005* Fedora HD(1,GPT,350c8bef-5ec4-c442-a21d-932225c0df91,0x800,0x100000)/File(\EFI\FEDORA\SHIMX64.EFI)
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 ef 8b 0c 35 c4 5e 42 c4 a2 1d 93 22 25 c0 df 91 02 02 / 04 04 34 00 5c 00 45 00 46 00 49 00 5c 00 46 00 45 00 44 00 4f 00 52 00 41 00 5c 00 53 00 48 00 49 00 4d 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
Boot0014* opensuse HD(1,GPT,350c8bef-5ec4-c442-a21d-932225c0df91,0x800,0x100000)/File(\EFI\OPENSUSE\GRUBX64.EFI)0000424f
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 ef 8b 0c 35 c4 5e 42 c4 a2 1d 93 22 25 c0 df 91 02 02 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 4f 00 50 00 45 00 4e 00 53 00 55 00 53 00 45 00 5c 00 47 00 52 00 55 00 42 00 58 00 36 00 34 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
data: 00 00 42 4f
Boot0017* Fedora HD(1,GPT,350c8bef-5ec4-c442-a21d-932225c0df91,0x800,0x100000)/File(\EFI\FEDORA\SHIM.EFI)0000424f
dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 ef 8b 0c 35 c4 5e 42 c4 a2 1d 93 22 25 c0 df 91 02 02 / 04 04 2e 00 5c 00 45 00 46 00 49 00 5c 00 46 00 45 00 44 00 4f 00 52 00 41 00 5c 00 53 00 48 00 49 00 4d 00 2e 00 45 00 46 00 49 00 00 00 / 7f ff 04 00
data: 00 00 42 4f
SUSE grub has patches to resolve paths on btrfs relative to default subvolume if snapshot booting is enabled. Your default subvolume is /@
so subvolume /@snapshots
(and everything below it) is invisible to grub.