2

I have three OSs installed in my desktop, each on its own disk. Two are Fedora and one is Windows 11.

Previously I had all three in the F12 boot menu to chose from. Recently I did a fresh Fedora reinstall and now I don't have the Windows option anymore.

Windows is installed at nvme0n1, the main Fedora at nvme1n1 and the second Fedora at sdb:

$ lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                                             8:0    0 931,5G  0 disk  
└─sda1                                          8:1    0 931,5G  0 part  /wdc
sdb                                             8:16   0 111,8G  0 disk  
├─sdb1                                          8:17   0   600M  0 part  
├─sdb2                                          8:18   0     1G  0 part  
└─sdb3                                          8:19   0 110,2G  0 part  
sdc                                             8:32   0   1,8T  0 disk  
└─sdc1                                          8:33   0   1,8T  0 part  /hd2t
zram0                                         251:0    0     8G  0 disk  [SWAP]
nvme0n1                                       259:0    0 476,9G  0 disk  
├─nvme0n1p1                                   259:1    0    16M  0 part  
├─nvme0n1p2                                   259:2    0 476,3G  0 part  
└─nvme0n1p3                                   259:3    0   672M  0 part  
nvme1n1                                       259:4    0 931,5G  0 disk  
├─nvme1n1p1                                   259:5    0   600M  0 part  /boot/efi
├─nvme1n1p2                                   259:6    0     1G  0 part  /boot
└─nvme1n1p3                                   259:7    0 929,9G  0 part  
  └─luks-3c6999b1-7e9a-4978-b8bb-dae0a8451840 252:0    0 929,9G  0 crypt /home
                                                                         /

This is the Windows partitioning:

# fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: ADATA SX8200PNP                         
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: 1BCDE255-654D-4681-8FAF-F938EC01B621

Device Start End Sectors Size Type /dev/nvme0n1p1 2048 34815 32768 16M Microsoft reserved /dev/nvme0n1p2 34816 998836223 998801408 476.3G Microsoft basic data /dev/nvme0n1p3 998836224 1000212479 1376256 672M Windows recovery environment

This should be the partitioning:

enter image description here

os-prober returns nothing.

So it is missing the EFI partition. I guess what happened is that I installed Windows on its own disk when Fedora was already installed on another disk and somehow the Windows installer used the EFI partition on the Fedora disk. Then when I fresh reinstalled Fedora, the Windows option was gone.

I got near to solve it with this question How to recover windows boot option after installed fedora 38 on another disk

But then I got stuck with this error Windows 8: BFSVC Error: Could not open the BCD template store. Status = [c000000f]

Clodoaldo
  • 303

2 Answers2

2

As far as I know, GRUB doesn't support booting Windows directly. You have to go through the Windows Boot Manager (even if you're not seeing its boot menu usually). That's the bootmgfw.efi file from your EFI system partition (e.g. /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi from the Linux PoV, but I'm not sure if I remembered the path right).

If you find the Microsoft directory in your Fedora EFI partition, you can directly add its bootmgfw.efi file to GRUB as a chainloader type entry – or ideally, skip GRUB and add Windows Boot Manager directly to your EFI firmware's boot menu using efibootmgr.

If that file doesn't exist then something deleted the files (or maybe the whole partition; sometimes in dualboot installs where Windows is installed on a secondary disk it just reuses the found partition from the main disk). In that case you'll need to create the partition, boot from a Windows install USB (can be created from Linux) and use its bcdboot command to reinstall the Windows Boot Manager. It'll create an EFI boot menu entry as well.

(You can reuse the same partition that currently has GRUB, although I'd prefer creating a new one on the Windows disk – at the beginning if I had the time to move the whole C:, but otherwise the EFI partition can safely be at the end or anywhere. The Microsoft article documents the default layout, not a mandatory layout.)

Tom Yan
  • 10,996
grawity
  • 501,077
0

I solved it with this answer https://superuser.com/a/1781350/40390 :

enter image description here

But with two details from this article https://woshub.com/how-to-repair-uefi-bootloader-in-windows-8/

The differences are: First, after assigning a letter to the partition and exiting diskpart I changed to this directory:

cd /d Y:\efi\microsoft\boot\

Y being the assigned letter

And second I passed the Windows install locale parameter to bcdboot:

bcdboot C:\Windows /l en-us /s y:

Now this is the working Windows partitioning:

# fdisk -l /dev/nvme1n1
Disk /dev/nvme1n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: ADATA SX8200PNP                         
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: 1BCDE255-654D-4681-8FAF-F938EC01B621

Device Start End Sectors Size Type /dev/nvme1n1p1 2048 34815 32768 16M Microsoft reserved /dev/nvme1n1p2 34816 997812223 997777408 475.8G Microsoft basic data /dev/nvme1n1p3 997812224 998836223 1024000 500M EFI System /dev/nvme1n1p4 998836224 1000212479 1376256 672M Windows recovery environment

Clodoaldo
  • 303