Dual boot 2 Fedora Kinoite on one disk

Hi

I am trying to make a dual boot system with 2 Fedora Kinoite installed. Following advice from this topic (Dual boot between 2 Silverblue: problem with grub + composefs and EFI) I have created the following composition: 2 /boot/efi, 2 /boot and 2 /root - one for each system.

Now, I can’t load the first system.
The problem is: the first EFI partition is still loading the second system

What I have already tried:

  1. Adding entries to efibootmgr manually - no effect, all the entries are booting the second system
  2. Adding entry to grub - couldn’t do it due to problem with composefs
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
/usr/bin/grub2-probe: error: failed to get canonical path of `composefs'.
  1. I’ve tried using rEFInd - it still didn’t detect my first system

Here is some info about my system (I am booted from the second one, the first three are respectively efi, boot and root partitions from my first system):

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
zram0       251:0    0     8G  0 disk [SWAP]
nvme0n1     259:0    0 931.5G  0 disk 
β”œβ”€nvme0n1p1 259:1    0   600M  0 part 
β”œβ”€nvme0n1p2 259:2    0     2G  0 part 
β”œβ”€nvme0n1p3 259:3    0   200G  0 part 
β”œβ”€nvme0n1p4 259:4    0   900M  0 part /boot/efi
β”œβ”€nvme0n1p5 259:5    0     2G  0 part /boot
└─nvme0n1p6 259:6    0   726G  0 part /var/home
                                      /var
                                      /sysroot/ostree/deploy/fedora/var
                                      /sysroot
                                      /etc

Can you please advise me, what is the best solution to build

I don’t use kinoite

However it is worth knowing that the bios can only boot from one efi partition per drive.

You probably can use the bios boot menu to select the other efi partion and probably need to use that method to switch back and forth.

It would seem simpler to install one, then install the second in a VM that is hosted on the first.

So, in other words, it is not possible to make such dual boot system, using only one drive?

VM wouldn’t work for me: I am making a dual boot system for security reasons

The EFI spec stipulates β€œone EFI partition per drive” for removable media only.

So multiple EFI partitions wouldn’t be expected to work on a USB stick, but it should be supported on a fixed SSD.

However, we know from various issues here that BIOSes can be quirky about booting, and don’t stick rigidly to spec. So it could be that this particular BIOS doesn’t like multiple EFIs.

But if rEFInd also can’t boot one of the installs, that suggests that it’s not just the BIOS causing the problem here.

Can you show the current output of efibootmgr ?

Atomic Desktops don’t use grub2-mkconfig, they use a static GRUB file.

However, if both your EFI partitions end up booting to the same Kinoite install, what we should look at is the stub GRUB config in the EFI partition (as opposed to the one in the boot partition).

Can you show:

sudo cat /boot/efi/EFI/Fedora/grub.cfg

And then mount the other EFI partition to compare the file there:

mkdir -p ~/mnt/otherefi
sudo mount /dev/nvme0n1p1 ~/mnt/otherefi
sudo cat /mnt/otherefi/EFI/Fedora/grub.cfg
1 Like

Efibootmgr output using only the efi partition from the first system (the one that is NOT booting). I’ve tried adding manually the second system, but it disappears after reboot

$ efibootmgr
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0001
Boot0000* Fedora C      HD(1,GPT,c5cd708b-e575-420b-97e5-773acc91181c,0x800,0x12c000)/EFI\fedora\shimx64.efi
Boot0001* rEFInd Boot Manager   HD(4,GPT,6e9cda0d-79ce-4993-bb52-a99d24ddd268,0x1952c800,0x1c2000)/\EFI\refind\refind_x64.efi
Boot0002* Fedora        HD(1,GPT,c5cd708b-e575-420b-97e5-773acc91181c,0x800,0x12c000)/\EFI\fedora\shimx64.efi0000424f

Then, about grub.cfg file, it seems that my system using a different location

$ sudo cat /boot/efi/EFI/Fedora/grub.cfg
cat: /boot/efi/EFI/Fedora/grub.cfg: No such file or directory

The file from other partition:

$ sudo cat ~/mnt/otherefi/EFI/Fedora/grub.cfg
if [ -e (md/md-boot) ]; then
  # The search command might pick a RAID component rather than the RAID,
  # since the /boot RAID currently uses superblock 1.0.  See the comment in
  # the main grub.cfg.
  set prefix=md/md-boot
else
  if [ -f ${config_directory}/bootuuid.cfg ]; then
    source ${config_directory}/bootuuid.cfg
  fi
  if [ -n "${BOOT_UUID}" ]; then
    search --fs-uuid "${BOOT_UUID}" --set prefix --no-floppy
  else
    search --label boot --set prefix --no-floppy
  fi
fi
if [ -d ($prefix)/grub2 ]; then
  set prefix=($prefix)/grub2
  configfile $prefix/grub.cfg
else
  set prefix=($prefix)/boot/grub2
  configfile $prefix/grub.cfg
fi
boot



Thanks. efibootmgr reads the BIOS NVRAM, not the EFI partitions. So what we’re seeing here is that both the β€œFedora” entries in the NVRAM point to the same EFI partition (the c5cd... ).

It’s not so much that β€œthe first EFI partition is still loading the second system”, it’s that both NVRAM entries load the second system.

Weird, I wonder what is doing this.

That’s weird! Try sudo tree /boot/efi/EFI to see if we can find any GRUB config there?

$ sudo tree /boot/efi/EFI
/boot/efi/EFI
β”œβ”€β”€ refind
β”‚   β”œβ”€β”€ BOOT.CSV
β”‚   β”œβ”€β”€ drivers_x64
β”‚   β”‚   └── ext4_x64.efi
β”‚   β”œβ”€β”€ icons
β”‚   β”‚   β”œβ”€β”€ arrow_left.png
β”‚   β”‚   β”œβ”€β”€ arrow_right.png
β”‚   β”‚   β”œβ”€β”€ boot_linux.png
β”‚   β”‚   β”œβ”€β”€ boot_win.png
β”‚   β”‚   β”œβ”€β”€ func_about.png
β”‚   β”‚   β”œβ”€β”€ func_bootorder.png
β”‚   β”‚   β”œβ”€β”€ func_csr_rotate.png
β”‚   β”‚   β”œβ”€β”€ func_exit.png
β”‚   β”‚   β”œβ”€β”€ func_firmware.png
β”‚   β”‚   β”œβ”€β”€ func_hidden.png
β”‚   β”‚   β”œβ”€β”€ func_install.png
β”‚   β”‚   β”œβ”€β”€ func_reset.png
β”‚   β”‚   β”œβ”€β”€ func_shutdown.png
β”‚   β”‚   β”œβ”€β”€ licenses
β”‚   β”‚   β”‚   β”œβ”€β”€ cc-3.0.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ cc-by-sa-4.0.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ gpl-2.0.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ gpl-3.0.txt
β”‚   β”‚   β”‚   └── lgpl-3.0.txt
β”‚   β”‚   β”œβ”€β”€ mouse.png
β”‚   β”‚   β”œβ”€β”€ os_arch.png
β”‚   β”‚   β”œβ”€β”€ os_artful.png
β”‚   β”‚   β”œβ”€β”€ os_bionic.png
β”‚   β”‚   β”œβ”€β”€ os_centos.png
β”‚   β”‚   β”œβ”€β”€ os_chakra.png
β”‚   β”‚   β”œβ”€β”€ os_chrome.png
β”‚   β”‚   β”œβ”€β”€ os_clover.png
β”‚   β”‚   β”œβ”€β”€ os_crunchbang.png
β”‚   β”‚   β”œβ”€β”€ os_debian.png
β”‚   β”‚   β”œβ”€β”€ os_devuan.png
β”‚   β”‚   β”œβ”€β”€ os_elementary.png
β”‚   β”‚   β”œβ”€β”€ os_endeavouros.png
β”‚   β”‚   β”œβ”€β”€ os_fedora.png
β”‚   β”‚   β”œβ”€β”€ os_freebsd.png
β”‚   β”‚   β”œβ”€β”€ os_frugalware.png
β”‚   β”‚   β”œβ”€β”€ os_gentoo.png
β”‚   β”‚   β”œβ”€β”€ os_gummiboot.png
β”‚   β”‚   β”œβ”€β”€ os_haiku.png
β”‚   β”‚   β”œβ”€β”€ os_hwtest.png
β”‚   β”‚   β”œβ”€β”€ os_kubuntu.png
β”‚   β”‚   β”œβ”€β”€ os_legacy.png
β”‚   β”‚   β”œβ”€β”€ os_linuxmint.png
β”‚   β”‚   β”œβ”€β”€ os_linux.png
β”‚   β”‚   β”œβ”€β”€ os_lubuntu.png
β”‚   β”‚   β”œβ”€β”€ os_mac.png
β”‚   β”‚   β”œβ”€β”€ os_mageia.png
β”‚   β”‚   β”œβ”€β”€ os_mandriva.png
β”‚   β”‚   β”œβ”€β”€ os_manjaro.png
β”‚   β”‚   β”œβ”€β”€ os_netbsd.png
β”‚   β”‚   β”œβ”€β”€ os_network.png
β”‚   β”‚   β”œβ”€β”€ os_opensuse.png
β”‚   β”‚   β”œβ”€β”€ os_redhat.png
β”‚   β”‚   β”œβ”€β”€ os_refind.png
β”‚   β”‚   β”œβ”€β”€ os_refit.png
β”‚   β”‚   β”œβ”€β”€ os_slackware.png
β”‚   β”‚   β”œβ”€β”€ os_suse.png
β”‚   β”‚   β”œβ”€β”€ os_systemd.png
β”‚   β”‚   β”œβ”€β”€ os_trusty.png
β”‚   β”‚   β”œβ”€β”€ os_ubuntu.png
β”‚   β”‚   β”œβ”€β”€ os_uefi.png
β”‚   β”‚   β”œβ”€β”€ os_unknown.png
β”‚   β”‚   β”œβ”€β”€ os_void.png
β”‚   β”‚   β”œβ”€β”€ os_win8.png
β”‚   β”‚   β”œβ”€β”€ os_win.png
β”‚   β”‚   β”œβ”€β”€ os_xenial.png
β”‚   β”‚   β”œβ”€β”€ os_xubuntu.png
β”‚   β”‚   β”œβ”€β”€ os_zesty.png
β”‚   β”‚   β”œβ”€β”€ README
β”‚   β”‚   β”œβ”€β”€ tool_apple_rescue.png
β”‚   β”‚   β”œβ”€β”€ tool_fwupdate.png
β”‚   β”‚   β”œβ”€β”€ tool_memtest.png
β”‚   β”‚   β”œβ”€β”€ tool_mok_tool.png
β”‚   β”‚   β”œβ”€β”€ tool_netboot.png
β”‚   β”‚   β”œβ”€β”€ tool_part.png
β”‚   β”‚   β”œβ”€β”€ tool_rescue.png
β”‚   β”‚   β”œβ”€β”€ tool_shell.png
β”‚   β”‚   β”œβ”€β”€ tool_windows_rescue.png
β”‚   β”‚   β”œβ”€β”€ transparent.png
β”‚   β”‚   β”œβ”€β”€ vol_efi.png
β”‚   β”‚   β”œβ”€β”€ vol_external.png
β”‚   β”‚   β”œβ”€β”€ vol_internal.png
β”‚   β”‚   β”œβ”€β”€ vol_net.png
β”‚   β”‚   └── vol_optical.png
β”‚   β”œβ”€β”€ keys
β”‚   β”œβ”€β”€ refind.conf
β”‚   β”œβ”€β”€ refind_x64.efi
β”‚   └── vars
β”‚       └── PreviousBoot
└── tools

8 directories, 87 files

Ah, OK, so rEFInd has overwritten the EFI partition of your second Kinoite install. That feels a bit messy, but obviously that’s not the one that you have problems booting.

Why isn’t booting from GRUB working?

Thinking about this more, the difficulty may be in your β€œother” Fedora/grub.cfg file.

The EFI grub.cfg on a non-Atomic Fedora install is very simple - effectively it just chains to the config on the boot partition of that install, based on a hard-coded partition UUID. Here’s mine:

search --no-floppy --root-dev-only --fs-uuid --set=dev 4fcd507f-af2b-4574-a8d4-4ade52070c32
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

But the Atomic EFI grub.cfg file you have is more complicated. In some cases it searches for a partition by label (search --label boot ...). And that may go wrong if you have two boot partitions from two installs.

If GRUB could see a ${BOOT_UUID}, then that would fix the problem, but I don’t know the details of how this is supposed to work, so let’s see if someone has better advice.

Why isn’t booting from rEFInd working?

rEFInd may be able to bypass the above problem by finding Linux kernels directly.

You may need to enable this by adding a line to your refind.conf (as shown in your directory tree above) -

scan_all_linux_kernels true

That should then be able to find the kernel of your β€œfirst” Kinoite, but I’m not sure if it will be flawless (because it won’t see parameters from that Kinoite’s boot-directory GRUB config).

I’ve tried that, didn’t help :frowning:

So, am I right to conclude that the simpler solution would be the following: instead of using 2 Kinoite, use one Kinoite and one Fedora KDE. And during the Fedora KDE installation, I should let it overwrite EFI partition and then use it’s GRUB to control the boot process?

Maybe, but I don’t know whether it would be easy to add the Kinoite install to KDE’s GRUB config. From a couple of issues I’ve seen here, it seems that grub-mkconfig isn’t finding other Linux installs that it should (example with Fedora & Nobara).

On your current setup, a slightly hacky thing you could try is to add this as the first line of the Fedora/grub.cfg on the first EFI partition:

set BOOT_UUID=4fcd507f-af2b-4574-a8d4-4ade52070c32

(but replace the UUID with the UUID of the actual boot partition of the first Kinoite install).

I’m not sure though whether that would ever get overwritten by a system update.

Wouldn’t it lead to the problem with booting the second system?

Your second system appears to boot correctly now using rEFInd? If so, then you should still be able to boot into it by selecting rEFInd from the BIOS’s boot menu.

Edit: actually no, because rEFInd probably just works now by chaining to the first Kinoite’s EFI partition.

I think you would need an extra step, probably best done from a live USB.

  • Edit grub.cfg in EFI partition 1 as already mentioned
  • Remove the rEFInd files from EFI partition 2
  • Copy the contents of EFI partition 1 to EFI partition 2
  • Edit the grub.cfg in EFI partition 2 to include set BOOT_UUID=xxx (insert UUID of your second boot partition here).
  • Then use efibootmgr to remove the rEFInd entry, and add an entry for the Fedora shimx64.efi on EFI partition 2, so you have boot entries for the two separate EFI partitions.

Didn’t work, all the EFI entries are still booting the second system

Here are my outputs now:

$ sudo blkid
/dev/nvme0n1p5: UUID="8abd5ab2-d443-4fe9-b3f2-a74cec328086" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d595f5d1-366d-4061-9285-4f9e739747cf"
/dev/nvme0n1p3: UUID="b61a7a84-669d-4257-bb5f-a0285f3f5169" TYPE="crypto_LUKS" PARTUUID="ccf72631-68ae-4992-9c21-54d69d851a8b"
/dev/nvme0n1p1: UUID="6343-3126" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="c5cd708b-e575-420b-97e5-773acc91181c"
/dev/nvme0n1p6: LABEL="fedora_fedora" UUID="a3b9444a-5f32-45ac-9935-c431ffa8b7fc" UUID_SUB="b2602577-391a-4179-99d6-bb5f8c168441" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="312484dd-0ba0-416c-bc65-7e83af918690"
/dev/nvme0n1p4: UUID="16B1-31CC" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="6e9cda0d-79ce-4993-bb52-a99d24ddd268"
/dev/nvme0n1p2: UUID="001a51f0-d556-495a-b8fc-31c69566afa2" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c4e13e95-ead1-4a0b-862d-273445f1673e"
/dev/zram0: LABEL="zram0" UUID="c71b9a47-75d4-4b1d-bed0-bc366f6c0dee" TYPE="swap"
$ efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0002,0000,0001
Boot0000* Fedora C      HD(1,GPT,c5cd708b-e575-420b-97e5-773acc91181c,0x800,0x12c000)/EFI\fedora\shimx64.efi
Boot0001* Fedora W      HD(4,GPT,6e9cda0d-79ce-4993-bb52-a99d24ddd268,0x1952c800,0x1c2000)/\EFI\fedora\shimx64.efi
Boot0002* Fedora        HD(1,GPT,c5cd708b-e575-420b-97e5-773acc91181c,0x800,0x12c000)/\EFI\fedora\shimx64.efi0000424f

First EFI (from system not booting)

$ $ cat ~/mnt/otherefi/EFI/fedora/grub.cfg
set BOOT_UUID=001a51f0-d556-495a-b8fc-31c69566afa2
if [ -e (md/md-boot) ]; then
  # The search command might pick a RAID component rather than the RAID,
  # since the /boot RAID currently uses superblock 1.0.  See the comment in
  # the main grub.cfg.
  set prefix=md/md-boot
else
  if [ -f ${config_directory}/bootuuid.cfg ]; then
    source ${config_directory}/bootuuid.cfg
  fi
  if [ -n "${BOOT_UUID}" ]; then
    search --fs-uuid "${BOOT_UUID}" --set prefix --no-floppy
  else
    search --label boot --set prefix --no-floppy
  fi
fi
if [ -d ($prefix)/grub2 ]; then
  set prefix=($prefix)/grub2
  configfile $prefix/grub.cfg
else
  set prefix=($prefix)/boot/grub2
  configfile $prefix/grub.cfg
fi
boot
$ sudo cat /boot/efi/EFI/fedora/grub.cfg
set BOOT_UUID=8abd5ab2-d443-4fe9-b3f2-a74cec328086
if [ -e (md/md-boot) ]; then
  # The search command might pick a RAID component rather than the RAID,
  # since the /boot RAID currently uses superblock 1.0.  See the comment in
  # the main grub.cfg.
  set prefix=md/md-boot
else
  if [ -f ${config_directory}/bootuuid.cfg ]; then
    source ${config_directory}/bootuuid.cfg
  fi
  if [ -n "${BOOT_UUID}" ]; then
    search --fs-uuid "${BOOT_UUID}" --set prefix --no-floppy
  else
    search --label boot --set prefix --no-floppy
  fi
fi
if [ -d ($prefix)/grub2 ]; then
  set prefix=($prefix)/grub2
  configfile $prefix/grub.cfg
else
  set prefix=($prefix)/boot/grub2
  configfile $prefix/grub.cfg
fi
boot

Hmm - not sure what is going on :frowning:

I guess other things I might look at are:

  • is there a bootuuid.cfg file anywhere in the EFI partition? (Though if there was, there probably would never have been an issue.)
  • What is happening in /grub/grub2.cfg in each boot partition (not EFI partition). Does that have a reference to the UUID of the corresponding root partition, or does it try to dynamically discover it (and potentially find the wrong one)?
1 Like

Yes, there was such file! Changing UUID there have worked for me!

Thank you so much for your help!

1 Like

No worries! I should have asked you about that file first before I got you editing the grub.cfg, but glad we got it all working in the end :grinning_face: