Installing a second Linux distro beside Fedora

I hope it works. Although my installation of workstation 24.04 succeeded without issue. Other than the hardware, another difference (if it is a difference) is that I’m only using a single /boot/efi partition – the one created during the Fedora install.

For the workstation install, I followed the same process as with the server install:
Install Ubuntu
Reboot into Fedora
Set Fedora as default EFI boot entry (via efibootmgr or the UEFI-BIOS Boot Maintenance Manager)
Update Grub (‘grub2-mkconfig -o /boot/grub2/grub.cfg’)
Reboot into Ubuntu
Update Ubuntu (‘apt-get update;apt-get upgrade’)
Reboot and confirm all OS’s are present in the boot menu and bootable.

Good luck!

Fedora does not seem to create a separate /boot when the / partition is ext4.
I believe the /boot as ext4 is a result of using btrfs for / and /home in most fedora installs. The bios reads fat32 and grub can read an ext4 partition but cannot read btrfs without some special configs to load the proper drivers.

No No No

That has not been valid since about fedora 32 (5 years past).
Instead the output file for grub2-mkconfig must be one of (symlinks) /etc/grub2.cfg, /etc/grub2-efi.cfg, or the actual file /boot/grub2/grub.cfg. All ultimately lead to the /boot/grub2/grub.cfg file as output.

Changing the file /boot/efi/EFI/fedora/grub.cfg WILL prevent booting from new kernels when updates occur.

The only reasonable and easy recovery I am aware of is this.

  1. remove both /boot/efi/EFI/fedora/grub.cfg and /boot/grub2/grub.cfg
    sudo rm /boot/efi/EFI/fedora/grub.cfg /boot/grub2/grub.cfg
  2. rebuild both those files properly
    sudo dnf reinstall grub2-common

Using the command you gave breaks automatic updates since the file under /boot/efi is only a pointer to redirect grub to the actual /boot/grub2/grub.cfg file for booting. The file /boot/efi/EFI/fedora/grub.cfg is created during installation and is never again altered during the life of the system.

1 Like

As of the upcoming Fedora 43 you get a new command gen_grub_cfgstub to recreate /boot/efi/EFI/fedora/grub.cfg.

1 Like

Making changed in efibootmgr is unrelaiable for me, each time I try and change the boot order it fails and with every command it throws up errors.

I generally don’t use efibootmgr. Rather I use the tools in the BIOS.

I suggest asking @ernie-07 and/or @computersavvy.

Once again, good luck.

What are those errors? Can you share them?

They might even give some insight into why Ubuntu is having issues with EFI vars.

When I use efibootmgr, this is the output I get:

$ efibootmgr
BootCurrent: 0004
BootOrder: 0004,0005,0000,0001,0002,0003
Boot0000* EFI Virtual disk (0.0)        PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)/SCSI(0,0)
Boot0001* EFI VMware Virtual SATA CDROM Drive (0.0)     PciRoot(0x0)/Pci(0x11,0x0)/Pci(0x2,0x0)/Sata(0,0,0)
Boot0002* EFI Network   PciRoot(0x0)/Pci(0x16,0x0)/Pci(0x0,0x0)/MAC(000c29faa51b,1)
Boot0003* EFI Internal Shell (Unsupported option)       MemoryMapped(11,0xefe6018,0xf3f5017)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
Boot0004* Ubuntu        HD(1,GPT,0df70f86-f259-41ea-b3ff-7f39d580a882,0x800,0x190000)/\EFI\ubuntu\shimx64.efi
Boot0005* Fedora        HD(1,GPT,0df70f86-f259-41ea-b3ff-7f39d580a882,0x800,0x190000)/\EFI\fedora\shimx64.efi

and:

$ efibootmgr --bootorder 0005,0004,0000,0001,0002,0003
BootCurrent: 0004
BootOrder: 0005,0004,0000,0001,0002,0003
Boot0000* EFI Virtual disk (0.0)        PciRoot(0x0)/Pci(0x15,0x0)/Pci(0x0,0x0)/SCSI(0,0)
Boot0001* EFI VMware Virtual SATA CDROM Drive (0.0)     PciRoot(0x0)/Pci(0x11,0x0)/Pci(0x2,0x0)/Sata(0,0,0)
Boot0002* EFI Network   PciRoot(0x0)/Pci(0x16,0x0)/Pci(0x0,0x0)/MAC(000c29faa51b,1)
Boot0003* EFI Internal Shell (Unsupported option)       MemoryMapped(11,0xefe6018,0xf3f5017)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
Boot0004* Ubuntu        HD(1,GPT,0df70f86-f259-41ea-b3ff-7f39d580a882,0x800,0x190000)/\EFI\ubuntu\shimx64.efi
Boot0005* Fedora        HD(1,GPT,0df70f86-f259-41ea-b3ff-7f39d580a882,0x800,0x190000)/\EFI\fedora\shimx64.efi

I don’t get any errors and the above ‘efibootmgr --bootorder’ command seems to do the trick without issue and makes Fedora the default boot item.

The above, followed by:

$ grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found Ubuntu 24.04.3 LTS (24.04) on /dev/sda5
Adding boot menu entry for UEFI Firmware Settings ...
done

Seems to update the grub menu with the relevant Ubuntu entries:

Please do post the efibootmgr errors you see. As I mentioned, they may shed some light on the ubuntu install issues.

I can delete boot entries but anything else I keep getting invalid argument whenever I try and execute a command.

Delete:

Reorder:

Do you have Secure Boot enabled? I ran across this:

and it sounded familiar. I’d note that in my testing, I did not enable secure boot. I’ll try that and see if I can replicate your results.

Yes I have secure boot enabled on my machine. My understanding is that Ubuntu can be installed with secure boot enabled, and this is how I installed it on my other desktop with Windows.

Absolutely. I didn’t expect otherwise. The reason I brought it up was that the issues you’re having with Ubuntu installation and efibootmgr errors both seem to reference “invalid argument” WRT EFI variables.

If secure boot isn’t the issue, then perhaps it’s an issue with the BIOS firmware?

Are you able to modify the EFI boot configuration from the system BIOS menus? Do you have the latest BIOS for your system/motherboard installed?

This doesn’t seem to be a Fedora problem per-se, but it certainly would be nice to identify the cause and (hopefully) a successful resolution. For you, of course, but also for others who may have similar issues.

I’m reinstalling Fedora and Ubuntu from scratch on a VM with Secure Boot enabled, but I don’t expect to have an issue.

Perhaps there’s some info out there that’s specific to your hardware that might be useful/interesting?

Unsurprisingly, I was able to install Fedora and Ubuntu with secure boot enabled.

However, the only way I was able to use a second /boot/efi partition was to remove the boot and esp flags from the /boot/efi used by Fedora and apply those (which I’d tried to do before, but I was unable to deselect the Fedora partition during Ubuntu install) same flags to the new /boot/efi partition.

That allows me to have multiple /boot/efi partitions (one for Fedora and one for Ubuntu) on the same physical disk, but (unsurprisingly) I am unable to boot Ubuntu from the Fedora grub menu and am unable to boot Fedora from the Ubuntu grub menu.

Which argues for using a single /boot/efi partition per physical disk.

Sadly, I wasn’t able to replicate the install issues you’re having. As such, I’ll reiterate my suggestion that you install Ubuntu on a separate disk and select which you boot from the UEFI boot manager.

I hope you’re able to resolve this to your satisfaction, but I’m not sure what else I can add.

Boot and ESP flags should be set to indicate that a FAT partition is an ESP. I have never had a problem using a single ESP/OS installation. Perhaps this is because I create, format and label partitions and set the boot and esp flags on the ESP before I begin an installation using the custom option where I can select Standard.

I have never had an issue with multiple ESP partitions on a single drive, and with them (both or all) with the boot and ESP flags.

When you boot fedora it cannot find and boot the ubuntu system since it is not marked bootable. As I understand it ubuntu does not search for nor configure booting the fedora system.

Use a tool such as gparted or similar to make sure both ESPs are marked bootable then run sudo grub2-mkconfig -o /boot/grub2/grub.cfg to ensure that grub can find the ubuntu system for booting. You can use efibootmgr to set the fedora system as default booting if you choose.

1 Like

Yep. That’s exactly what I did. And with a single /boot/efi partition in place, with the grub configuration it works nicely. With multiple /boot/efi partitions it does not, regardless of which installation (Fedora/Ubuntu) I use to manage grub. In each case, I get the same error no matter how many times I run grub2-mkconfig on either installation.

Both say they’ve found the other installation, but when attempting to boot Fedora from the Ubuntu grub menu, or attempting to boot Ubuntu from the Fedora grub menu, I get the same error:

That said, if I disable secure boot, both grub menus will boot the other OS just fine. Unfortunately, OP has secure boot enabled. As such, it doesn’t fit their use case.

I’d note that if I use the UEFI boot manager to select which to boot, then select that installation from the menu, everything works properly.

Please note that I experienced the above while attempting to re-create OP’s issues. I referenced it here to assist OP in case they ran in to similar problems.

But in order to even have both partitions (as I explicitly said) used, I had to remove the flags from the extant Fedora /boot/efi partition, or the Ubuntu Installer (didn’t try with Fedora as it’s not OP’s use case) would refuse to use the one created specifically for it. Once I was able to install Ubuntu, I added the boot and esp flags back to the “fedora” /boot/efi partition.

But those aren’t OP’s issues anyway, as they don’t seem to be able to install Ubuntu at all.

I don’t really have anything additional to offer in resolving the actual issues help was requested around, as I was unable to replicate the issues OP experienced.

Hopefully OP will get some resolution, whether that’s installing ubuntu on the same disk as their Windows and Fedora installations, or by installing ubuntu on a separate drive.

Yep. That’s what I expected as well. However, the Ubuntu Installer insisted on using the /boot/efi from the existing Fedora installation, even though I set the boot and esp flags on the second partition specifically created, formatted and labeled (which I did for all three partitions slated for the Ubuntu install) prior to attempting installation.

Until I removed the boot and esp flags from the first installation (Fedora), the Ubuntu Installer insisted on including that partition and using it as the /boot/efi partition, even though I’d created a separate one with the correct flags, FS type and mount point.

Once I removed the boot and esp flags from the “Fedora” /boot/efi partition (and yes, all the partitions created for both OS’s were primary partitions), the Ubuntu installer used the /boot/efi partition configured specifically for that that installation.

After installing Ubuntu, I set the boot and esp flags on the “Fedora” /boot/efi partition. Now both work separately (booting from the UEFI item for “Fedora” will successfully boot Fedora but not Ubuntu and vice versa), but neither one can manage the other, I just get the following error when I try to boot Fedora from the Ubuntu-managed grub (and the same error when trying to boot Ubuntu from the Fedora-managed grub):

And yes, I did use grub2-mkconfig -o /boot/grub2/grub.cfg (in Fedora) and update-grub (in Ubuntu).

However, if I disable secure boot, those error messages go away and both grub menus boot the other OS without issue.

Unfortunately, that’s not OP’s use case, as they do have secure boot enabled.

If you want to enable secure boot, you would need to install the secure boot certificate from the other OS in the MOK using mokutil. That is because the Ubunto shim doesn’t allow the Fedora kernel to be loaded and the Fedora shim doesn’t allow the Ubunto kernel to be loaded.

That problem goes away if you use the UEFI boot menu to select which OS to boot.

And it doesn’t matter if you share the ESP file system or not, as each OS has their own subdirectory to keep thing separate. The only case where a shared ESP is a problem is when you have two Fedora systems as they would use the same subdirectory.

I like the idea of each OS having it’s own entire disk, and installed without knowing of the other disk/OS. Completely avoids stuff like Windows potentially making Linux unbootable with an update, and…

Avoids that as an issue by having Fedora and Ubuntu have independent GRUBs :stuck_out_tongue:

I should have added that the Ubunto shim doesn’t allow the Fedora grub loader to be loaded as the Fedora grub loader is not signed by the Ubuntu certificate baked into the Ubunto shim.

(post deleted by author)