Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

multiboot: problem with grub [solved manually]

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Alberto60
Posts: 8
Joined: 2021-09-07 08:27

multiboot: problem with grub [solved manually]

#1 Post by Alberto60 »

Hi,

I have a Pc with multiples distributions and windows on 4 discs, setting for bios is CSM (legacy mode).
On one disk, i have make room and installed Debian 11.
It installs me a new grub, build it's menu and i found all entry's for each OS .
But there is a problem for CentOs and Fedora.
The main level menu for Fedora and Cent OS (only this ones) gives me recovery menu, correct entry's (last kernels) are in sub menu.
Well , I went back to Linux Mint 20, install he's grub , and with it, all menus are correct (top level for Fedora and CentOs are corrects ones)

So I think grub from Debian is little buggy, I'm not sure if I post in correct section ....
If someone can help me to debug it or give correct location where to post ...
BR
Last edited by Alberto60 on 2021-09-11 13:59, edited 2 times in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: multiboot: problem with grub

#2 Post by p.H »

Using os-prober to discover and add other Linux systems to GRUB menu is unreliable black magic. I switched to manually chainloading bootloaders or loading grub.cfg files instead.

Can you post the section in the original Fedora/CentOS grub.cfg and the resulting section in Debian grub.cfg ?
Last edited by p.H on 2021-09-07 11:23, edited 1 time in total.

Alberto60
Posts: 8
Joined: 2021-09-07 08:27

Re: multiboot: problem with grub

#3 Post by Alberto60 »

Thanks for answer.
There are no grub.cfg in /boot from Fedora nor Centos, grub isn't installed there , only 1 os make the grub. Os-prober scans the /boot folders , it's working like this sins some years.
As written above, i switched back to LM mint (here mint 19.3, it's Ubuntu 18.04 based)
Here attached the final grub.cfg
grub.tar.gz
(3.03 KiB) Downloaded 35 times
BR

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: multiboot: problem with grub

#4 Post by p.H »

Alberto60 wrote: 2021-09-07 11:18 There are no grub.cfg in /boot from Fedora nor Centos, grub isn't installed there
IME, this is not the right way for reliable multiboot. Without hints from grub.cfg (or other supported bootloader config file), grub-mkconfig cannot build proper menu entries for other Linux systems. E.g. the kernel command line uses the unreliable root=/dev/* instead of persistent identifiers such as UUIDs and lacks any other kernel parameter.

My advice is to install at least the grub package needed to generate grub.cfg in all systems (in Debian : grub2-common, don't know about Fedora and CentOS).

Can you post the grub.cfg file from Debian ?

Alberto60
Posts: 8
Joined: 2021-09-07 08:27

Re: multiboot: problem with grub

#5 Post by Alberto60 »

I've rebuild it without install it on sda, because last record was with GRUB_DISABLE_OS_PROBER=true in /etc/default/grub. I done this to save time on secondary distributions, 1 SSD and 3 old disks ....
here attached :
grub.tar.gz
(2.66 KiB) Downloaded 44 times
Perhaps all is not set correctly for Debian, but for Ubuntu based all is working OK 18.04 and 20.04.
And grub from Debian 11 is very close to Ubuntu 20.04 (version 2.04)

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: multiboot: problem with grub

#6 Post by p.H »

Calling sequence:
- update-grub calls grub-mkconfig.
- grub-mkconfig calls /etc/grub.d/30_os-prober to probe other systems.
- 30_os-prober calls linux-boot-prober to retrieve the kernel list and parameters of another system.
- Without a GRUB or LILO config file, linux-boot-prober gets the kernel list by calling /usr/lib/linux-boot-probes/mounted/90fallback.

In the os-prober package from Debian, the kernel list is sorted by ls default order (alphabetical).
If you want the kernels sorted by reverse version order, edit /usr/lib/linux-boot-probes/mounted/90fallback and change the following line :

Code: Select all

for kernfile in $(eval ls "$mpoint$kernpat" 2>/dev/null); do
into

Code: Select all

for kernfile in $(eval ls -vr "$mpoint$kernpat" 2>/dev/null); do
But I repeat : it is much better to have a grub.cfg file, so that update-grub can retrieve the kernel order and parameters from it.

Edit: add 30_os-prober to the calling sequence.
Last edited by p.H on 2021-09-08 15:20, edited 4 times in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: multiboot: problem with grub

#7 Post by p.H »


Alberto60
Posts: 8
Joined: 2021-09-07 08:27

Re: multiboot: problem with grub

#8 Post by Alberto60 »

Many thank for the calling sequence.
Yes off course it's working.
With meld I've compared the 90fallback script from ubuntu's one.
They use "ls -t" as sorting rule, and it's from install. Is working also.

Yes of course, I think it is more sure tu have a grug.cfg generated by each distro, but 2 things here :
1) some distros didn't install the stuff by default or use different grub2 folder (Debian / Ubuntu based distros did it correctly OK)
2) I prefer done without for saving time, I have some slow disks...

And the remaining question : why was the proposal from 2014 not applied , as Ubuntu based distros have done it ?
Ohh I've just see it, Pascal is it you ?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: multiboot: problem with grub

#9 Post by p.H »

Alberto60 wrote: 2021-09-08 13:31 They use "ls -t" as sorting rule, and it's from install. Is working also.
-t sorts by file (build) date. It may not work if you have kernels from multiple repositories, e.g. oldstable, stable, stable-backports, testing... or build your own kernels from various versions in various order. The most recently built kernel may not be the higher version, e.g. if the latest kernel from stable was built after the latest kernel from stable-backports.
Alberto60 wrote: 2021-09-08 13:31 2) I prefer done without for saving time, I have some slow disks...
Set GRUB_DISABLE_OS_PROBER=true in /etc/default/grub on these systems to save time when running update-grub.
Alberto60 wrote: 2021-09-08 13:31 why was the proposal from 2014 not applied , as Ubuntu based distros have done it ?
I guess there was no consensus about the best way to fix the issue. As I wrote, -t is far from ideal and would not get my vote.
Alberto60 wrote: 2021-09-08 13:31 Pascal is it you ?
Yes. When I found this old bug report, I sent a reply in an attempt to revive it. We'll see...

Alberto60
Posts: 8
Joined: 2021-09-07 08:27

Re: multiboot: problem with grub

#10 Post by Alberto60 »

Ok, many thanks Pascal, I will look for Debian grub's updates if something new come on disk ;)
Thread solved

Post Reply