Are the grub2 quick-docs up to date (and OK to follow to rescue a system)?

Hi all,

One of my systems is a dual boot, and after some tinkering, unfortunately, my grub configuration seems to have broken down. I now drop into the grub prompt, and looks like I need to fix my grub.

Are these instructions still correct? The time stamp on the page is from 2012:

Also: Is the workstation live fine for this process?


I could also just reinstall—which would fix it—but I thought I’d take this opportunity to learn a bit more about grub and rescuing it.

Looks good to me.

Boot a live media, chroot into your system, reinstall grub, re-create grub config.

Off the cuff, I can only say for sure that …

  • 4.a. is obsoleted and not necessary for 4.b. Skip it. (Relevant only for LUKS)
  • 4.b. is still correct to open an encrypted device. (Relevant only for LUKS)
  • 5.a. also fine, although I never used mount with -o subvol=root I think (that’s for btrfs), but I can say for sure that the device you will have at /dev/mapper/x will behave equally to any non-encrypted device that would be /dev/sda3 or so. So if -o subvol=root makes sense for btrfs without encryption, it will do so here too.

That said, this part, 5.a. with -o subvol=root makes me wonder: I expect this command is btrfs-specific and was not necessary when we had ext fs, but btrfs became the Fedora default loooong after 2012. Reviewing again, I see there are references to F33 → there was updates after 2012.

I cannot say for sure, that’s now a guess, but I seriously doubt that 4.a. was relevant/necessary at the time of F33, but already obsoleted back then (guess!). So the sections COULD be a mix of different eras.

I have used chroot this way to get journals from (partially-)broken installations in modern Fedora variants (used that at least f42, likely f43). So my expectation is that it would work the same way with dnf. But I have not tested that.

I’d be careful and consider this experimental, but surely a good way to learn. Keep your backups ready though :stuck_out_tongue:

Maybe someone else has more information before you approach the experiment

Because of the bls configuration some things is slightly different. For example

grep -P "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2

would not see the entries defined by bls. You could use sudo grubby --info=ALL instead.

Otherwise most things looks about right, although to be sure I would need to test it.

Thanks all, I’ll give it a go in the next few days and report back. :crossed_fingers:

Unfortunately, the steps did not lead to a fixed grub. I fell back into the grub prompt after following them. So, in the interests of time, I’m reinstalling (i had my /home partition separated).

I’ll see if I can find time to do a VM or something where I similarly mess up the grub conf to verify if the steps fix it—but I’ll also perhaps e-mail devel to ask if someone with grub knowledge can please review the steps, since they are quite important.

Thanks for all your help and feedback folks.