Grub Customizer Question(s)

  • Distribution & Version Linux Mint 20.2 & 3
  • Kernel information 5.11.0-44-generic

My system is multi-boot with Linux Mint, Linux Mint and POP_OS!

My normal cycle is to install a new version of LM on it’s own partition and make sure it’s happy (and I have all my settings and data in place) before I abandon the previous install. The last time I did this I got a wild hair and decided to try out BTRFS for the new install.

Afterward, I couldn’t get GRUB to offer up the new install on the BTRFS drive so I used GRUB Customizer to set up GRUB to default to the new BTRFS partition. So far, so good.

Until there was a kernel update. The kernel is not updated in GRUB for the BTRFS partition. I have had to go in and manually change the menu entry with GRUB Customizer each time the kernel updates. The advanced options entries update, but not the entry for regular launching.

Looking at the menu entries I see that my LM 20 on BTRFS is the only one that shows as “menuentry / script: custom” which makes sense, since I had to hand write it to make it work originally. The Advanced option entries are “menuentry / script: linux”.

The other OSs are “menuentry / script: os-prober” as are their advanced option entries.

What I cannot find an answer to:

1 - How do I change “menuentry / script: custom” to “menuentry / script: os-prober”? I assume that will cause os-prober to update the entry with each kernel update.

2 - Is the “menuentry / script: linux” in the advance options for the BTRFS install correct or should it also be “menuentry / script: os-prober”?

I have spent a lot of time searching on line but I can’t seem to find anything that relates to this. I seem to always be the only person who ever did a thing that way. :thinking:

Any thoughts, ideas, snark or general life advice welcomed.

Thanks for looking.

Just to close the loop, and help anyone who stumbles across my question trying to solve a similar issue, here is what I found:

I kept at it and asked for assistance elsewhere. Leo Chavez found a thread on Ask Ubuntu that shed some light on how the entry could be modified to work.

Here is what I ended up doing to “solve” the issue:

While I did not find an elegant way to convert the menuentry to os-prober I did deduce from the link above that removing the reference to a specific kernel in the script would cause GRUB to load whatever was the latest installed kernel at boot.

My original entry looked like this:

> insmod part_msdos
> insmod btrfs
> set root='hd4,msdos1'
> if [ x$feature_platform_search_hint = xy ]; then
>   search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos1 --hint-efi=hd4,msdos1 --hint-baremetal=ahci4,msdos1  [Hard Drive UUID]
> else
>   search --no-floppy --fs-uuid --set=root [Hard Drive UUID]
> fi
> linux	/@/boot/vmlinuz-5.11.0-44-generic root=UUID=[Hard Drive UUID] ro rootflags=subvol=@  quiet splash $vt_handoff
> initrd	/@/boot/initrd.img-5.11.0-44-generic

The modified entry looks like this:

insmod part_msdos
insmod btrfs
set root='hd4,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd4,msdos1 --hint-efi=hd4,msdos1 --hint-baremetal=ahci4,msdos1  [Hard Drive UUID]
else
  search --no-floppy --fs-uuid --set=root [Hard Drive UUID]
fi
linux	/@/boot/vmlinuz root=UUID=[Hard Drive UUID] ro rootflags=subvol=@  quiet splash $vt_handoff
initrd	/@/boot/initrd.img

The only difference between them being the removal of “-5.11.0-44-generic” from the last two lines. The system boots to the current kernel. I tried to boot to a previous kernel and got some errors for my trouble, but it did eventually boot the previous kernel.

Now I have to wait until the kernel is updated again to verify that it automagically will boot the latest installed kernel.

Hopefully, this will help someone. I’ll try to remember to update this after the next kernel update.

2 Likes

Update time. Pardon the pun. Kernel 5.11.0.46 showed up today in my updates. I installed the kernel and rebooted. The new kernel was loaded. The fix appears to be a good one.

1 Like

Update: It appears it likes the “last” updated kernel. 5.4 kernel updated and that knocked 5.11 out of the boot. Now I’m getting the 5.4 kernel every time.

I’m really not sure what to do at this point…