Dual boot has unexpected results: Debian 11.4.0 and Fedora 36.1.5

I did a clean install of Debian 11.4.0 first. The layout was as follows:

The first partition has a size of 550MB, mount point is EFI System Partition (abbreviated by Debian as ESP)

The second partition has a size of 500MB, mount point is /boot

The third partition is a LUKS-encrypted volume group of 31GB size. The volume group consists of two partitions: one has a size of 1GB and is mounted as swap area while the second one has a size of 30GB and is mounted as /

Installation was successful.

I rebooted my machine.

Next, on the remaining free space of the SSD, I did a clean install of Fedora using the file called Fedora-LXQt-Live-x86_64-36-1.5.iso.

I used Blivet-GUI to partition the remaining free space as follows:

1GB that is LUKS-encrypted and mounted as swap

27GB that is LUKS-encrypted and mounted as /

When I clicked the Done button, the installer complained that I did not set the EFI partition. I don’t know why it complained because I had created an ESP during installation of Debian, didn’t I? Couldn’t Fedora make use of the Debian’s EFI partition since both of them are Linux distros? Can’t Fedora and Debian co-exist peacefully?

In the end, I had to click on Debian’s created ESP and mounted it as /boot/efi (per Fedora installer).

I pressed the Done button and the Fedora installer complained again. This time, my mea culpa was that I had failed to create a partition and mounted it as /boot. It was obvious to me by then that Fedora could not live in harmony with Debian. Well, I clicked on Debian’s created /boot partition and mounted it as /boot (per Fedora installer). It complained again, telling me that I should create a new partition and mounted it as /boot. I simply ignored the warning and pressed Done.

Installation was successful and I rebooted my machine.

What I was not prepared for was that the Fedora’s GRUB menu did not and does not contain an entry for me to boot into Debian. Why is that? To boot into Debian I need to access the UEFI BIOS and list Debian as the first to be booted. Similarly if I wish to boot into Fedora, I have to choose Fedora as the first item in the boot configuration within UEFI BIOS.

My purpose here is to learn from you guys how to include the names of both Linux distros in the GRUB menu for me to boot into either one of them easily. (compare my experience with the dual boot of Debian and Microsoft Windows: The GRUB menu of Debian lists Microsoft Windows as an entry. The same goes for the dual boot of Fedora and Microsoft Windows, again based on my personal experience.)

Thanks for reading this rather long post and I appreciate your help in this matter.

Since you used the bliviet partition selection you had to explicitly tell fedora to use that partition as /boot/efi.

Once you do that I think it will find the debian info and configure it (though since I do not use debian I cannot be sure)

Also, I believe it is cleaner if you use a separate /boot for each distro. They share the efi partition, but like separate /boot partitions.

1 Like

I did that (as stated in my original post (see my statement " In the end, I had to click on Debian’s created ESP and mounted it as /boot/efi (per Fedora installer).")

No, as stated in my original post, Fedora’s GRUB can’t find Debian’s info. That’s the reason I posted in AskFedora for help.

I took your advice and reinstalled Debian first and followed by Fedora. Using Fedora installer, I used Blivet-GUI to create a separate partition of file system ext4 and mounted it as /boot. Installation of Fedora was successful.

Upon reboot, the entry for Debian does not show up in Fedora’s GRUB bootloader menu.

I appreciate your additional input regarding this issue.

Does the Debian one show up as a separate EFI entry in your BIOS boot menu?

This is one recent discussion about dual booting fedora & debian.
https://forums.debian.net/viewtopic.php?f=30&t=152451

I seem to recall a recent discussion on this and that it may be necessary to create a custom menu entry in /etc/grub.d/40_custom to add debian to the fedora grub menu.

Which BIOS boot menu? Fedora’s or Debian’s?

Thanks for bringing it to my attention. However the original poster had installed Fedora first followed by Debian. It is the opposite of what I did.

By the way I learned something when I was solely using Microsoft Windows. According to Microsoft, in a multi-boot scenario, users should always install older versions of Windows first followed by the latest version, for example, install Windows 10 first, then Windows 11, then Windows 12, etc…

I followed Microsoft’s advice and installed Debian (stable) 11.4.0 first followed by Fedora 36.1.5.

Could you give me a sample of such a custom menu please? What should I name the custom menu? is there a default name?

Thanks for your help.

While I do not have debian installed so I cannot give you exactly what is needed, you can look at the content of /boot/grub2/grub.cfg and you may see several ‘menuentry’ stanzas that the system creates for grub menus.

You can use one of them as an example and modify it as needed for debian on your system to create a ‘menuentry’ stanza in /etc/grub.d/40_custom. If you create it properly then run grub2-mkconfig -o /boot/grub2/grub.cfg it should show up as an entry in the grub menu the next time you reboot and you can then boot debian from the fedora grub menu.

Looking at the debian boot loader files may assist in identifying exactly what would be needed.

My version is

#!/usr/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'SecondDisc' --class gnu-linux --class gnu --class os $menuentry_id_option 'Second-Disk'
{
    search --no-floppy --fs-uuid --set root be7e5f09-c8fc-4e64-addd-ddda9478b5f2
    configfile ($root)/grub2/grub.cfg
}

The uuid “be7e5f09-c8fc-4e64-addd-ddda9478b5f2” is the uuid of the /boot file system on the other OS. You can find it using lsblk -f. Whether it works for you I can’t tell as there are so many details which could make it not work.

I found a file on the internet whose contents are as follows:

menuentry 'Ubuntu or KDE Neon' --unrestricted {
        savedefault
        search --fs-uuid --no-floppy --set=AAEE-A568
        chainloader /EFI/ubuntu/shimx64.efi
        boot
}
menuentry 'Fedora' --unrestricted {
        savedefault
        search --fs-uuid --no-floppy --set=AAEE-A568
        chainloader /EFI/fedora/shimx64.efi
        boot
}
menuentry 'Windows' --unrestricted {
        savedefault
        search --fs-uuid --no-floppy --set=AAEE-A568
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
        boot
}

It was recommended that I was to name it custom.cfg and place it in the same directory as grub.cfg.

Jeff, what do you think?

Thanks for your help.

You mean I should type the command in a Fedora terminal, yes?

Will you script run automatically every time I launch Fedora? Or do I need to type unique commands before Fedora’s GRUB menu appears on my screen?

Neither. The example was given in the context of what Jeff wrote

I seem to recall a recent discussion on this and that it may be necessary to create a custom menu entry in /etc/grub.d/40_custom to add debian to the fedora grub menu.

Se my version is the modified /etc/grub.d/40_custom. And like any other files in /etc/grub.d it will be used when running grub2-mkconfig. The example is given as an example only and should only be used as inspiration for your own solution.

Possibly if you put this into the 40_custom file and modify it as needed for debian it would work.

The UUID used for the --set in the search line is that of the efi partition in that example. I don’t know which UUID is needed since I have not tried anything like that.

I do know that (since I have seen it before) was intended to replace the default grub menu totally, but you only need to add the menuentry line for your debian system install since fedora builds the rest of the grub menu for you.

I blogged about multi booting, in case it helps

2 Likes

suggest that you install refind efi boot manager

refind isn’t available in the official repos, yes?

It is available from the official rEFInd download page

No, you can’t get if from any Fedora repository. And do study the documentation that comes with it before installing it.

If it works I don’t know. I will not install it on my system to try it out.

It works well and is easy to setup. I use it on several machines.
https://www.rodsbooks.com/refind/

Do read the documentation. It is really important to understand uefi, but most are never exposed to it. Rod’s pages provide great background as well as covering a variety of installation scenarios.

Also consider creating a rEFInd bootable USB flash drive.

It requires me to disable Secure Boot, is that correct?

Professor,

Thanks for taking the time to let me know of your work.

Your method requires me to disable Secure Boot, yes?