Fresh-Installed 37 over 33: GRUB lacks Windows entry?

Was the Fedora clean install supposed to prompt me for boot preferences? (It didn’t.)

Is there any way to recover the perfectly-working GRUB I had for the last 3-4 years? (This was a clean install, albeit on top of a working 33 that had been upgraded since 27 or something over 4-5 years and never a boot problem. (I made a backup copy of /etc, but not of /boot, so I don’t think I have a backup of what I actually need to simply diff myself.)

I thought I didn’t have a grub at all and Fedora was booting directly. After much googling I determined I DO have a Grub working but it probably has auto_hide enabled, seemingly, and a timeout so fast I don’t see it.

In /etc/default/grub I changed GRUB_TIMEOUT=-1 .

I tried grub2-editenv - unset menu_auto_hide

I ran grub2-mkconfig -o /boot/grub2/grub.cfg

I rebooted.

Now I have a grub menu that stays up long enough to read, and I see it only has:

  1. Fedora Linux (6.0.7-301.fc37.x86_64) 37 (Workstation Edition)
  2. Fedora Linux (0-rescue-blahblah) 37
  3. UEFI Firmware Settings

I’ve googled ’ “Fedora 37” add windows to grub’ which even autocompleted so I assume it’s a common search, but after checking 20+ pages none seem to address this issue.

Any ideas?

Perhaps Windows expects to boot directly from the UEFI boot manager.

Thanks for your help. How can I check this, and if true, how can I add Windows to the Grub menu?

Check the output:

sudo os-prober; sudo efibootmgr

Thanks.

I’ve tried /usr/bin/os-prober and there’s no output, no man page, no --help .

Is it supposed to output something?

I haven’t run /usr/sbin/efibootmgr as I’m not sure whether you meant I should run it before I see os-prober output.

Sounds like a similar problem:
[Solved] GRUB and os-prober do not see Windows 10 on a different drive / Newbie Corner / Arch Linux Forums

Thank you Vladislav.

In my case there’s only one disk (the internal SSD) with six partitions.

I don’t have networking so I’ll type it in manually but in short form: fdisk -l reports:

GPT

sda1 -128M Microsoft reserved
sda2 260M EFI System
sda3 Microsoft basic data (this is my C: drive, and I have it mounted as /c and the contents look fine on Linux: the disk is not corrupt.)
sda4 1001M Windows recover environment
sda5 1G Linux filesystem
sda6 528.3G Linux LVM

It then reports sdb (a USB memory stick) and /dev/mapper/fedora_localhost–live root, swap, zram0, and home. I’m not familiar with these from my earlier decades using Linux but they about add up to the size of sda6.

It took me some time to understand the efibootmgr man page before running it.

It says (I have to manually copy this as the wifi is not working since the upgrade):

BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001 0000 0017…001E 0002
Boot0000 Windows Boot Manager HD
Boot0001 Fedora
Then USB CD, FDD, NVMe0 NVMe1 ATA HDD1 HDD0 USB HDD PCI LAN, and finally Linux-Firmware-Updater.

Sorry if that is not clear. If it would help I could use an SD card to copy the exact output. Should I do that?

Looking at the link you shared, my /boot/EFI does not have the Microsoft subdirectory and its files.

Something interesting: os-probe is a shell script and runs other OS-specific shell scripts. I see they log stuff, so by running journalctl I see their output.

Specifically, the microsoft detector is logging “Skipping legacy bootloaders on UEFI system.”

That script is called /usr/libexec/os-probes/mounted/20microsoft .

It logs “Skipping legacy bootloaders on UEFI system” if

  1. there is /sys/firmware/efi

  2. there is NO /var/lib/partman/ignore_uefi

As an experiment I created the above file and ran it.

Now 20microsoft is being called with a third argument “fuse” or “fuseblk” and I don’t know what this means, so I deleted the experimental file.

I see there is also a /usr/libexec/os-probes/mounted/efi/20microsoft . (NOTE THE EXTRA “/efi/”)

Looking at that file it seems that if there is an $efi/$microsoft/$boot/$bootmgfw (I think it’s testing a file location but I haven’t figured out how all these variables are being set) it would output the line I need, I think: /dev/sda3:Windows Boot Manager:Windows .

I’m tempted to just replace /usr/libexec/os-probes/mounted/20microsoft with a file that outputs that when called with /dev/sda3 … but I also think this would be a bad idea, since os-probe for some reason I can’t figure out isn’t running the mounted/efi/20microsoft script, and the reason it’s not running it is probably important.

Can you run the following 2 commands and then using the usb device copy the output and show it to us in full.
sudo fdisk -l
lsblk -f

The messages you mentioned just above and the fact that there is no /boot/efi/EFI/Microsoft directory seems to indicate that MS may have been installed in legacy boot mode and fedora installed (with your new install) in uefi mode. Since the boot modes are incompatible grub cannot boot windows.

The output of the commands above should tell us this info.

[root@fedora fs]# fdisk -l

Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 850 
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: 28540247-CE76-49BE-8CA2-813789FD08CE

Device          Start        End    Sectors   Size Type
/dev/sda1          34     262177     262144   128M Microsoft reserved
/dev/sda2      264192     796671     532480   260M EFI System
/dev/sda3      796672  841441279  840644608 400.9G Microsoft basic data
/dev/sda4  1951473664 1953523711    2050048  1001M Windows recovery environment
/dev/sda5   841441280  843538431    2097152     1G Linux filesystem
/dev/sda6   843538432 1951473663 1107935232 528.3G Linux LVM

Partition table entries are not in disk order.


Disk /dev/mapper/fedora_localhost--live-root: 70 GiB, 75161927680 bytes, 146800640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora_localhost--live-swap: 15.62 GiB, 16773021696 bytes, 32759808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


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


Disk /dev/mapper/fedora_localhost--live-home: 442.68 GiB, 475323695104 bytes, 928366592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0: 1.88 GiB, 2014838784 bytes, 3935232 sectors
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: dos
Disk identifier: 0x00000000

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk0p1        253 3935231 3934979  1.9G  6 FAT16

[root@fedora fs]# lsblk -f

NAME                            FSTYPE      FSVER    LABEL     UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                                                  
├─sda1                                                                                                               
├─sda2                          vfat        FAT16    SYSTEM    0A6B-C360                               245.8M     5% /boot/efi
├─sda3                          ntfs                 Windows   532A127846298C78                        176.8G    56% /c
├─sda4                          ntfs                 WinRE_DRV F88D80912189F77B                                      
├─sda5                          ext4        1.0                236e461b-a101-4d10-8f1f-6f908f22edeb    733.7M    18% /boot
└─sda6                          LVM2_member LVM2 001           Gxu9EG-VDTd-Rw8v-haMR-Zgm5-uxb2-C8cjpa                
  ├─fedora_localhost--live-root ext4        1.0                6262b16e-bd1d-408c-aa72-1ddd9c6c789f     59.5G     8% /
  ├─fedora_localhost--live-swap swap        1                  b6e8ac8b-6a0e-4a1c-92bd-f58f3a846f39                  
  └─fedora_localhost--live-home ext4        1.0                03b7c654-b63b-4de6-8acf-20d547c9f23c    409.1G     1% /home
mmcblk0                                                                                                              
└─mmcblk0p1                     vfat        FAT16              4668-4E4F                                 1.9G     0% /run/media/fs/4668-4E4F
zram0                                                                                                                [SWAP]

[root@fedora fs]#

To be clear, I believe you need to fix the Windows bootloader using the method described in the message linked above and then restore the Fedora bootloader if necessary.

Thank you for the information. That shows that windows was installed in uefi mode (the drive is formatted GPT)

Please do not YELL at us. There is no need to use all caps when posting and it is usually considered rude and YELLING in tone when done.

# fdisk -l
Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: ST2000DM001-1ER1
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: 24FDDFB6-C29B-47CA-A0C0-6800FD5DE0CC

Device          Start        End    Sectors  Size Type
/dev/sda1        2048     534527     532480  260M EFI System
/dev/sda2      534528     796671     262144  128M Microsoft reserved
/dev/sda3      796672  629942271  629145600  300G Microsoft basic data
/dev/sda4  3841042432 3843090431    2048000 1000M Windows recovery environment
/dev/sda5  3843090432 3906004991   62914560   30G Windows recovery environment
/dev/sda6  3906004992 3907028991    1024000  500M Lenovo boot partition
/dev/sda7   629942272 3839092735 3209150464  1.5T Linux LVM
/dev/sda8  3839092736 3841042431    1949696  952M Linux filesystem

Please note the difference in what I posted here and your post above.
The difference is because I added the Preformatted Text </> tags from the tool bar above so it appears exactly as formatted on screen when I ran that command.
In the future it would be appreciated by all if you use those tags to retain formatting when posting data you copy from your screen.

I have already looked at that about 30 minutes.

He says " I finally solved the problem by getting the Windows installer and running the “fix boot problems” tool (or something similar, do not remember the exact name). "

So, I don’t really know what that means.

I am happy to try it but I don’t understand what “the Windows installer” is, or where I can find this tool or what it might be called.

Jeff V says that Windows may be in legacy boot mode and Fedora in Uefi mode. I don’t understand how the output he requested shows this or not, though.

If Jeff V is correct, though, I don’t know how this “fix boot problems tool” would change from “legacy boot mode” to “uefi boot mode.”

Thanks for your help so far.

This means you need to create a bootable Windows media:
https://www.google.com/search?q=windows+download+site%3Amicrosoft.com
Booting it provides you an option to repair the Windows bootloader.

Many thanks Jeff.

Please don’t assume any tone of voice is implied by writing in all caps, when the only way to communicate with you for 21 hours was to draw your attention to the fact I was being forced to edit old comments while blocked on new comments. I seem to have accomplished the goal of getting your attention but I hurt your feelings in the process. I regret that when you’ve been so helpful.

I’m new on this forum and didn’t realize there was a mode to label text as preformatted. In fact I tried that for individual words (e.g., commands, file names etc.) and I couldn’t find that mode, so I mistakenly assumed that block text was missing too. I’ll try to remember to use that in the future.

OK, so onto business.

GPT means the disk was originally formatted (by Lenovo, for the pre-installed Windows 10) as uefi. Got it.

But then Fedora would have to be uefi too, no? A disk can’t be both, can it? I’m actually not clear what the precise difference between the two is: is uefi a property of the entire SSD, or is it something that can differ per partition? The GPT field you highlighted is clearly a per-disk trait to me.

So… if it’s easy for us to detect, let’s see why os-probe isn’t detecting it…

Why wouldn’t a uefi-based Fedora install look for a uefi-based Windows partition?

The script os-prober is running /usr/libexec/os-probes/mounted subcommands, not /usr/libexec/os-probes/mounted/efi UNLESS 05efi sees vfat, msdos, or fat. For instance, 20microsoft is giving me logs visible in journalctl which are from the non-efi version of the script.

I put a trace debug call into /usr/libexec/os-probes/mounted/efi/20microsoft, and it IS being called, but only for /dev/sda2!!! not for /dev/sda3 which is the C: drive!!! However /usr/libexec/os-probes/mounted/efi/* are only called if script /usr/libexec/os-probes/mounted/05efi detects vfat, msdos, or fat, OTHERWISE doesn’t run them. In fact it this partition ntfs, therefore doesn’t attempt to run the subtests in the efi directory.

I’m not a big sh programmer, so maybe overlooking something, but I don’t see how this os-probe, as it stands today, can recognize an ntfs filesystem in an efi partition. If anyone thinks that actually works, I’d love to see the journalctl logs generated by a run of os-probe on their box.

Unfortunately (or fortunately depending upon your point of view) that limitation on this forum is (I believe) to prevent multiple rapid posts that are commonly indicative of spammers.

Yes, it does restrict new users who may be impatient for a solution.

The Fedora Code of Conduct does show how users are expected to act when posting. The forum is not an instantaneous response venue since we are all volunteers and it is not considered polite to yell at users on the forum when the response does not occur within your expected time line.

I tried to clarify this a couple of times, but I guess I’m bad at explaining:

I tried to respond to excellent help ideas… and found I couldn’t.

The only way I could think of to respond, was to make a very eye-catching edit to a previous comment.

I made that in all-caps in order to catch eyes, not to “yell at someone for not responding within an expected timeline.” Indeed my comment didn’t mention timeline at all, but did mention that I seemed to have no other way of responding to a comment other than editing old comments of mine.

I don’t know how I could have made that more clear, but if you want to give me proper wording to use, that would catch eyes, but not be perceived as yelling, please let me know and I will try to remember your preferred combination should that situation ever arise again in my life. However, I felt I had explained adequately in the comment, and apologized for the misunderstanding since, and I have removed it as it caused so much discussion and offense.

So I apologize again to you and I am trying to take all your feedback to heart.

The disk does not care, but the boot loaders do. Grub, when installed in uefi mode cannot boot an OS that was installed in legacy mode, and vice versa. This is why I asked about the installation mode of windows. The fact the disk was partitioned in GPT mode shows windows was installed in uefi mode. (windows installed in uefi mode uses GPT partitioning and installed in legacy mode uses MSDOS partitioning)

You can easily check the mode used to install linux with this command and response

# cat /sys/firmware/efi/efivars
cat: /sys/firmware/efi/efivars: Is a directory

The shown response indicates the system was booted in uefi mode. If that directory does not exist then it was booted in legacy mode.

As long as both were installed in uefi mode then the suggestion to do the windows boot loader repair is appropriate and then you would need to boot to fedora again and repair the grub boot loader.