Unable to dualboot windows in GRUB, gives me an error

I am new-ish to the Linux ecosystem. I got fedora 37 in January and used it frequently with windows for about 2 and a half months. For the most part it worked fine.

I had to however reinstall fedora 37 because I took a shortcut that frankly did not work. However, now windows is not showing up in GRUB and gives me a too-quick to read error, something spitting out an error and a filepath.

i am using Fedora 37 Workstation and Windows 10.
At first, I thought it was an issue with the boot, so I asked chatgpt and I put in this command: sudo grub2-mkconfig -o /boot/grub2/grub.cfg

and changed my config
menuentry “Windows 10” {
insmod ntfs
set root=(hdX,Y)
chainloader +1

Note I changed my root, which to my understanding I can find from lsblk command, which spits out this:
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 16M 0 part
├─sda2 8:2 0 466.7G 0 part
└─sda3 8:3 0 464.8G 0 part
sdb 8:16 0 223.6G 0 disk
├─sdb1 8:17 0 100M 0 part
├─sdb2 8:18 0 16M 0 part
├─sdb3 8:19 0 1G 0 part
├─sdb4 8:20 0 62.2G 0 part /mnt/sdb4
├─sdb5 8:21 0 1M 0 part
├─sdb6 8:22 0 1G 0 part /boot
└─sdb7 8:23 0 159.2G 0 part /home
sdc 8:32 0 3.6T 0 disk
├─sdc1 8:33 0 200M 0 part
└─sdc2 8:34 0 3.6T 0 part /run/media/yurizahard/Backup Plus
sr0 11:0 1 1024M 0 rom
zram0 252:0 0 8G 0 disk [SWAP]

sdb4 is the same-size as my windows partition.

I plugged in for hdX sdb and for y as 4 then regenerating the config. At first it was sdb4 but that didnt work either so I changed it to just 4 but it did not work.

Interestingly, when I use the fdisk command, I get this
fdisk: cannot open /dev/sda: Permission denied
fdisk: cannot open /dev/sdb: Permission denied
fdisk: cannot open /dev/sdc: Permission denied
fdisk: cannot open /dev/zram0: Permission denied

Edit: not sure how related, but before when I dualbooted, I would press f11 to open bios to control my boot to windows/fedora. Because default was windows, because I installed it first. Now, fedora is the default and I am getting this error.
I tried with sudo, which I don’t think you can do here but it didn’t work, says the command was not found.

I have honestly been banging my head on this for a while. I have an external connected and a win10 iso with ventoy, but I consider that a last resort. Any help would be appreciated.

Fedora 37 Workstation and WIndows 10 dualboot via Grub is not working, keeps giving me an error and filepath. I made a new 40_custom file and regenerated mkconfig, that did not work. I tried twice with 4 and sdb4 in my partition, neither worked.

I did not mention this but when I tried GrubCustomizer just to see if it even appears, only UEFI firmware settings appears. I see it should display all of my os including linux w/file structures but it does not. Not sure how relevant that is.

Any help would be appreciated.

What shortcut started this fiasco?

Chatgpt may be helpful for some, but is far from intelligent in its answers since it uses what can be found on the internet and some answers may be totally wrong.

The default grub config for booting windows 10 via uefi on my system is

   insmod part-gpt
   insmod fat
   search --no-floppy --fs-uuid --set=root 42F8-BF3E
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi

Note that the “42F8-BF3E” in that is the UUID for the efi partition on my drive and those 4 lines set everything up to boot windows dual boot.

I checked my desktop as well as the laptop and except for differing UUIDs the windows entry is exactly the same.

I tried to boot my fedora in grub and overtime I noticed new releases automatically on the loaded. Unfortunately, it never worked.
So me in my infinite wisdom, I got a new iso from redhat and installed on the same location as the old. I was warned you know “you will be formatting/deleting this are you sure?” and I clicked yes.
I tried to install updates but it kept giving me eras regarding my drivers, which it doesnt do now but I wonder if I traded one daemon for another…
And it worked, mostly, but windows is now locked out.

Now does this grub config use mkconfig or will I be doing another process to put this config command in?

   insmod part-gpt
   insmod fat
   search --no-floppy --fs-uuid --set=root 42F8-BF3E
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi

Also, the second command is the partition type, right? Mine is NFTS. Just being sure.
Also, on my fedora system when I check dicks, my UUID is this: 10820249820233AE

Is that normal? This is where my windows portion is.

My fedora one is longer: b970206c-d22f-4d46-a2e7-601ed4f1a48f

And yeah, I considered this place a last resort because I am newish to linux. Played with ubuntu in HS, never stuck because back in 2014, alot of stuff did not work as well as it does now.

If you are booting with uefi the efi partition will be formatted FAT and the UUID will have the structure noted above (XXXX-XXXX). If booting using legacy there may be a difference.

When booted into linux try sudo ls /boot/efi/EFI. If that shows both a fedora and a Microsoft folder then all you should need is to enter the grub commands shown with your own UUID in that line and it should work.

The command lsblk -f should show the file system type and UUID for each file system and should clearly show which partition is the efi partition.

Note that I do not manually create the menu entry for booting windows. That is automatically created by grub.

The fact that your lsblk output does not show a /boot/efi partition mounted leads me to infer that you may have installed fedora in legacy boot mode. If windows is in uefi mode and fedora is in legacy mode then grub will be unable to boot windows for you.

Ah, I think I get it. So basically the efi partition should be FAT and that my UUID is different because I might be booting in legacy mode, is that right?

Should I reinstall because I just ran that command and it says “cannot access ‘/boot/efi/EFI.’: No such file or directory”?
Here is my lsblk -f output as well:

│    ntfs         New Volume
│                       98CCD29FCCD276CA                                    
     ext4   1.0   ext   a60713a5-6569-43ff-96f3-cb9d61c2edef                
│    vfat   FAT32       E8DD-749C                                           
│    ext4   1.0         5d639998-fc6d-4f27-af7c-ced69ca71cb2                
│    ntfs               10820249820233AE                       12.5G    80% /mnt/sdb4
│    ext4   1.0         2e7d0362-5f17-40e4-bff5-86bc0a868426  659.3M    25% /boot
     btrfs        fedora_localhost-live
                        b970206c-d22f-4d46-a2e7-601ed4f1a48f  114.2G    27% /home
│    vfat   FAT32 EFI   67E3-17ED                                           
     exfat  1.0   Backup Plus
                        5DF7-2740                               1.5T    59% /run/media/yurizahard/Backup Plus
     vfat   FAT32       7AA1-6B43                                14G     6% /run/media/yurizahard/7AA1-6B43
     vfat   FAT32       16FE-DFAF                              10.6G    29% /run/media/yurizahard/16FE-DFAF

I took the liberty to add the Preformatted text tags (</> button on the tool bar above) to your post so the lsblk output appears as it is seen on your screen. Please use that tool to retain formatting with pasting text in your posts.

/dev/sdb1 appears to be the windows efi partition
sdb6 & sdb7 appear to be the linux partitions and it seems you probably did install linux in legacy boot mode.

You can reinstall, using those same partitions but using uefi boot and it should add /dev/sdb1 as the efi partition for linux (/boot/efi) then grub should be able to locate and boot windows for you.

I would disconnect all the unnecessary devices (sdc, sdd, sde) and any others you do not absolutely need before doing the reinstall.

I also note that sdc1 is marked as EFI and no others.

There doesn’t need to be any speculation here.

If the OP would run fdisk -x /dev/sdb as root, then the Type-UUID will be C12A7328-F81F-11D2-BA4B-00A0C93EC93B for the efi partition.

This is written in the UEFI spec, iirc, but I found it here: Managing EFI Boot Loaders for Linux: Basic Principles

Good luck!

Disk identifier: 6A1D61AC-5B85-4100-BECD-209A49E78C49
First usable LBA: 34
Last usable LBA: 468862094
Alternative LBA: 468862127
Partition entries starting LBA: 2
Allocated partition entries: 128
Partition entries ending LBA: 33

Device         Start       End   Sectors Type-UUID                            UUID                                 Name Attrs
/dev/sdb1       2048    206847    204800 C12A7328-F81F-11D2-BA4B-00A0C93EC93B 2532AE0A-9E4D-4550-B1B5-DE00648CF30F EFI System Partition
/dev/sdb2     206848    239615     32768 E3C9E316-0B5C-4DB8-817D-F92DF00215AE A6893C86-B1AB-4219-9CEE-DFA07C7400F8 Microsoft reserved partition
/dev/sdb3     239616   2336767   2097152 0FC63DAF-8483-4772-8E79-3D69D8477DE4 52E9A0E0-C84D-4527-A946-E3CF60E7356F      
/dev/sdb4  338331648 468860927 130529280 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 3C4D3B98-7C4C-443B-9B42-005730B6CEDC Basic data partition
/dev/sdb5    2336768   2338815      2048 21686148-6449-6E6F-744E-656564454649 3AAB6A34-9896-4391-9718-D1FD11A7CE64      
/dev/sdb6    2338816   4435967   2097152 0FC63DAF-8483-4772-8E79-3D69D8477DE4 854945D7-FB3A-46CB-9C7D-68F261D28B76      
/dev/sdb7    4435968 338331647 333895680 0FC63DAF-8483-4772-8E79-3D69D8477DE4 6FE281FF-2880-4A67-99BD-B2F406DF94CE      

Partition table entries are not in disk order.

Thank you Jeff and John for the help! Here is the result of that command. I will reinstall using uefi boot and ventoy. I will keep you updated by tomorrow on any updates, failures/success’ etc.

I think this sounds right though.

Also, thank you Jeff for the tip! It looks kind of like html so I almost wrote it like html but I noticed it was on the toolbar lol. I have the attention span of a goldfish.

I think that Jeff’s right that /dev/sdc1 is also an EFI ESP. You might also check there just to be aware when you do your EFI installation.

Good luck!

I am not sure if we close threads here, but I just want to add that this all worked. That EFI partition was an accident I believe, since it is on my backup drive. I can only assume I tried to boot off it once because I might have stuck an ISO in there. I am only guessing though.

Anyway, I even upgraded to Windows 11 because the 10 iso was giving me some issues on ventoy, so I can’t complain.

Basically, I reinstalled, changed the mount points at efi to dual boot and it works fine.
Thank you all so much for helping a linux noob like myself and being polite!