Issue booting into Windows 11 - dual boot

I had an installation of Windows 11, then I’ve installed Fedora 41 into another disk in its own partition. after the installation is done, I tried to boot into widnows from Grub entry but it brings me back into grub menu and fedora is not bootable too. but when I select fedora after rebooting it worked, windows still not bootable. can you help me fix this issue I spent days trying to find a solution but in vain. this my lsblk -f:

NAME FSTYPE FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                              
├─sda1
│                                                                                
└─sda2
     ntfs         DATA       1608BFFE08BFDAC7                                    
zram0
                                                                                 [SWAP]
nvme1n1
│                                                                                
├─nvme1n1p1
│    vfat   FAT32            A41A-F039                            1002.7M     2% /boot/efi
├─nvme1n1p2
│    btrfs        fedora     a241bb70-9381-44e9-8564-5882b023b8c1  170.8G     4% /
├─nvme1n1p3
│    ntfs         SSD_BACKUP 2C02A2A802A2770C                                    
└─nvme1n1p4
     swap   1     swap       a4494e20-9ecd-40fc-bd33-50f4c1ad8473                [SWAP]
nvme0n1
│                                                                                
├─nvme0n1p1
│    vfat   FAT32 ESP        1224-1909                                           
├─nvme0n1p2
│                                                                                
├─nvme0n1p3
│    ntfs         Acer       38C624D9C6249960                                    
└─nvme0n1p4
     ntfs         Recovery   CE78255378253B99
soft@fedora:~$ sudo fdisk -l
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM048-2E71
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 259D5827-0EEF-430B-8C56-B98A9C848663

Device     Start        End    Sectors   Size Type
/dev/sda1     34      32767      32734    16M Microsoft reserved
/dev/sda2  32768 1953521663 1953488896 931.5G Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/nvme1n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Fanxiang S770 2TB                       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1F7F8F9A-B67B-4E4B-AD28-A622E4839B9B

Device             Start        End    Sectors  Size Type
/dev/nvme1n1p1      2048    2099199    2097152    1G EFI System
/dev/nvme1n1p2   2099200  377489407  375390208  179G Linux filesystem
/dev/nvme1n1p3 419463168 3907026943 3487563776  1.6T Microsoft basic data
/dev/nvme1n1p4 377520128  419463167   41943040   20G Linux swap

Partition table entries are not in disk order.


Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: WDC PC SN530 SDBPNPZ-512G-1114          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1E78DF81-E2B8-4301-B5B7-F8C5DE1761BD

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048     534527    532480   260M EFI System
/dev/nvme0n1p2    534528     567295     32768    16M Microsoft reserved
/dev/nvme0n1p3    567296  998117375 997550080 475.7G Microsoft basic data
/dev/nvme0n1p4 998117376 1000214527   2097152     1G Windows recovery environmen


Disk /dev/zram0: 8 GiB, 8589934592 bytes, 2097152 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

and this is the content of 40_custom file:

  GNU nano 8.1                 /etc/grub.d/40_custom                            
#!/usr/bin/sh
exec tail -n +3 $0


menuentry "Windows 11" {
    insmod part_gpt
    insmod fat
    search --no-floppy --fs-uuid --set=root 1224-1909
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi

}

I took the liberty of editing your post and removed the ‘blockquote’ format and added the ‘preformatted text’ format. The " and the </> buttons are side by side on the toolbar.

It keeps the formatting the same as seen on-screen and makes it more readable.

One thing I note is that your fedora installation on nvme1n1 has a /boot/efi partition and a btrfs partition for / , but does not have a standard ext4 /boot partition nor does it show the /home on the btrfs partition.
This is the standard partitioning for installing fedora workstation with uefi boot.

# lsblk -f
NAME   FSTYPE FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sr0                                                                            
zram0                                                                          [SWAP]
vda                                                                            
├─vda1 vfat   FAT32        9393-D982                             579.5M     3% /boot/efi
├─vda2 ext4   1.0          19297faa-c91a-4126-8e8e-5792599d4ad7  567.5M    35% /boot
└─vda3 btrfs        fedora 9251dc90-a0ef-4df1-836b-a8c0ff22056e   32.1G    14% /home
                                                                               /

nvme0n1 seems to have the standard windows partitioning

You also seem to have created a separate efi partition on the second drive which is not really an issue, but does throw in some other configs for dual booting.

I have to ask if you created the menu entry in 40_custom file manually before rebooting or if that was an afterthought attempt to recover.

My laptop only has one drive so it is not exactly the same, however this is what the efibootmgr shows. I have no custom boot entries in 40_custom and am using windows 10.

# efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0006
Boot0000* Fedora	HD(1,GPT,5d6a36e2-fe99-4228-9f22-5ce85ed07a2b,0x800,0x82000)/\EFI\FEDORA\SHIMX64.EFI
Boot0002* Windows Boot Manager	HD(1,GPT,5d6a36e2-fe99-4228-9f22-5ce85ed07a2b,0x800,0x82000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000000100000010000000040000007fff0400
Boot0006* Fedora	HD(1,GPT,5d6a36e2-fe99-4228-9f22-5ce85ed07a2b,0x800,0x82000)/\EFI\FEDORA\SHIM.EFI0000424f

Reading your 40_custom file it would appear you are expecting the windows boot manager to be on the same drive as your fedora grub boot

What happens if you first remove the menuentry from that file (my default 40_custom is

# cat /etc/grub.d/40_custom 
#!/usr/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

)
then run sudo grub2-mkconfig -o /boot/grub2/grub.cfg and reboot

Fedora’s os-prober should find windows on the second drive and add it to the menu automatically. (it seems it should have been found and added when you installed fedora)

You also may want to ensure the grub menu is displayed always by using
sudo grub2-editenv - unset menu_auto_hide

If you need to manually use that custom menu entry then the path to the windows boot manager must be an absolute, including the device name or uuid for the drive where it is located. You can find out how grub identifies it by entering the grub command line from the boot menu and the minimal commands available there to see what the bios identifies for hardware.

I think you have tried to identify the device with the search line, but you are using the file system uuid and not the device uuid. Note the difference in the way the pointer file on fedora is structured with the search line.

# cat /boot/efi/EFI/fedora/grub.cfg
search --no-floppy --fs-uuid --set=dev 3469ba89-07f0-422b-94c8-551356156120
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

@computersavvy thank you for correcting my post, I’m a new member here and this is my first post. I just moved from using ubuntu for many years to fedora because of instability issues. but the grub fix is difficult in this case. I just made a clean install and set the efi parition to point to the windows efi partition. even though I still have the same issue, the 40_csutom file is clean now without any entries,

soft@thorium:~$ efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0003,0000,0002,2001,2002,2003
Boot0000* ubuntu	HD(1,GPT,1f6fe664-1fdf-4707-8a51-96953553b99e,0x800,0x82000)/\EFI\ubuntu\shimx64.efi
Boot0001* Fedora	HD(1,GPT,1f6fe664-1fdf-4707-8a51-96953553b99e,0x800,0x82000)/\EFI\fedora\shim.efiRC
Boot0002* Fedora	HD(1,GPT,1f6fe664-1fdf-4707-8a51-96953553b99e,0x800,0x82000)/\EFI\fedora\shimx64.efi
Boot0003* Windows Boot Manager	HD(1,GPT,1f6fe664-1fdf-4707-8a51-96953553b99e,0x800,0x82000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000035000100000010000000040000007fff0400
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC

is there any instruction to fix that, knowing that its a clean install and I get this issue, ubuntu doesn’t have this issue. I’m not sure what am I doing wrong.

Note that both fedora and windows are looking at exactly the same drive and efi partition and offset for booting. This will not work when fedora has a different efi partition than windows. The efibootmgr displays the exact same device uuid for all the entries.

The windows boot entry must point to nvme0n1 while fedora must point to nvme1n1 according to the information you have posted.

You may try using efibootmgr to remove the windows boot entry
sudo efibootmgr -b -B 0003
then rerun the grub2-mkconfig command to reset the boot menu.