3

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.

Disk utility snapshot

3
  • I don't know if this is a helpful clue or not, but Windows now reverts to the BIOS time when I use the Windows boot option. Apr 17, 2014 at 10:28
  • Could you please run Boot-Info and edit your question to include a link to its resulting info log? Thanks. Nov 21, 2017 at 11:33
  • 1
    the problem is that Ubuntu is in EFI mode and Windows 7 is in Legacy/BIOS mode. Grub can not switch boot modes on the fly. You need to reinstall Ubuntu in Legacy mode.
    – ravery
    Nov 22, 2017 at 3:19

2 Answers 2

1

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 the bootmgfw.efi file in the Microsoft folder:

$ sudo os-prober
/dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

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 do

sudo mount /dev/sda1 /mnt
sudo cp -r /mnt/EFI/Microsoft /boot/efi/EFI/
sudo umount /mnt
sudo os-prober
# This should show the Windows partition as above. If ok, update grub.
sudo update-grub

Side note: At least Ubuntu 22.04 (maybe some earlier versions as well) by default disable running os-prober by update-grub for security reasons:

$ sudo update-grub
Sourcing file `/etc/default/grub'
...
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

To force it running, add

GRUB_DISABLE_OS_PROBER=false

to /etc/default/grub and run update-grub again:

$ sudo update-grub
Sourcing file `/etc/default/grub'
...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
0

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 used update-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:

error: no suck device: xxxxxxxxxxx (disk ID)

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 of

sudo /etc/grub.d/30_os-prober 2>/dev/null

Windows 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

sudo /etc/grub.d/30_os-prober 2>/dev/null

and Windows was then listed ok

I rebooted the PC, went to console, and executed

sudo /etc/grub.d/30_os-prober 2>/dev/null

and then Windows was again not listed.

I opened Dolphin, browsed the Windows partition, executed

sudo /etc/grub.d/30_os-prober 2>/dev/null

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 why os-prober has this behaviour but the solution works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .