Skip to content

GRUB still looks for grub.cfg on previous subvolume after snapper rollback #722

Open

Description

@geckolinux

Hi there, on distros that are not based on openSUSE I keep running into an issue where the GRUB menu stops updating after a snapper --ambit classic rollback because GRUB is apparently looking for the /boot/grub/grub.cfg on the previous subvolume where grub-install /dev/XXX was performed. The workaround is to run grub-install again after rebooting into the new default subvolume that Snapper set. But this isn't ideal for end-users. Is there a distro-agnostic way of working around this? Or is there some fundamental concept about Btrfs and/or Snapper that I'm ignoring? Thanks for the help.

Activity

  1. aschnell commented on May 12, 2022

    @aschnell
    Member

    On openSUSE the package grub2-snapper-plugin provides the script /usr/lib/snapper/plugins/grub (https://build.opensuse.org/package/view_file/openSUSE:Factory/grub2/grub2-snapper-plugin.sh) which is called from snapper. But I cannot say if that is all that is required.

  2. geckolinux commented on May 12, 2022

    @geckolinux
    Author

    Hi @aschnell , thanks for the reply. Yes, other distros don't include the GRUB2 snapper plugin. Even in openSUSE I'm not sure about its behavior, does Snapper on openSUSE somehow avoid this issue where the GRUB looks for the grub.cfg on the wrong (previous) subvolume where it was first installed? Is this behavior that I'm seeing expected, or am I not understanding something?

  3. arashsm79 commented on Sep 2, 2023

    @arashsm79

    I think openSUSE uses a patched version of grub that may not be available on all distros.
    Reliable Desktop Linux Installation with Btrfs Snapshots, Snapper, and Rollbacks on Ubuntu (openSUSE style) explains this issue and devises a snapper plugin that allows grub to look for grub.cfg in the correct subvolume after each rollback.

    #365 may also be relevant.

  4. ak-li commented on Aug 2, 2024

    @ak-li

    Possibly of interest.
    siduction-btrfs

    We have developed a user-friendly solution to this problem.
    siduction is a rolling release distribution based on Debian sid.

    We use systemd units and two scripts to create a clean boot menu for the user.
    In the case of GRUB, after a rollback, the system boots into the rollback target and reinstalls GRUB from there.
    In the case of systemd-boot, boot entries are generated for the rollback target and all kernels present there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions