Grub2-install has broken my boot process - Is it because of device encryption?

I’m using Fedora on a fairly old laptop that still uses BIOS instead of UEFI. It was still using Fedora 36 (shame on me), so I updated it to Fedora 37. After that, I followed the instructions under Upgrading Fedora Using DNF System Plugin :: Fedora Docs to update GRUB. I also downloaded the packages for Fedora 38 and wanted to reboot.

However, Grub does not start Fedora anymore. The error message is:

error: ../../grub-core/commands/search.c:315: no such device: a83829e4-1b64-44c9-9f27-545ea69d5f74.
error: ../../grub-core/kern/fs.c:121:unknown filesystem.
Entering rescue mode...

In rescue mode, ls gives me only one device ((hd0)), which is of an unknown filesystem.

I was able to boot using a Fedora liveUSB-device. I chrooted into the system on the hard disk and retried grub2-install, but without success.

I use device encryption for the hard disk where Fedora is installed. The layout looks like this:

sde                 8:64   0 149,1G  0 disk                                                 
├─sde1              8:65   0 148,6G  0 part                                     LVM2_member RFbY9t-ShyA-MreL-D26J-sLJl-tqqC-KROsox
│ ├─fedora00-swap 254:1    0    10G  0 lvm                 fedora-swap          swap        45b96180-10e7-4c9b-b962-99c241c2c07d
│ └─fedora00-root 254:2    0 138,6G  0 lvm                                      crypto_LUKS 078a610e-7d00-4eff-9dba-c636a8fc75fc
│   └─fedora      254:3    0 138,5G  0 crypt               sys                  ext4        a83829e4-1b64-44c9-9f27-545ea69d5f74
└─sde2              8:66   0   500M  0 part                fedora-boot          ext4        82b5212e-3b9c-4035-980c-296282ade95d

What I noticed: a83829e4-1b64-44c9-9f27-545ea69d5f74 is the UUID Grub is looking for (and not finding) when booting. However, this is the volume after decryption, it is not supposed to be accessible when Grub is running. (If I get it correctly, the decryption always happened after starting the kernel). I’m not familiar enough with Grub to figure out how to tell it to get the boot process right, can anybody help me with this? I can post Grub configuration here if needed, just ask me for it.

bios, grub, luks2 hinzugefügt

Can you run the following command for us and post the results.

 sudo grep search /boot/grub2/grub.cfg

It would help is to find out what exactly grub is looking for.

Sure! If I mount /dev/sde2 at /boot, the result was initially (I made a snapshot):

if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  a83829e4-1b64-44c9-9f27-545ea69d5f74
  search --no-floppy --fs-uuid --set=root a83829e4-1b64-44c9-9f27-545ea69d5f74
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=boot --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  a83829e4-1b64-44c9-9f27-545ea69d5f74
  search --no-floppy --fs-uuid --set=boot a83829e4-1b64-44c9-9f27-545ea69d5f74

I have since tried to run grub2-install from the live USB, this changed it to:

if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  82b5212e-3b9c-4035-980c-296282ade95d
  search --no-floppy --fs-uuid --set=root 82b5212e-3b9c-4035-980c-296282ade95d
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=boot --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  82b5212e-3b9c-4035-980c-296282ade95d
  search --no-floppy --fs-uuid --set=boot 82b5212e-3b9c-4035-980c-296282ade95d

82b5212e-3b9c-4035-980c-296282ade95d belongs to a volume on the USB device.

According to the lsblk listing, this is the file system in /dev/sde2 which would be mounted as /boot. So this looks correct.

sde2              8:66   0   500M  0 part                fedora-boot          ext4        82b5212e-3b9c-4035-980c-296282ade95d

Is it possible that /boot was not mounted when you ran the grub2-install program the first time.

You are right, I got this wrong.

This is the case. A /bootdirectory exists under a83829e4-1b64-44c9-9f27-545ea69d5f74, but the partition with UUID 82b5212e-3b9c-4035-980c-296282ade95d was never mounted at /boot when running grub2-install.

Got it! After mounting 82b5212e-3b9c-4035-980c-296282ade95d under /boot and running grub2-install as root, I’m back into my Fedora System.