is GRUB deliberately broken in openSUSE?

despite the “LEAP 15” prefix these issues are reproduced in all openSUSE releases since 13.0 or which was the first release with GRUB2, I always just reinstalled the bootloader from the USB and did not bother to create a topic until now.

First issue,


** grub rescue>** insmod linux
** grub rescue>** insmod lol
** grub rescue> **insmod -1
** grub rescue> **insmod ~!@#$%^&*()_
** grub rescue> **

Do I need to “increase verbosity” somehow to see the error messages?

Next,


** grub rescue> **ls (hd0,gpt5)/
message vmlinuz-4.16.12-1-default sysctl.conf-4.16.12-1-default grub2/ vmlinux-4.16.12-1-default.gz vmlinuz config-4.16.12-1-default systypes-4.16.12-1-default.gz System.map-4.16.12-1-default initrd symvers-4.16.12-1-default.gz boot.readme initrd-4.16.12-1-default .vmlinuz-4.16.12-1-default.hmac efi/
** grub rescue>** ls (hd0,gpt5)/grub2/x86_64-efi/
acpi.mod trig.mod ahci.mod ..... (this is a folder with GRUB modules)
...
...
..... linux.mod lsacpi.mod jfs.mod all_video.mod terminal.mod newc.mod
** grub rescue> **insmod (hd0,gpt5)/grub2/x86_64-efi/linux.mod
** grub rescue> **linux (hd0,gpt5)/grub2/vmlinuz
Unknown command `linux'
** grub rescue> 
**

While the second issue does not very concern me - I could just reinstall GRUB from the installation USB, but the first one seems really strange. How do I find out if the module loaded or not?

Hi, welcome.

First: I edited your post and removed an acronym used, since it’s not allowed, as per T&C.
Second: a title like the one you’ve chosen does definitely not invite people who spend their own spare time to support others, to even read the post.

Then on-topic:

Why do you do this the way you do it? From what I read you’re having issues from openSUSE 13,x and have been doing manual grub2 adjustments like you describe. I personally haven’t seen bootloader issues, but here’s the easy way to regenerate the bootloader without using the grub rescue invocation:

  • Find out on which partition the root fs is located, I’ll refer to it as /dev/sdX# where X is an alphabetic, # a number. Replace these by the alphabetic and number you found.
  • Boot from a USB-install disk and wait until the installer starts, then hit Ctrl-Alt-F2 to get to a root prompt.
  • Next do this

mount /dev/sdX# /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
yast

  • Open the YaST bootloader module, change f.e. the delay of the menu from 8 to 7 secs, and confirm everything. The bootloader will be reconfigured, it’s code and config rewriten.
  • Reboot and you should be fine.

It is far from clear what you are doing.

As best I can tell, you are on a UEFI based system. And perhaps secure-boot is enabled on your system.

If secure-boot is enabled, then grub2-efi internally disables “insmod”, so as to prevent secure-boot violations. And “grub2” has been loaded from “grub.efi” in your EFI partition, which already has preloaded the modules normally needed.

Additionally, “linux” is not allowed if secure-boot is enabled – one must use “linuxefi” (which checks signatures).

If you don’t like those restrictions, then disable secure-boot in your firmware.

Oh, if you think you have found a bug, then report it at bugzilla.opensuse.org.

Now it’s clear to me, thank you! Yes, I’m on EFI-based system with secure boot enabled.
I’ve reinstalled the bootloader already but next time will try linuxefi.

> If secure-boot is enabled, then grub2-efi internally disables “insmod”, so as to prevent secure-boot violations.

I think GRUB should show some error message like “insmod is disabled in secure boot mode” to prevent such confusion. However I’m too lazy to file a bug report, sorry :slight_smile:

Thanks for your advice but I often have complicated setups like encrypted LVM or RAID so trying this method after swapping a HDD or moving them to another computer I usually stuck on something like lvscan -v => Device blabla-123123-blabla-123 not found or rejected by filter => ragequit => reinstall bootloader from installation disk with no issues.

You could close the topic now, my issue is resolved - no error messages in GRUB and “unknown command `linux’” is because of UEFI and Secure Boot enabled.