[SOLVED] grub not load after a power fault during an update
SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It's not materially different with BTRFS than with EXT4. Grub isn't finding what it's looking for, so a boot from another OS is required to btrfs-check the root filesystem, then try booting again after. If that isn't enough to bring up the Grub menu, then again boot another OS to setup and run the installed system in chroot, from which YaST can be run in text mode to reconfigure the bootloader. Any change whatsoever in yast bootloader will completely configure everything to do with Grub, even (re)install rpms if necessary, as long as internet is available.
For anyone interested, as I was unable to find a specif guide to opensuse/btrfs which complicates a bit the standard procedure that applies to a regular FS like ext4:
Boot with a USB stick with btrfs support, preferentially a version of the same distro, in this case, opensuse net installer.
If using the same distro to boot, look at boot menu. There is an option to "upgrade" the current system. It will scan the disk and if found a up-gradable version, proceed with the process, eventually it get fixed.
Manual approach: Boot with the USB stick , look at menu for an option "rescue" or if it is a live distro, boot normally.
1) identify the boot disk and partition: "lsblk -f"; lets say you identify the system at /dev/sda4
2) create a mount point at "/mnt" to mount the whole partition: "mkdir /mnt/volume"
3) mount it: "mount /dev/sda4 /mnt/volume";
3a) optional: at "/mnt/volume/@" you will see the root disk structure and at "/mnt/volume/.snapshots" you see all snapshots for this disk.
3b) optional: to figure out which is the current snapshot so you can navigate to it in "/mnt/volume/.snapshots/_ID_number_here_" you can run "btrfs subvolume get-default /mnt/volume".
3c) optional: CAUTION, BY YOU OWN RISK: you can rollback to a specific snapshot with "btrfs subvolume set-default _ID_number_here_ /mnt/volume", but it is probably safer doing that at the specific opensuse grub menu.
4) check the current subvolumes avaiable: "btrfs subvolume list /mnt/volume"; take a note of pairs of path/_ID_number_ for each relevant paths: (@, usr, var, etc...specially the 2 /boot/grub2 entries)
5) Create another mount point to the root fs: "mkdir /mnt/myroot";
6) Mount those paths at /mnt/myroot/whatever: i.e: for path "@", id 256: "mount /dev/sda4 -o subvolid=256 /mnt/myroot" ; for path "usr" id 257: "mount /dev/sda4 -o subvolid=257 /mnt/myroot/usr" ; repeat for all system paths/IDs, don't forget the 2 /boot/grub2 entries.
7) bind mounts: "mount /proc -o bind /mnt/myroot/proc"; "mount /sys -o bind /mnt/myroot/sys"; "mount /dev -o bind /mnt/myroot/dev";
8) chroot /mnt/myroot
9) You are ready to re-install grub, either by "update-bootloader --reinit" or/and "grub2-install"
Good luck for you, not for me though. The folders/files structure was FUBAR due to power loss.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.