Dual drive dual boot irregular grub errors - "you need to load the kernel first", "no such file", "no such device"

Hi, this is my first time trying Fedora or any Linux distro for a daily use. I have configured btrfs snapshots based on this video https://www.youtube.com/watch?v=iSyDgIuBDWU, except I have decided to keep my /boot directory on a separate partition. I have already successfully installed nvidia drivers.

I have a problem with dual booting Fedora 42 KDE Plasma and Windows 11. First I have installed Fedora, removed Fedora drive and installed Windows on a separate drive. Then installed back Fedora drive. So Fedora’s and Windows’ ESPs are on separate drives. After installing Fedora and before installing Windows I have updated my BIOS (didn’t think about potential compatibility problems and still don’t know if there are any).
I had to add windows to grub menu, as it wasn’t there. I started with editing /etc/default/grub and adding GRUB_DISABLE_OS_PROBER=false. Then I have run sudo grub2-mkconfig -o /boot/grub2/grub.cfg. It worked and started showing windows in boot menu, but when I tried to boot it I got an error:

error: ../../grub-core/commands/search.c:472:no such device: E846-EF0D.
error: ../../grub-core/fs/fshelp.c:257:file ‘/efi/Microsoft/Boot/bootmgfw.efi’ nof found

Then, when I try to boot Fedora I get:

error: ../../grub-core/fs/fshelp.c:257:file ‘/vmlinuz-6.16.3-200.fc42.x86_64’ not found
error: ../../grub-core/loader/i386/efi/linux.c:258:you need to load the kernel first.

It seems that it only happens when I am rebooting from Fedora (but I am not sure about that one) and only if I first try to boot Windows. Then Fedora also gets the error and nothing can be booted. It gets fixed after rebooting through firmware settings. Booting directly from Windows drive from BIOS always works reliably.

Things I have tried so far to fix the problem:

  • checking if I am in UEFI mode

[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

  • checking if os-prober detects Windows
  • disabling secure boot in BIOS
  • disabling fast boot on Windows
  • checking if the correct Windows ESP UUID is entered in configuration file

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

  • manually adding Windows entry in /etc/grub.d/40_custom

menuentry ‘Windows 11’ {
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set=root E846-EF0D
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}

  • reinstalling shim and grub.cfg

sudo rm -f /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
sudo dnf reinstall “shim-” “grub2-efi-” grub2-common

  • recreating Fedora’s EFI grub.cfg multiple times and every time after some re-configuring/reinstalling

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

  • adding a fallback shim on Fedora drive

sudo cp /boot/efi/EFI/fedora/shimx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI

  • recreating EFI/Windows boot files from Windows system
  • checking boot order and efibootmgr -v entries’ UUIDs

The files indicated in the error seem to be exactly where they’re supposed to be.

Those are the outputs of some commands I have been using:

  • sudo efibootmgr -v (I have replaced long hex stings with “…” to reduce clutter)
    BootCurrent: 0004
    Timeout: 1 seconds
    BootOrder: 0004,0003
    Boot0003* Windows Boot Manager HD(1,GPT,0da39…)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000190000088000000780000004200430044001f0047004a004500430054003d007b003900640065006100380036003200630e2d0035006300640064002d0034006500370030002f0071006300630031002d006600340032006200330034003400640034003700390035007d0000000000010000006000000001d000007fff05f0
    dp: …
    data: …
    Boot0004* Fedora HD(1,GPT,d686…)/\EFI\fedora\shimx64.efi0000424f
    dp: …
    data: …

  • sudo lsblk -f
    NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
    sda
    ├─sda1 vfat FAT32 E846-EF0D
    ├─sda2
    ├─sda3 ntfs 2AF04895F0486961
    └─sda4 ntfs 12827F8F827F7657
    zram0 swap 1 zram0 31f867bf-795e-4a3f-aee6-d5e1eb478805 [SWAP]
    nvme0n1
    ├─nvme0n1p1 vfat FAT32 A123-11CF 579.5M 3% /boot/efi
    ├─nvme0n1p2 ext4 1.0 c6052336-7401-4c70-af78-4e04f734a026 218.9M 71% /boot
    └─nvme0n1p3 btrfs fedora b6f298cc-1778-4c38-bccc-a10b54a19f1d 1.8T 3% /var/tmp
    /var/spool
    /var/log
    /var/lib/sddm
    /home
    /var/cache
    /opt
    /var/lib/libvirt
    /

  • sudo blkid /dev/sda1
    /dev/sda1: UUID=“E846-EF0D” BLOCK_SIZE=“512” TYPE=“vfat” PARTLABEL=“Basic data partition” PARTUUID=“0da39514-423c-40a4-8f52-a2e5b4bc5ed0”

  • sudo blkid /dev/nvme0n1p1
    /dev/nvme0n1p1: UUID=“A123-11CF” BLOCK_SIZE=“512” TYPE=“vfat” PARTLABEL=“EFI System Partition” PARTUUID=“d686a99b-290f-4679-96ba-35b571b57f44”

Please don’t assume I am more advanced in Linux than I am based on those commands, I was just copy pasting (while trying to stay careful). I definitely classify as a beginner :slight_smile:

I’m not sure the Windows ESP UUID should be there. On my setup (dual boot with shared EFI), the only UUID referenced in that file is the Fedora /boot partition - not the EFI partition.

What are the contents of that file? It should be very simple, 4 lines or so.

This command would be problematic if it ran successfully - it would overwrite the Fedora EFI partition’s very simple .cfg file with the complex file that is supposed to live in /boot/grub2/grub.cfg.

However, on recent Fedoras, the command should throw an error if you try to write to the EFI partition.

You are right, I have messed up those files and they had the same content. I regenerated them

sudo rm -f /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
sudo dnf reinstall -y grub2-efi shim grub2-common
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
and now /boot/efi/EFI/fedora/grub.cfg has several lines and actually contain Fedora’s boot partition UUID. This doesn’t solve the problem though.

This it the Windows entry in /boot/grub2/grub.cfg:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-e>
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal>
else
search --no-floppy --fs-uuid --set=root E846-EF0D
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}

which was generated automatically after running sudo grub2-mkconfig -o /boot/grub2/grub.cfg I think.

From the no such device: E846-EF0D error message, it seems like this command is being executed but somehow not finding the Windows EFI partition.

Seems like the BIOS recognises the drive fine if you can boot directly from it, so I can’t think of a good reason for this error :frowning:

Notice the difference in those two partitions.
nvme0n1p1 is an ESP and sda1 is a Basic data partition. I believe that sda1 also needs to be an ESP before grub can use it for booting.

From your previous lsblk -f listing

sudo lsblk -f
NAME        FSTYPE FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1      vfat   FAT32        E846-EF0D
├─sda2
├─sda3      ntfs                2AF04895F0486961
└─sda4      ntfs                12827F8F827F7657
zram0       swap   1     zram0  31f867bf-795e-4a3f-aee6-d5e1eb478805                [SWAP]
nvme0n1
├─nvme0n1p1 vfat   FAT32        A123-11CF                             579.5M     3% /boot/efi
├─nvme0n1p2 ext4   1.0          c6052336-7401-4c70-af78-4e04f734a026  218.9M    71% /boot
└─nvme0n1p3 btrfs        fedora b6f298cc-1778-4c38-bccc-a10b54a19f1d    1.8T     3% /var/tmp

there clearly is a file system with the file system UUID of E846-EF0D so grub should have found it. This could be a bug in grub or it could be some effect of fastboot, where devices are not guarantied to be fully detected when loading grub.

Well, I have made sure fast boot is turned off from the very installation of Windows. There also doesn’t seem to be any options related to fast boot in the BIOS

That’s actually a useful insight, thanks. I thought it’s just how Linux labels Windows’ partitions, but when I dug deeper and used sudo gdisk /dev/sda1 this is the output:

GPT fdisk (gdisk) version 1.0.10

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Exact type match not found for type code 6E00; assigning type code for
'Linux filesystem'
Exact type match not found for type code 7400; assigning type code for
'Linux filesystem'
Warning! Main partition table overlaps the first partition by 34 blocks!
You will need to delete this partition or resize it in another utility.

Warning! Secondary partition table overlaps the last partition by
3649853941 blocks!
You will need to delete this partition or resize it in another utility.

but parted clearly shows the partition table on this drive is gpt. Not sure if that is the cause of the main problem or if that indicate something uncommon\invalid but I am going to look at it closer now.

Windows update often tend to enable fast boot even if previously disabled.

Also, bitlocker in windows may interfere with grub being able to properly boot windows if the ESP is not shared between linux & windows.

Gdisk (and any other partitioning tools) must NEVER be used on a partition, but only on the whole disk. The partition table is NOT contained within the partition.
That should have been sudo gdisk /dev/sda

Your results show that gdisk believes it may be an MBR partition table.

Wrong device name. Do sudo gdisk /dev/sda. sda1 is a partition of the disk and doesn’t contain a partition table.

Uh, so that is the reason of this weird output. sudo gdisk /dev/sda looks alright, with gpt partition table.

I am not sure the name/partlabel of sda1 being “Basic data partition” is something bad. For example fdisk -l /dev/sda detects it as ESP:

Device Start End Sectors Size Type

/dev/sda1 2048 411647 409600 200M EFI System
/dev/sda2 411648 444415 32768 16M Microsoft reserved
/dev/sda3 444416 248623103 248178688 118.3G Microsoft basic data
/dev/sda4 248623104 250066943 1443840 705M Windows recovery environment

So does it really matter what the name is?

Then I have no other clues for the reason of my problems

Since fdisk shows it as ESP then the name really is a fluke of the way it was displayed by the blkid command above. IIUC fdisk reads directly from the drive while blkid is nearer the OS level. Leave it as is.

Okay, I think I finally got it to work. I did two things so I am not sure which one actually made a difference and I don’t want to experiment with it any longer:

  1. When I searched deeper, it turned out there actually IS some “fast boot” option in ASUS firmware settings. It was enabled by default and I have disabled it
  2. I have followed point 3 in this article: https://www.thewindowsclub.com/the-requested-system-device-cannot-be-found-in-windows. I know it’s irrelevant on Fedora forum, but it may help somebody. So basically I removed and recreated boot partition on Windows drive through live USB

What’s interesting, is that although the error: ../../grub-core/commands/search.c:472:no such device: E846-EF0D. still shows up when choosing Windows entry in grub menu, when clicked enter it actually boots properly