Grub mulltiboot with kernel order

Hello,
I have three different Fedora installations on the same hdd, one with Gnome, one with Xfce and one unstable.
While os-prober finds all the distros, the kernel versions are listed from older version to newer, so every time I have to go to the submenu and choose the last entry.
Of course this doesn’t happen on the main distro which grub is installed.

Is there a way to change the kernel’s version for the rest distros?

What is your disk layout? Are the three Fedora sharing the same /boot ?

I have legacy bios. Each distro has their own /boot folder, separated from each other.

sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 55.9G 0 part /
├─sda2 8:2 0 55.9G 0 part
├─sda3 8:3 0 55.9G 0 part
├─sda4 8:4 0 1K 0 part
├─sda5 8:5 0 9.3G 0 part
└─sda6 8:6 0 288.8G 0 part

Where sda1, sda2 and sda3 are the different distros.

1 Like

I have done a quick test in virt-manager:

Create a 40G virtual disk
Install Fedora server1 using ext4, 10GiB as vda1, reboot.
Install Fedora server2 using ext4, 10GiB as vda2, reboot.
Install Fedora server3 using ext4, 10GiB as vda3, reboot.

After the 3rd installation, grub2 is using /dev/vda3/boot as the configuration.

The entry for server2 and server1 is discovered by os-prober, so they will list below server3 by default.

I can manually edit grub.cfg to adjust the menu orders. But I can see there will be issues:

  • once I do a kernel update, say, in server2, it will run grub2-mkconfig automatically. It should make /dev/vda2/boot as the active configuration source for grub2.

To more consistent / easily managed grub2 booting, personally, I will do:

sda1 - boot shared for all installations
sda2 - server1 rootfs, mount sda1 as /boot and sda5 as /home
sda3 - server2 rootfs, mount sda1 as /boot and sda5 as /home
sda4 - server3 rootfs, mount sda1 as /boot and sda5 as /home
sda5 - home shared for all installations

1 Like

So, you say to have a single /boot partition and set all the distros to use this partition. Right?
Can I do this after the installation?
If not, during the installation, I will choose to not format the /boot partition to be able to see the rest of os, right?

Yes and yes.

As modify /boot partition incorrectly can make your system not bootable. It is advisible to do a trial run inside VM guest before actually doing it on your baremetal, and make sure you have a working LiveUSB on hand just in case anything go wrong.

Yes, do not format will do.