I have installed 12.04 next to a Windows 7 install, on a partitioned 3 TB hard disk. If I use F12 during boot to review boot options from the BIOS, Windows 7 and Ubuntu boot normally, but the Ubuntu GRUB only gives me Ubuntu options.
When I try os-prober, I get no results at all; update-grub doesn't do anything for me either. I've tried modifying the GRUB using Grub Customizer, but, uh, don't really understand the finer points of it.
Here's a screenshot of the drive taken with Disk Utility. The first partition is Windows, the second is shared data (MP3s, documents, photos, etc.). The 105 MB FAT is an "EFI system partition" and the 134 MB "Unknown" is labelled a "Microsoft reserved partition"; the 898 GB is Ubuntu, and the final 5 GB is swap.
I have had the same problem:
Windows 7 and Linux (Slax with Grub2 and Debian in my case) and
os-prober
didn't recognizes the Windows partition when I usedupdate-grub
; Windows was left out.I repaired the problem. First I tested adding the entry for Windows 7 manually to
/boot/grub/grub.cfg
(update-grub
overwrites this file whenever it is run, so changes made to it are not permanent).I rebooted and Windows 7 appeared in the menu and booted ok, aside from this error appearing:
When this came up, I pressed Enter and Windows booted fine.
I investigated the execution of the
os-prober
command and others scripts involved in the process of recognizing OS and I test the output ofWindows is not listed. I opened Dolphin file manager to browse the Windows partition and searched for the UUID of the partition and replaced it in
/boot/grub/grub.cfg
to resolve the error.I executed
and Windows was then listed ok
I rebooted the PC, went to console, and executed
and then Windows was again not listed.
I opened Dolphin, browsed the Windows partition, executed
again and Windows was listed.
I executed
update-grub
and the GRUB menu is now ok.I think
os-prober
needs the partition (in NTFS case, because the Debian partition always is listed) mounted before it can find it. I haven't found out whyos-prober
has this behaviour but the solution works.It's been a while since asked, but I just faced the same problem with os-prober not detecting the Windows partition (with BitLocker). In my case, this happened after copying the data to a new larger harddisk, which required me to recreate the EFI partition.
It seems that os-prober checks the EFI partition of the harddisk (
/dev/nvme0n1p1
in my case) and checks for thebootmgfw.efi
file in theMicrosoft
folder:But this folder and file obviously wasn't available after recreating the EFI partition. So all I needed to do was to copy over the
Microsoft
directory from the old harddisk to the new one and then os-prober started again to detect the Windows partition and Grub boots it just fine. Whether the main Windows partition is mounted or not does not matter (as suggested in other posts regarding this subject) and it also does not matter if the main partition is encrypted with BitLocker.Summary: Assuming that the EFI partition of the old disk is
/dev/sda1
and the EFI partition (FAT32) of the new disk is mounted as/boot/efi
, it should suffice to doSide note: At least Ubuntu 22.04 (maybe some earlier versions as well) by default disable running os-prober by
update-grub
for security reasons:To force it running, add
to
/etc/default/grub
and runupdate-grub
again: