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
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:
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):
Timeout: 0 seconds
BootOrder: 0001 0000 0017…001E 0002
Boot0000 Windows Boot Manager HD
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
there is /sys/firmware/efi
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
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]
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:
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.
(I’ve discovered by accident there’s a way mark in-line text as computer text as well: surround by backticks as on stackoverflow. I’m not seeing an icon for that but I have cataract issues and can’t see well.)
/sys/firmware/efi/efivars is a directory on my laptop.
So, that means my Fedora was installed as uefi.
And we’ve determined before that the entire disk is uefi, so no surprise the Windows is uefi.
I have the Windows 10 recovery ISO and will install into a USB memory.
But just to be perfectly clear, I need to:
Boot laptop with the Windows ISO and “repair Windows” or something to that effect, after which the box would become Windows-boot-only, right?
I can test by booting the laptop, and I should just get Windows, right?
I then boot with the previously-made Fedora 37 ISO, right?
grub2-mkconfig -o /boot/grub2/grub.cfgand I should at that point be good, right?
So what is not clear is how the Windows partition got corrupted. I assume operator error, but what specific operator error, I wonder? Or, if it’s not operator error, why would installing grub have broken the Windows bootability when doing the regular install, but step (4) (above) not do so now?
Thanks Vladislav. I have followed your link, downloaded the software, made a bootable USB, and booted it.
I pick my language and so on.
Then I can choose “Troubleshoot” or “Turn off your PC.”
For Troubleshoot, I can choose “Startup Repair,” and I tried this. It works for a minute “Diagnosing your PC” and “Attempting Repairs.” and finally, “Startup Repair couldn’t repair your PC.” My only option is to go back to the Troubleshoot menu.
The other choices don’t seem appropriate: “Command Prompt,” “Uninstall Updates,” “UEFI Firmware Settings,” “System Restore” to a restore point (I have none), or “System Image Recovery.”
What do you recommend I try?