#534644 os-prober: ignores separate boot partition when mounted

Package:
os-prober
Source:
os-prober
Description:
utility to detect other OSes on a set of drives
Submitter:
Kevin Mitchell
Date:
2012-11-27 09:45:06 UTC
Severity:
normal
#534644#5
Date:
2009-06-26 00:08:18 UTC
From:
To:
I have a second install of Debian Lenny on an other partion. It boots off yet an other partition.
It's relevant /etc/fstab entries are

/dev/sda2 /boot       ext3        defaults,noatime       0  0
/dev/sda6 /          auto        defaults,noatime       0  0

On my running sid, I have these partitions mounted
/dev/sda2 /mnt/sandbox/boot
/dev/sda6 /mnt/sandbox

The relevant menu entry in /mnt/sandbox/boot/grub/grub.cfg (i.e., residing on /dev/sda2) is


menuentry "Debian GNU/Linux, linux 2.6.30.012" {
        set root=(hd0,2)
        search --fs-uuid --set 234cc6d9-e0ef-4105-b817-f1c83edbc1a2
        linux   /vmlinuz-2.6.30.012 root=/dev/sda5 ro i915.modeset=1 selinux=0 enforcing=0 resume=/dev/sda3  clocksource=hpet quiet
}

When I run

linux-boot-prober /dev/sda6

on standard output I see

/dev/sda6:/dev/sda6::/boot/vmlinuz-2.6.26-2-amd64:/boot/initrd.img-2.6.26-2-amd64:root=/dev/sda6

and in /var/log/syslog

linux-boot-prober: debug: /usr/lib/linux-boot-probes/mounted/90fallback succeeded

However I expect to see

/dev/sda6:/dev/sda2:Debian GNU/Linux, linux 2.6.30.012:/boot/vmlinuz-2.6.30.012::root=/dev/sda5 ro i915.modeset=1 selinux=0 enforcing=0 resume=/dev/sda3 clocksource=hpet quiet

Which I do see with the attached patch applied to /usr/bin/linux-boot-prober.

Kevin

#534644#10
Date:
2009-12-06 13:40:33 UTC
From:
To:
I am running Debian as my main OS on /dev/hda3
However I am running CentOS on /dev/hda8 with a separate boot partition on /dev/hda1

Running
os-prober
returns
/dev/hda8:CentOS release 5.3 (Final):RedHat:linux

and running
linux-boot-prober /dev/hda8
returns nothing (void)

whereas running
linux-boot-prober /dev/hda1
/dev/hda1:/dev/hda1::/vmlinuz-2.6.18-128.el5::root=/dev/hda1
/dev/hda1:/dev/hda1::/vmlinuz-2.6.18-164.el5::root=/dev/hda1
/dev/hda1:/dev/hda1::/vmlinuz-2.6.26-2-686:/initrd.img-2.6.26-2-686:root=/dev/hda1

As a consequence, update-grub does not add any line for CentOS in /boot/grub.conf

Cheers

#534644#15
Date:
2012-11-27 09:43:03 UTC
From:
To:
I had this problem for a while: os-prober does not recognize Windows
(any version) when the Windows partition is mounted. And this is really
annoying for someone who wants to share their files between two
different OSes.

I hope I am not wrong, but I think that this bug severity should be
raised to "important", because anyone who needs os-prober
(regardless of the fact that it comes by default with GRUB) because they
have a dual boot system is likely to mount the other partition at some
point.
In that moment, if grub-update is launched (or triggered by APT - which
is more likely), the OS in the mounted partition will disappear from the
boot list (at least until update-grub is launched/triggered again with
the OS partition not mounted.).

I was able to reproduce this bug by launching os-prober from root with
the mounted partitions, obtaining no output. After manually unmounting
the partitions, os-prober returns the correct list.

Then, I have mounted the partitions again (see below) and re-launched
os-prober:

claudio@Chuck:~$ sudo os-prober
[sudo] password for claudio:
/dev/sda1:Windows 8 (loader):Windows:chain
claudio@Chuck:~$ sudo mount -a
claudio@Chuck:~$ sudo os-prober
claudio@Chuck:~$