A reminder to check your config when having grub problems

Recently we had Latest grub bricked my system (grub_is_shim_lock_enabled not found) and reinstalling grub didn’t seem to work at all.

I’ve been testing/migrating between manjaro/eos and zfs/btrfs/ext4 and was seeing weird behavior. All booting was via EFI/grub.

manjaro/zfs was the original install, and I was using EFI bootloader ID = manzfs.
manjaro/btrfs was a failsafe install for if I broke the manzfs install. ID = altbtr.
I installed eos into partition 7 as ext4 as an interim before copying it to the same zfs pool as manjaro, with the intent using a temporary ext4 boot partition in p8 until I integrated the eoszfs with the existing manzfs using a zfs boot pool in p3.

I could not get the p8 boot to work at all. For booting. I could boot eoszfs from the manzfs EFI entry, and load linux and initrd from p8, but I could not generate a working grubx64.efi for p8. This also happened when I tried with manzfs and altbtr by remounting /boot on p8, and then /boot/efi below that. The grub-mkimage works, and built using the required ext2 and part_gpt modules, but I got a blank screen when I booted that EFI entry.

Eventually I though that maybe the NVME wasn’t getting detected somehow, and had some recollection that maybe NVME controllers were AHCI related, so I used grub-install --module=ahci to force ahci module into the grubx64.efi.

I didn’t get a blank screen this time, I got a grub-rescue screen. But grub-rescue would not show any hds. Prefix was just as the modules was compiled, ‘(,gpt8)’, but when I tried ls I got nothing, and when I tried ls (hd0,gpt8) I got nothing. Still seemed like NVME wasn’t getting passed from the BIOS.

Eventually I tried multiple different grub directories with a ln -s, ie /boot/grub-mane48 /boot/grub-eose48 and ln -s /boot/grub to the one I was testing with at the time. I didn’t have any luck until I created empty directories /boot/grub* directories, and did a clean grub-install into that, and then it did start working.

I can only guess that there was something residual in the /boot/grub that was causing issues even after a grub-install, and the grubx64.efi that was generated was subsequently broken.

So if you see something like this again, move /boot/grub to /boot/grub.broken, mkdir /boot/grub new and empty, and grub-install and grub-mkconfig, and hopefully you won’t have to go thru the iterations I did to finally get it to work.

As usual, most of man’s problems are self-inflicted.

2 Likes

:interrobang:

Really? Giving advice to others because of your PEBCAK?

The topic title is insulting and offensive. It should be modified, to reflect the topic issue properly.

Edit: Title is OK now.

:expressionless:

@pebcak :tm:

EDIT

PEBCAK anomalies, while playing with Grub

Thanks @dalto :wink:

1 Like

It seems that a post that was intended to be helpful has been taken the wrong way by some of our community.

I think we can keep this post available to all but shut down further discussion on it.

1 Like