How to reinstall grub2-efi bootloader?

Okay.

Firstly, my mistake. I should have suggested CTRL-ALT-F2 to get a terminal where you can enter that “efibootmgr -v” command. Actually, I did suggest booting it to the rescue system, which would have given you a console session.

However, it does seem that you are connecting with UEFI firmware, so reinstalling grub2-efi should work.

The “legacy_boot” flag in the openSUSE partition probably won’t cause any problems.

In any case, here’s how to proceed.

1: Boot the install medium to the rescue system. You should be able to login as root with no password.

2: Mount your root partition at “/mnt”. This will be something like:

mount /dev/sdaX /mnt

but change that to the root partition of your opensuse system.

3: Maybe run

efibootmgr -v

just to check that you are in EFI mode. If it tells you that no boot order is set, that’s okay at this stage. If it reports an error with “efivars” then you are booted to legacy mode.

4: Some bind mounts:


mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc

5: Now chroot into your mounted system, with

chroot /mnt

6: You should still be in your chroot session. So do:

mount -a

That should mount everything else that you need. Maybe check with:

ls /boot/efi

(it should list something, perhaps “EFI” (a directory name).

7: Install grub2-efi with:

shim-install

And you probably need to update the boot menu, with

grub2-mkconfig -o /boot/grub2/grub.cfg

8: Exit from the chroot session

exit

9: Reboot from command line

shutdown -r now

I’ll note that you might need to have secure-boot disabled for this to work. We can fix that later.

If the Windows boot code is in the EFI partition, then that should be picked up as a boot entry in the grub2 menu.

Let us know how things turn out.

1 Like