LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   GRUB not finding 2nd instance of Fedora for multi-boot (https://www.linuxquestions.org/questions/fedora-35/grub-not-finding-2nd-instance-of-fedora-for-multi-boot-4175736837/)

jonrpick 05-08-2024 08:49 PM

GRUB not finding 2nd instance of Fedora for multi-boot
 
I have two separate instances of Fedora 40 installed (Xfce and KDE) on a drive with several partitions. The reason why is, it's a low-spec laptop, and I wanted to minimize any additional "fluff" on each installation. I was trying not to have multiple DEs installed on the same OS installation.

Xfce was installed first, and worked great. Then I altered the partition sizes, created new ones and installed the KDE spin of F40.

Now, there are no GRUB entries for the Xfce spin--only three for KDE (latest and previous kernel + recovery).

I've tried running os-prober, which does find the Xfce version:

Code:

$ sudo os-prober
/dev/sda3:Fedora Linux 40 (Xfce):Fedora:linux:btrfs:UUID=a5807fe9-f2f6-42b3-b8a2-e0b7ea03bdf0:subvol=root00

Then...

Code:

$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file ...
Found Fedora Linux 40 (Xfce) on /dev/sda3
Adding boot menu entry for UEFI Firmware Settings ...
done

However when I run the following:
Code:

$ sudo cat /boot/efi/EFI/fedora/grub.cfg
grub.cfg does not show the Xfce in the os-prober section:

Code:

### BEGIN /etc/grub.d/30_os-prober ###

### END /etc/grub.d/30_os-prober ###

If I have to give up one or the other, I'd rather have access to the Xfce installation. It "just worked" and the KDE installation is shaky at best on this low-powered laptop. The KDE installation was installed just to see how it would perform, whereas the Xfce installation was set up to my liking.

What am I doing wrong here?

Thanks in advance...

frankbell 05-08-2024 09:02 PM

Have you tried running update grub?

jonrpick 05-08-2024 09:18 PM

Quote:

Originally Posted by frankbell (Post 6500618)
Have you tried running update grub?

"update-grub" does not exist in Fedora.

The article you linked lists:

Code:

sudo grub-mkconfig -o /boot/grub/grub.cfg
Which is the Fedora version of "update-grub"

Code:

$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
I'm getting the same result, either way...

colorpurple21859 05-08-2024 09:20 PM

set GRUB_ENABLE_BLSCFG=false in /etc/default/grub and rerun grub2-mkconfig

jonrpick 05-08-2024 09:42 PM

Quote:

Originally Posted by colorpurple21859 (Post 6500623)
set GRUB_ENABLE_BLSCFG=false in /etc/default/grub and rerun grub2-mkconfig

That did...something.

Code:

$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Now showed this:

Code:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.8-300.fc40.x86_64
Found initrd image: /boot/initramfs-6.8.8-300.fc40.x86_64.img
fgrep: warning: fgrep is obsolescent; using grep -F
Found linux image: /boot/vmlinuz-6.8.5-301.fc40.x86_64
Found initrd image: /boot/initramfs-6.8.5-301.fc40.x86_64.img
fgrep: warning: fgrep is obsolescent; using grep -F
Found linux image: /boot/vmlinuz-0-rescue-a07923d2c524436688708621f98c6e90
Found initrd image: /boot/initramfs-0-rescue-a07923d2c524436688708621f98c6e90.img
fgrep: warning: fgrep is obsolescent; using grep -F
Found Fedora Linux 40 (Xfce) on /dev/sda3
Adding boot menu entry for UEFI Firmware Settings ...
done

It found the Xfce installation...

Booting now looks a bit different. My GRUB options are Fedora, Advanced options and UEFI. Advanced Options lists the same two kernels and a recovery, but all three entries now have a separate recovery option.

But still no Xfce option. :scratch:

colorpurple21859 05-09-2024 05:00 AM

have this in /etc/default/grub, and rerun grub2-mkconfig

Code:

GRUB_DISABLE_OS_PROBER=false

jonrpick 05-09-2024 05:06 PM

Quote:

Originally Posted by colorpurple21859 (Post 6500658)
have this in /etc/default/grub, and rerun grub2-mkconfig

Code:

GRUB_DISABLE_OS_PROBER=false

Done... I am still not sure which grub.cfg file is being used by GRUB, so I've been building both /boot/grub2/grub.cfg and /boot/efi/EFI/fedora/grub.cfg

I've always run os-prober beforehand. When I run 'cat' on either file and examine the contents, the Xfce option isn't listed.

jonrpick 05-09-2024 05:19 PM

Code:

$ sudo grep menuentry /boot/grub2/grub.cfg
yields

Code:

menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-simple-c20285c1-ed0d-4e74-992e-1f703981f455' {
submenu 'Advanced options for Fedora' $menuentry_id_option 'gnulinux-advanced-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'Fedora Linux (6.8.8-300.fc40.x86_64) 40 (KDE Plasma)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.8.8-300.fc40.x86_64-advanced-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'Fedora Linux (6.8.8-300.fc40.x86_64) 40 (KDE Plasma) (recovery mode)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.8.8-300.fc40.x86_64-recovery-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'Fedora Linux (6.8.5-301.fc40.x86_64) 40 (KDE Plasma)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.8.5-301.fc40.x86_64-advanced-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'Fedora Linux (6.8.5-301.fc40.x86_64) 40 (KDE Plasma) (recovery mode)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.8.5-301.fc40.x86_64-recovery-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'Fedora Linux (0-rescue-a07923d2c524436688708621f98c6e90) 40 (KDE Plasma)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-a07923d2c524436688708621f98c6e90-advanced-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'Fedora Linux (0-rescue-a07923d2c524436688708621f98c6e90) 40 (KDE Plasma) (recovery mode)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-a07923d2c524436688708621f98c6e90-recovery-c20285c1-ed0d-4e74-992e-1f703981f455' {
        menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {

Edit: It may be of interest to note that in the UEFI boot menu, there are two Fedora options, and both boot to KDE. No other options are available.

yancek 05-09-2024 06:34 PM

Was the installation of the XFCE version of Fedora an EFI install? If it was a Legacy install and is on the same drive it probably won't boot from an EFI Grub.

What happens when you run: sudo grub2-mkconfig /boot/grub2/grub.cfg
The grub.cfg file generally used on most Linux systems with this command is the one in the /boot/grub2 directory and the grub.cfg file on the EFI partition generally points to this main grub.cfg file which contains the menuentries. You might take a look at the link below to the FedoraProject. I don't use Fedora so don't know what changes they make to Grub.

https://fedoraproject.org/wiki/GRUB_2

colorpurple21859 05-09-2024 10:23 PM

Assuming /dev/sda2 is the boot partition for the xfce fedora add this to /etc/grub.d/40_custom:
Code:

menuentry 'fedora xfce' {
set root=(hd0,2)
configfile /grub2/grub.cfg
}

The other changes you made to /etc/default/grub can be reverted if you so desire.
rerun grub2-mkconfig

jonrpick 05-10-2024 04:33 PM

Quote:

Originally Posted by colorpurple21859 (Post 6500807)
Assuming /dev/sda2 is the boot partition for the xfce fedora add this to /etc/grub.d/40_custom:
Code:

menuentry 'fedora xfce' {
set root=(hd0,2)
configfile /grub2/grub.cfg
}

The other changes you made to /etc/default/grub can be reverted if you so desire.
rerun grub2-mkconfig

This worked! I chose the Xfce option and it then went to a sub menu listing the installed kernel versions as well as a recovery option.

I'm just curious as to why the Xfce wouldn't appear otherwise.

colorpurple21859 05-10-2024 08:09 PM

Grub has problems picking up other distros kernels that have a btrfs file system. I think it has something to do with how the files are organized on a btrfs partition. The sub menu listing is the grub.cfg of the other installed fedora system.

jonrpick 05-11-2024 12:26 PM

Quote:

Originally Posted by colorpurple21859 (Post 6501005)
Grub has problems picking up other distros kernels that have a btrfs file system. I think it has something to do with how the files are organized on a btrfs partition. The sub menu listing is the grub.cfg of the other installed fedora system.

Oddly, while booted into Xfce, The Xfce options do not exist when I look at Grub in grub customizer...

colorpurple21859 05-11-2024 03:57 PM

Quote:

Oddly, while booted into Xfce, The Xfce options do not exist when I look at Grub in grub customize
I think that is because fedora uses something called BLSCFG where grub references config files in /boot/loader/entries to produce grub default menu entries

before running grub-customizer so grub-customizer will pick up the other fedora mount it with a command similar to this:
Code:

mount /dev/sda3 -t btrfs -o subvol=root00,compress=zstd /mnt
will need to edit the entry and add this as a kernel option
Code:

rootflags=subvol=root00
change root00 if needed to match the root subvolume and sda3 to match the system partition you are attempting to add a grub menu.


All times are GMT -5. The time now is 07:52 PM.