I have already blogged about multibooting several different Linux distributions with GRUB.
This post is a simplified and updated version of the previous post.
Moreover, I made it easier to test such configurations manually: install several Linux distributions in a single KVM virtual machine.
In this post, I’ll show how to configure GRUB (without os-prober, which doesn’t work well with different Linux distributions like Fedora and Arch) by delegating to other GRUB configurations (i.e., chain loading).
I’ll use Arch EndeavourOS (BTRFS) and Fedora. I’ll show the two possible solutions: EndeavourOS as the main GRUB delegating to Fedora and vice-versa.
First, we need to tweak both distributions’ GRUB configurations.
Preparing EndeavourOS
We must tweak the EndeavourOS GRUB UEFI entry. Otherwise, when trying to boot Fedora, you return to UEFI (this has been a known problem/choice for some time).
The easiest way is to remove the UEFI entry simply:
1 2 |
sudo rm /etc/grub.d/30_uefi-firmware sudo grub-mkconfig -o /boot/grub/grub.cfg |
Or, if you want to keep a backup:
1 2 3 |
mkdir -p ~/tmp/backup-grub sudo mv /etc/grub.d/30_uefi-firmware ~/tmp/backup-grub/ && sudo chown -R bettini:bettini ~/tmp/backup-grub sudo grub-mkconfig -o /boot/grub/grub.cfg |
As a further alternative, if you want to keep the UEFI entry, you must remove the culprit call
1 |
fwsetup --is-supported |
As usual, you must run “grub-mkconfig”.
Preparing Fedora
It’s better to remove os-prober since, as I said above, it wouldn’t work for other Linux distributions, and it takes some time when updating GRUB: edit with sudo the file “/etc/default/grub” and ensure you have this line:
1 |
GRUB_DISABLE_OS_PROBER=true |
Also, ensure you have this line (if you use EndeavourOS as the principal GRUB, otherwise you will not see Fedora entries):
1 |
GRUB_ENABLE_BLSCFG=false |
But then, you’ll have to update GRUB after you install a new kernel. (if you use Fedora as the principal GRUB, the above modification is unnecessary).
Then, run
1 |
sudo grub2-mkconfig -o /boot/grub2/grub.cfg |
Booting EndeavourOS from Fedora
Detect the partition of EndeavourOS, e.g., with “lsblk”. (remember that I’m testing this in a KVM virtual machine where I have installed both distributions; thus, partitions will start with “vd”; they are virtual disks).
1 2 3 4 5 6 7 8 |
bettini@fedora:~$ sudo lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 1024M 0 rom zram0 251:0 0 7.7G 0 disk [SWAP] vda 252:0 0 100G 0 disk ├─vda1 252:1 0 500M 0 part /boot/efi ├─vda2 252:2 0 50G 0 part / └─vda3 252:3 0 49.5G 0 part |
EndeavourOS is in “vda3”.
Edit the file with sudo “/etc/grub.d/40_custom”
Add this entry (for more details on these entries, please see my old post):
1 2 3 4 5 6 7 8 9 |
menuentry "EndeavourOS" { insmod part_gpt insmod btrfs insmod ext2 rmmod tpm set root='hd0,gpt3' set prefix="/@/boot/grub" configfile "${prefix}/grub.cfg" } |
By default, Fedora does not show the GRUB menu, which would break this post’s intent.
To show the grub menu, run:
1 |
sudo grub2-editenv - unset menu_auto_hide |
Update GRUB:
1 |
sudo grub2-mkconfig -o /boot/grub2/grub.cfg |
Reboot the virtual machine configured to start with Fedora, and you’ll see the EndeavourOS entry to boot EndeavourOS (you will get to the EndeavourOS GRUB entries from the Fedora GRUB):
Booting Fedora from EndeavourOS
As done above, inspect the partitions:
1 2 3 4 5 6 7 8 9 10 11 |
[bettini@eos-multi-kvm ~]$ sudo lsblk [sudo] password for bettini: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 1024M 0 rom vda 254:0 0 100G 0 disk ├─vda1 254:1 0 500M 0 part /boot/efi ├─vda2 254:2 0 50G 0 part ├─vda3 254:3 0 49,5G 0 part /var/log /var/cache /home / |
Fedora is in “vda2”:
Edit with sudo “/etc/grub.d/40_custom” and add this entry:
1 2 3 4 5 6 7 |
menuentry "Fedora" { insmod part_gpt insmod btrfs insmod ext2 set root='hd0,gpt2' configfile /boot/grub2/grub.cfg } |
Update GRUB:
1 |
sudo grub-mkconfig -o /boot/grub/grub.cfg |
Reboot the virtual machine to start with EndeavourOS, and you’ll see the Fedora entry to boot Fedora (you will get to the Fedora GRUB entries from the EndeavourOS GRUB):
Final notes
Fedora has its way of updating the system, which requires rebooting, installing updates, reboot again. This process doesn’t work well when Fedora is not the principal booting system; at least, it requires attention to manually select the Fedora entry a few times during this update/booting process. Thus, it’s better to keep Fedora as the principal booting system.