Grub2 menu entries with two distros installed

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
bengateau

Grub2 menu entries with two distros installed

Post by bengateau »

Hi all,

On a newly formatted HD I have first installed Fedora without installing Grub2. After that I have installed Mint 10 together with Grub2. The idea was that Mint will control system loading, and Fedora will only be used occasionally for things like internet banking etc. At the beginning there was one Mint kernel and one Fedora (plus memtest and Mint recovery mode). So far so good. The problem is that after after each kernel update in Fedora, I end up with a new menu entry (currently 3). I think Mint kernel was also updated since the install (currently is 2.6.35-22-generic), but there is only one entry in Grub2 menu (that last one). My question is: how to modify it to have two kernels displayed for each distribution? Current one and the last good one, for both distributions? So I'd like 2 and 2, and at the moment I have 1 and 3 (latter with tendency to grow). I was searching the forum here, but frankly trying to figure out files in /etc/grub.d/ only confused me more.

Thanks, Ben.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
wayne128

Re: Grub2 menu entries with two distros installed

Post by wayne128 »

Well, you have seen how the Grub2 stanza look like.
Mint10 uses Grub2, Fedora uses Grub Legacy.

So here I just show you how Grub legacy stanza look like so you can compare.

First portion is general, colour, splash image, timer etc

timeout 10
color cyan/blue white/blue
foreground ffffff
background 0639a1

gfxmenu /boot/grub/message


Now see how the basic three lines, title line, kernel line and initrd line are required for one OS.

title antiX at hda5, kernel 2.6.32-1-mepis-smp
root (hd0,4)
kernel /boot/vmlinuz-2.6.32-1-mepis-smp root=/dev/hda5 nomce quiet nosplash vga=791
initrd /boot/initrd.img-2.6.32-1-mepis-smp
boot

another example from another OS at different partition

title pclos at hda1
root (hd0,0)
kernel /boot/vmlinuz BOOT_IMAGE=linux root=UUID=69ad8cfe-77b1-4b21-8683-3f92220dfd61 resume=UUID=2e072b68-869a-4355-a780-b0b06853c983 splash=silent vga=788
initrd (hd0,0)/boot/initrd.img

So, if you choose to use Fedora's Grub legacy, then in order to boot another kernel, what is required would be another set of grub legacy stanza with a different kernel version.

Please note that Grub2 and Grub legacy are not compatible with each other, you need to choose one as your 'master boot loader'.
bengateau

Re: Grub2 menu entries with two distros installed

Post by bengateau »

Hi wayne128, thank you for your reply. I know that Grub Legacy is a lot more user friendly then Grub2. But I would prefer to use Grub2 - because Mint uses it, and because I suspect other distros will follow (including Fedora). I just need to take care of the menu screen display. As I installed Fedora without Grub, after the kernel upgrade either Fedora is updating Grub2, or Grub2 is finding new kernel and is adding it to the menu. Which one is it? Does that mean that if I manually remove old Fedora kernel files, old entries will disappear from the menu? I guess I'll try it tonight at home and will update the issue with my findings. If that's successful, the other thing is: how to force Mint to keep the last good kernel on the system and on the menu? I have lots of question marks here don't I? Cheeers, Ben
mick55

Re: Grub2 menu entries with two distros installed

Post by mick55 »

Boot into Mint, open a terminal and run this command

Code: Select all

sudo update-grub
It will find all the additional kernels in both installs and add them to the grub menu.

Grub2 is actually much simpler than grub legacy because it can automatically add new
kernels and distros by using the above command.



mick
bengateau

Re: Grub2 menu entries with two distros installed

Post by bengateau »

Hi mick55, thank you for that! I don't mind removing manually old kernels in Fedora. Now, I still have only one kernel displayed for Mint (one "normal" and one with recovery mode). Is there a way to make Mint keep the last (but only last) old kernel on the system (just in case new kernel breaks somthing)?
Thanks, Ben
seeley

Re: Grub2 menu entries with two distros installed

Post by seeley »

Hi!
In Fedora, it's easy to do:

Code: Select all

su -
Password

Code: Select all

gedit /etc/yum.conf
change "installonly limit 3 -> 2"
seeley
bengateau

Re: Grub2 menu entries with two distros installed

Post by bengateau »

Hi seeley, thanks for that! So I don't have to do this manually, sweet. Is there similar setting in Mint? It seems there is only one kernel installed. Cheers, Ben
seeley

Re: Grub2 menu entries with two distros installed

Post by seeley »

Hi!
Never heard of something similar in Mint, because Mint was the last (and best) distribution I tried.
seeley
Locked

Return to “Installation & Boot”