Multi-boot Done Right

Hi all - new to fedora here. I currently have a T480s thinkpad dual-booted with Windows 10 and Linux Mint. I’d like to add Fedora 40 as another boot option. I’ve created my Fedora live USB and successfully booted it to see my hardware generally works fine. And I also shrunk the Windows partition so that I have ~70GB of unallocated disk space.

Before I actually install though, I’m a little nervous about how the Fedora bootloader and Mint bootloader may break each other. Who is going to take priority here and how do I make sure I handle this properly? Is it correct that Fedora, being my most recent install, will essentially take precedent and recognize the other 2 Operating Systems as options?

Many thanks,
Owlerphant

Welcome to Fedora @owlerphant

Theoretically you can just install Fedora and it should include all three Operating Systems. If happens something and you mess your system up, have a look on the LinuxMint link to see what the differences are how they manage the grub2 boot manager:

(SOLVED) Adding menuentry lines into Linux Mint GRUB - Linux Mint Forums

If you have a powerful computer with enough ram, you could save the headache about multi booting and use virtual machines to have multiple OS es installed. This would have the advantage, that you can let run more then one os at once.

Here a Link how to install it on LinuxMint:
https://techviewleo.com/how-to-install-kvm-on-linux-mint/

I’m not sure on how priority would be handled there, but I prefer multi-boot with dedicated disks so that every OS has its own self-contained boot/EFI partitions without need of messing with another’s.

Windows can fluff-up its own EFI on updates, Mint can keep it’s (likely) older GRUB stuff, and Fedora can do expected stuff on its own boot files. In this case I would set Fedora’s GRUB to the primary BIOS boot drive, and let Fedora’s GRUB probe for other operating systems and add them to its GRUB list. From there, you can choose Fedora, Mint (allowing its own boot/kernel options and expected GRUB), or Windows (to do GRUB → Windows bootloader)

Having 3 separate drives on a laptop is probably its own adventure :stuck_out_tongue: (I had an Acer predator that allowed 2 NVMes nicely and a SATA)

Added boot, dual-boot, triple-boot

Thanks for your replies. Long story short, I took the plunge and installed Fedora 40 Workstation. And I think I fell into the same problem as the poor sap in the linked Linux Mint forum.

Mint does not boot up. I show 5 different versions of Linux Mint in the selection menu but they all throw the following error:

error: …/…/grub-core/kern/efi/sb.c:182:bad shim signature.
error: …/…/grub-core/loader/i386/efi/linux.c:258:you need to load the kernel first.

Fedora does boot up, BUT if I choose Mint from the list first and throw the above error, and then select Fedora, Fedora also throws an error. At least it did this once. I will need to reboot again to recreate that one and confirm whether it is the same error as above.

From the linked Mint forum, it seems I just need to disable the CSM flag in BIOS so that my Fedora USB stick boots in UEFI and then re-install. We shall see. but I am going to have to go do some dad stuff for a few hours first. So if anyone has great alternatives to this path, it’s not to late to steer me in the right direction! :smiley:

Well, my plot thickens a bit. According to the Mint thread linked above, the issue was that the Fedora live USB booted in the old (EFI) mode and thus installed that way. Alas, when I went into my bios, CMS is disabled and only UEFI is accepted. That being said, when I enter efibootmgr into a terminal, the files listed next to both Ubuntu and Fedora end *.efi.
When I open GParted, here’s what I show:

It seems I need to better understand this EFI vs UEFI and what it’s doing to the Linux partitions on my machine (both Fedora and Mint).

EFI and UEFI are different ways of saying almost the same thing. UEFI is the actual bios used while EFI usually refers to the files and partition necessary for the boot loaders.

That image really does not assist us, though it does only show one efi partition nvme0n1p1 and that is only 100MB in size. Since you are triple booting we really need to know how much free space is available and how things are mounted.
Please post the result of df -h and lsblk -f as text that you copy & paste using the preformatted text button </> on the toolbar so the text remains readable.

It seems quite possible that the efi partition may be too small for triple booting and possibly should be expanded. Fedora by default now creates a 600MB efi partion. Even newer versions of windows create an efi partition of ~250MB size.

Thanks Jeff, I appreciate your help. Here is df -hresult:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  2.2M  1.6G   1% /run
efivarfs        154K   76K   74K  51% /sys/firmware/efi/efivars
/dev/nvme0n1p5   98G   34G   59G  37% /
tmpfs           7.7G  8.0K  7.7G   1% /dev/shm
tmpfs           5.0M   20K  5.0M   1% /run/lock
/dev/nvme0n1p1   96M   50M   47M  52% /boot/efi
tmpfs           1.6G   23M  1.6G   2% /run/user/1000

and here is lsblk -f:

NAME FSTYPE FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                            
sdb                                                                            
sdc                                                                            
nvme0n1
                                                                               
├─nvme0n1p1
│    vfat   FAT32 SYSTEM   9026-46FA                              46.6M    51% /boot/efi
├─nvme0n1p2
│                                                                              
├─nvme0n1p3
│    ntfs         Windows  5A4E2A3E4E2A1375                                    
├─nvme0n1p4
│    ntfs         Recovery FE242ADB242A96A5                                    
├─nvme0n1p5
│    ext4   1.0            be37954b-8dbe-4dad-a19e-a7ab27729c66   58.4G    35% /
├─nvme0n1p6
│    ext4   1.0            0ecd31c9-33d4-49e4-bced-35e1812bd020                
└─nvme0n1p7
     btrfs        fedora   8b7390f8-4a06-4046-ae49-7a7e8bd2fa2e                

I should have also said that I was on Mint when I ran those commands.

Is going back likely easier than fixing at this point? What about deleting the fedora partition entirely (from mint)? And then trying again more carefully (whatever that would look like).

That is expected, and it just means you should turn off secure boot. Each linux distribution with secure boot supported comes with their own shim with their own key. If you can find the Mint secure boot key, you can enroll that and you can boot the mint system.

If you can boot starting with the Mint shim, you can extract the key using mokutil --export. Bring the key to the Fedora system and enroll the key in the normal way. If the export produced more than one key file, use mokutil --list-enrolled to determine which is which. The one you want should normally be MOK-0001.der.

2 Likes

I wrote this

I’ve also used that for Ubuntu.

2 Likes

That output from lsblk seems to indicate that fedora probably uses nvme0n1p1 for efi, nvme0n1p6 for /boot, and nvmd0n1p7 for the main / and /home file systems.

It is a given that by default when booting 2 different linux OSes that only one is going to control the grub boot. Fedora usually is able to detect and boot most other systems but the other systems seldom are able to boot fedora by default. The others usually require manual config of grub for booting fedora.

I think that to your recovery of fedora booting may involve booting to the install media as a live system then performing the recovery steps using a chroot environment. Those steps are not usually difficult but are a little detailed.

Note that fedora uses by default a btrfs file system while most other linux systems use ext4 file systems.

My understanding is that EFI was the original version without secure boot, for example, and based on that the Universal EFI was created as UEFI.

thanks Villy, Lorenzo,

I’m able to export the MOK-0001.der file in Mint. In reading Lorenzo’s linked blog post, I’m speculating that this is how to “enroll the key in the normal way” as Villy stated. In all honesty this stuff is outside my knowledge base.

I believe, based on what you’re telling me, it will be most effective to have Fedora as the principal booting system. So that’s what I’m going to try to do to solve the problem.

Is this the right path?

  1. “Prepare Mint” by following Lorenzo’s steps he outlines as “Prepare Endeavor OS”
sudo rm /etc/grub.d/30_uefi-firmware
sudo grub-mkconfig -o /boot/grub/grub.cfg
  1. disable OS prober in Fedora
GRUB_DISABLE_OS_PROBER=true
  1. Update GRUB in Fedora (is this necessary?)
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  1. Edit the Mint entry in Fedora’s file “/etc/grub.d/40_custom”

As I’m not in Fedora as I type this, I’m not able to pull that up and inspect how it connects to Lorenzo’s detailed and helpful blog posts. But I’m having trouble connecting these ideas to Villy’s comment and the MOK-0001.der file. What am I missing?

Many thanks,
Owlerphant

This might not be required in Ubuntu and Mint, it’s related to the recent version of grub used by Arch distros. You can try without that step and see if it works anyway.

I think I’m close here, but could use some expert eyes to make sure my entry into the “/etc/grub.d/40_custom” file.

Here is what I get back from lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    1     0B  0 disk 
sdb           8:16   1     0B  0 disk 
sdc           8:32   1     0B  0 disk 
zram0       252:0    0     8G  0 disk [SWAP]
nvme0n1     259:0    0 238.5G  0 disk 
├─nvme0n1p1 259:1    0   100M  0 part /boot/efi
├─nvme0n1p2 259:2    0    16M  0 part 
├─nvme0n1p3 259:3    0  68.7G  0 part 
├─nvme0n1p4 259:4    0     2G  0 part 
├─nvme0n1p5 259:5    0  99.3G  0 part 
├─nvme0n1p6 259:6    0     1G  0 part /boot
└─nvme0n1p7 259:7    0  67.4G  0 part /home

Windows 10 is n1p3
Fedora is n1p7
Mint is n1p5

Is the following correct?

menuentry "Linux Mint" {
        insmod part_gpt
        insmod btrfs
        insmod ext2
        rmmod tpm
        set root='hd0,gpt5'
        set prefix="/@/boot/grub"
        configfile "${prefix}/grub.cfg"
}

menuentry "Windows 10" {
        savedefault
        insmod part_gpt
        insmod fat
        set root=(hd0,gpt1)
        chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

With that, if I disable the Fedora OS prober and then update the Grub like so:

GRUB_DISABLE_OS_PROBER=true
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

I should be good to go?

I REALLY appreciate the time and advice you are giving me. This is way beyond my knowledge base, and learning like this is a big chunk of the fun of Linux for me.

Thanks,
owlerphant

/@/… is when the filesystem is btrfs. Is this the case for Linux Mint?

No, Mint is using ext4 file system. So its entry should be…this?

menuentry "Linux Mint" {
        insmod part_gpt
        insmod btrfs
        insmod ext2
        rmmod tpm
        set root='hd0,gpt5'
        set prefix="/boot/grub"
        configfile "${prefix}/grub.cfg"
}```

That looks correct

I made the changes but am getting an error. When I choose Linux Mint from the menu (the entry we created), it simply reloaded the grub menu over and over. I thought that may be because of the 30_uefi-firmware file, so I removed it and updated grub in Mint and tried again. No luck.

But after selecting Linux Mint in the grub menu, if I then select fedora I get the following error:

error:  ../../grub-core/net/net.c:1552:disk 'hd0,gpt5' not found
error:  ../../grub-core/loader/i386/efi/linux.c:258:you need to load the kernel first

I also get essentially that error, but for “gpt1” when I try to load the Windows 10 entry.

So it seems I have a syntax error in the way I’m setting the root in the 40_custom file. I also tried changing the 40_custom file menuentry to look like your entries of Kubuntu (and EndeavorOS) in your “old post”, in line with your feedback that I shouldn’t be using the btrfs file system entries. So I eliminated the prefix variable, gave the full path name for the config file, and updated grub. No change in behavior. The good news there is that Mint still boots when I choose it from the computer BIOS menu. So it is working fine.

Any ideas why it doesn’t like the root definitions in the menu entries?