After upgrade options relarted to btrfs not visible in grub menu

After perform zypper dup there’s no option “start bootloader from read-only snapshot”. I’m using grub2 with OpenSuSE Tumbleweed and btrfs as root.

Well, there was a similar question today already:
https://forums.opensuse.org/showthread.php/507257-snapper-grub-and-booting-from-an-old-snapshot

So, do you have a separate /boot partition?
Then this is not supported and cannot work actually (because the kernel and initrd are not part of any snapshot).

OTOH, what do you actually mean with “After perform zypper dup”?
Did you upgrade to Tumbleweed now (from what?), and you don’t have that menu entry? Or were you already using Tumbleweed and just updated your system to the latest state with “zypper dup” which made the entry disappear?

Do you actually have any snapshots?
Is grub2-snapper-plugin installed?

Grub2 snapper plugin is installed.


grep boot /etc/mtab 
/dev/sda1 /boot/grub2/i386-pc btrfs rw,relatime,space_cache 0 0
/dev/sda1 /boot/grub2/x86_64-efi btrfs rw,relatime,space_cache 0 0
linux:/home/slawomir # grep boot /etc/fstab 
UUID=98802e57-e2a4-4227-b44d-db5efbb31d41 /boot/grub2/i386-pc btrfs subvol=boot/grub2/i386-pc 0 0
UUID=98802e57-e2a4-4227-b44d-db5efbb31d41 /boot/grub2/x86_64-efi btrfs subvol=boot/grub2/x86_64-efi 0 0

So, probably, I haven’t separate /boot partition, boot different subvolume. I updated my system to latest state of Tumbleweed.

Seems to be the case, yes.
So it should work.

I updated my system to latest state of Tumbleweed.

So it did work before with Tumbleweed and the latest update broke it?

I have no Tumbleweed system near me at the moment, so I cannot check whether this is a general problem or not.

But does ~/.snapshots/grub-snapshot.cfg exist? This is what actually displays that submenu.
Do you have “SUSE_BTRFS_SNAPSHOT_BOOTING=true” in /etc/default/grub?

Does your /boot/grub2/grub.cfg contain this section?

### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
if  -f "/.snapshots/grub-snapshot.cfg" ]; then
  source "/.snapshots/grub-snapshot.cfg"
fi
### END /etc/grub.d/80_suse_btrfs_snapshot ###

“Do you have “SUSE_BTRFS_SNAPSHOT_BOOTING=true” in /etc/default/grub?”

Yes.

“Does your /boot/grub2/grub.cfg contain this section?”
No.


sudo grep 80_suse /boot/grub2/grub.cfg

No display any lines.



/codegrub2-mkconfig > ~/test-grub
Generating grub configuration file ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-4.0.1-1-desktop
Found initrd image: /boot/initrd-4.0.1-1-desktop
Found linux image: /boot/vmlinuz-4.0.0-1-desktop
Found initrd image: /boot/initrd-4.0.0-1-desktop
Found linux image: /boot/vmlinuz-3.19.4-1-desktop
Found initrd image: /boot/initrd-3.19.4-1-desktop
Found linux image: /boot/vmlinuz-3.19.3-1-desktop
Found initrd image: /boot/initrd-3.19.3-1-desktop
Found linux image: /boot/vmlinuz-3.19.2-1-desktop
Found initrd image: /boot/initrd-3.19.2-1-desktop
Found linux image: /boot/vmlinuz-3.19.1-2-desktop
Found initrd image: /boot/initrd-3.19.1-2-desktop
Found linux image: /boot/vmlinuz-3.19.1-1-desktop
Found initrd image: /boot/initrd-3.19.1-1-desktop
Found linux image: /boot/vmlinuz-3.19.0-2-desktop
Found initrd image: /boot/initrd-3.19.0-2-desktop
Found linux image: /boot/vmlinuz-3.19.0-1-desktop
Found initrd image: /boot/initrd-3.19.0-1-desktop
Found linux image: /boot/vmlinuz-3.18.3-2-desktop
Found initrd image: /boot/initrd-3.18.3-2-desktop
/etc/grub.d/15_ostree: line 38: /usr/share/grub/grub-mkconfig_lib: No such file or directory

ostree is control version system for binary files, I guess. Why grub needs it?

Ok. I have moved /etc/grub.d/15_ostree to ~root run grub2-mkconfig > /boot/grub2/grub.cfg, restart and everythink works.

The problem here is that /etc/grub.d/15_ostree tries to run /usr/share/grub/grub-mkconfig_lib, but that file is called /usr/share/grub2/grub-mkconfig_lib in openSUSE.
And since 15_ostree fails, the other scripts (including /etc/grub.d/80_suse_btrfs_snapshot) are not run any more either.

ostree is control version system for binary files, I guess. Why grub needs it?

Grub does not need ostree at all, unless that has changed recently in Tumbleweed.
But as 15_ostree is located in /etc/grub.d/, it is run by grub2-mkconfig, like all other scripts in there.

I don’t have that file (15_ostree) here on my 13.2 btrfs installation.
Did that get installed automatically or did you somehow create it yourself?
Or did you manually install any “ostree” package (I can’t find any on software.opensuse.org…)?

Try moving it back and run “rpm -qf /etc/grub.d/15_ostree” to find out from which package it comes from if any.

If it is installed by (or is at least part of) the distribution and does not work, this should be reported as bug.

PS: 15_ostree is indeed part of ostree. If you installed that from source, modify 15_ostree accordingly to correctly source /usr/share/grub2/grub-mkconfig_lib in line 38.


rpm -qf /etc/grub.d/15_ostree
ostree-2015.5-1.1.x86_64

I have installed xdg-app, which using ostree.

Again, I don’t find any openSUSE “ostree” package, and I don’t find “xdg-app” either.

Where did you install them from?
What does this say?

rpm -qi xdg-app ostree

As I said already, that /etc/grub/ostree tries to load grub-mkconfig_lib from /usr/share/grub/, but on openSUSE it is located in /usr/share/grub2/.

If that package is intended for openSUSE, you should tell the packager to fix that.

And as I wrote, you can fix it by modifying /etc/grub.d/15_ostree accordingly, or creating a symlink from /usr/share/grub/ to /usr/share/grub2/ should help as well:

sudo ln -sf /usr/share/grub2/ /usr/share/grub

Thanks.
I have moved 15_ostree into other directory and recreating grub menu entries, so everything work perfect. I don’t remember, where I moved this file, but this doesn’t matter.


>rpm -qi xdg-app ostree
Name        : xdg-app
Version     : 0.1+git.20150407.fc8db2b
Release     : 1.1
Architecture: x86_64
Install Date: Sat May  2 15:00:26 2015
Group       : System/Utilities
Size        : 224293
License     : LGPL-2.1+
Signature   : RSA/SHA256, Thu Apr 23 11:08:14 2015, Key ID b88b2fd43dbdc284
Source RPM  : xdg-app-0.1+git.20150407.fc8db2b-1.1.src.rpm
Build Date  : Thu Apr 23 11:08:02 2015
Build Host  : cloud117
Relocations : (not relocatable)
Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : https://wiki.gnome.org/Projects/SandboxedApps
Summary     : Manage OSTree based application bundles
Description :

Distribution: openSUSE Factory
Name        : ostree
Version     : 2015.5
Release     : 1.1
Architecture: x86_64
Install Date: Sat May  2 15:00:22 2015
Group       : System/Libraries
Size        : 187186
License     : GPL-2.0+
Signature   : RSA/SHA256, Thu Apr 23 10:37:50 2015, Key ID b88b2fd43dbdc284
Source RPM  : ostree-2015.5-1.1.src.rpm
Build Date  : Thu Apr 23 10:37:39 2015
Build Host  : build76
Relocations : (not relocatable)
Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://www.google.com
Summary     : Git for operating system binaries
Description :
OSTree is a tool for managing bootable, immutable, versioned
filesystem trees. While it takes over some of the roles of tradtional
"package managers" like dpkg and rpm, it is not a package system; nor
is it a tool for managing full disk images. Instead, it sits between
those levels, offering a blend of the advantages (and disadvantages)
of both.
Distribution: openSUSE Factory

It seems I have installed some packages from factory, so probably I can remove it . I don’t use xdg-app actually.

Will OpenSuSE drop grub-legacy support? That explains everything.

Ah, right. It is indeed part of Factory.
But software.opensuse.org didn’t find it for some reason when I searched for it…:\

In this case you should file a bug report, I’d say.
http://bugzilla.opensuse.org/ (same username/password as here)
15_ostree in openSUSE’s package should refer to the correct location in openSUSE.

Will OpenSuSE drop grub-legacy support? That explains everything.

Depends on what you mean with “support”.
grub legacy is still available as package, and I don’t know about any plans to drop it.
But perl-Bootloader’s support code has been removed for 13.2 already, so you have to maintain the boot menu/configuration yourself.

But that’s unrelated to grub2 and ostree anyway I’d say. I haven’t head of any plans to rename grub2 to grub either, if that’s what you mean.
I suppose that would be a lot of unnecessary work and error prone.

yast-storage support code. perl-Bootloader code is still there as far as I can tell. Not sure how well it works and whether anyone tests it though.

You’re right, and LILO/ELILO support is still there too.
Thanks for the correction.

So the boot menu should still get updated accordingly if you’d set LOADER_TYPE=“grub” manually in /etc/sysconfig/bootloader I suppose (unless there are bugs).
But you cannot use YaST to configure it, and you cannot choose it during installation.