How do I configure grub2?

There seems to be a lack of info on configuring grub2.

Here’s a specific problem:

The grub2 menu for 12.2M3 contains entries to boot 12.1.

I just installed a kernel update for 12.1. Now those grub2 menu entries point to the old, no longer there, kernels.

I could probably just edit grub.cfg to update that. But I gather that’s not the right way. So I tried running “grub2-mkconfig” to see what it does. The result shows in stdout (I did not specify the output file). But there is nothing there for booting 12.1.

Maybe this is a bug. Since the original install did add menu entries for 12.1, it should have put something in “/etc/grub.d” so that running grub2-mkconfig will properly update. Or, it should have booted 12.1 using the chain loader, which would get me to the grub legacy menu for 12.1 which is updated (in 12.1).

I’m looking for some feedback on this.

Note: this isn’t a pressing problem, since I am not using grub2 as the primary boot loader. I can chainload grub2 (12.2M3) from grub legacy (12.1).

So, just as you, I am trying my best to pick up on how grub2 functions, but don’t have the answers to it all just yet. Have you seen my bash script on the subject by chance?

GNU Grub2 Command Help/Config Editor - Version: 1.55 - Blogs - openSUSE Forums

You should check it out if you have not already done so.

Thank You,

You could check this too
GRUB 2 - FedoraProject

I’ve been testing F17 in a sandbox

Ubuntu based distros are different again
Nothing like consistency

This hasn’t had as much attention as it may deserve here GRUB2 Editor Can’t testify to its usefulness as I’ve only installed it twice today and a while back on Kubuntu.
James I found your script useful along with Pleasetryagains install script. Keeping in mind originally I came to opensuse to get away from grub2 its coming along and guess it was time to climb onboard.

http://forums.opensuse.org/english/other-forums/development/programming-scripting/471413-installing-grub2-updategrub2.html#post2457646

Thanks everybody.

Now I have some reading to do.

Okay, I found out a bit more about this.

Apparently,


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

is supposed to do the updating, and that probably works for most people.

In my case, that alternate linux install (12.1) is installed in an encrypted LVM. It seems that “grub2-mkconfig” is not willing to go by what it sees in “/boot”, but wants to check everything. So if I run “cryptsetup”, then “vgscan” then “vgchange” with the appropriate arguments to make the encrypted LVM file systems accessible, and then run “grub2-mkconfig”, it works fine.

My suggestion to whoever maintains “grub2-mkconfig” - if the details in the discovered grub cannot be checked out, at least add a chainloader entry to that alternate grub.

Again, use updateGrub2.