#681691 os-prober and linux-boot-prober fail to mount alternate partition

Package:
os-prober
Source:
os-prober
Description:
utility to detect other OSes on a set of drives
Submitter:
"Eric L."
Date:
2015-02-18 10:45:05 UTC
Severity:
important
#681691#5
Date:
2012-07-15 17:25:10 UTC
From:
To:
Hello,

very recently, I noticed that update-grub didn't discover Linux Debian
installed on other partitions (/dev/sda2) than the current one (/dev/sda1),
and I brought the issue down to os-prober which somehow fails to mount
/dev/sda2 in order to properly discover it:

root@hdvdr:/usr/src# os-prober
umount: /var/lib/os-prober/mount: not mounted
root@hdvdr:/usr/src# mount /dev/sda2 /mnt
root@hdvdr:/usr/src# os-prober
/dev/sda2:Debian GNU/Linux (wheezy/sid):Debian:linux
root@hdvdr:/usr/src# linux-boot-prober /dev/sda2
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.4-trunk-amd64:/boot/vmlinuz-3.4-trunk-amd64:/boot/initrd.img-3.4-trunk-amd64:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro quiet
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.4-trunk-amd64 (Wiederherstellungsmodus):/boot/vmlinuz-3.4-trunk-amd64:/boot/initrd.img-3.4-trunk-amd64:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro single
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.2.0-3-amd64:/boot/vmlinuz-3.2.0-3-amd64:/boot/initrd.img-3.2.0-3-amd64:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro quiet
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.2.0-3-amd64 (Wiederherstellungsmodus):/boot/vmlinuz-3.2.0-3-amd64:/boot/initrd.img-3.2.0-3-amd64:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro single
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.1.8+vdr1:/boot/vmlinuz-3.1.8+vdr1:/boot/initrd.img-3.1.8+vdr1:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro quiet
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.1.8+vdr1 (Wiederherstellungsmodus):/boot/vmlinuz-3.1.8+vdr1:/boot/initrd.img-3.1.8+vdr1:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro single
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.1.0-1-amd64:/boot/vmlinuz-3.1.0-1-amd64:/boot/initrd.img-3.1.0-1-amd64:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro quiet
/dev/sda2:/dev/sda2:Debian GNU/Linux, mit Linux 3.1.0-1-amd64 (Wiederherstellungsmodus):/boot/vmlinuz-3.1.0-1-amd64:/boot/initrd.img-3.1.0-1-amd64:root=UUID=4d1901af-273e-4fdf-8128-b014f0b88e30 ro single
root@hdvdr:/usr/src# umount /dev/sda2
root@hdvdr:/usr/src# linux-boot-prober /dev/sda2
umount: /var/lib/os-prober/mount: not mounted

I've done an 'fsck -f' prior to the above test and I've also tried to
	mkdir /var/lib/os-prober/mount
prior to similar tests, but it didn't make any difference.

The report was set to important as it is impacting greatly its usage.

Thanks, Eric

#681691#10
Date:
2013-11-09 13:34:53 UTC
From:
To:
Hello,

there was no reaction on this bug which actually makes my life miserable each
time there is a kernel update, because I need to mount all relevant partitions
by hand.

Anyway, I looked a bit more about it and found the following:

1. os-prober calls "/usr/lib/os-prober/newns /usr/bin/os-prober" which itself
   calls "/usr/lib/os-probes/50mounted-tests /dev/sda2" (for example).
2. 50mounted-tests relies itself on grub-mount to mount the partition.
3. The call to grub-mount looks as such:

	mounted=
	if type grub-mount >/dev/null 2>&1 && \
	   type grub-probe >/dev/null 2>&1 && \
	   grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
		mounted=1

4. Calling grub-mount gives then the following error:

	# grub-mount /dev/sda2 /mnt
	fuse: device not found, try 'modprobe fuse' first
	# echo $?
	0
	# modprobe fuse
	FATAL: Module fuse not found.

i.e. we have multiple errors combined to make a big mess:
	a. grub-mount relies on a fuse module which doesn't exist (by default).
	b. it fails with an error message but a successful return code.
	c. 50mounted-tests thinks that the command is successful (and hides
	   the error message which could have been helpful).

Conclusion, I think this bug should be duplicated, once to fix grub-mount
resp. grub-common package, once to fix os-prober (at least to improve error
handling, at best to stop using grub-mount). I'd be more than happy to
read your opinion.

Thanks, Eric

#681691#15
Date:
2013-11-09 13:50:00 UTC
From:
To:
Hello again,

Thanks again,
Eric

#681691#26
Date:
2014-09-25 09:38:19 UTC
From:
To:
FWIW had a similar experience, but this was in rescue mode of debian
installer (amd64) where grub-mount (and mount as well) failed.

However, once I booted into installed system update-grub worked fine and
detected installed windows partition.

Regards
sidhu1f

#681691#31
Date:
2015-02-18 10:41:01 UTC
From:
To:
Hello,

I never had this error before using the kernel from wheezy-backports, but
now apt said that there are these updates available:

linux-compiler-gcc-4.6-x86
linux-headers-3.16.0-0.bpo.4-amd64
linux-headers-3.16.0-0.bpo.4-common
linux-image-3.16.0-0.bpo.4-amd64

I installed them and it called update-grub as expected. Before the updates
update-grub correctly detected all 4 operating systems
on my computer and I could start them all without problems. But now I
experienced just the same error and it only detected the current
running OS, Debian Wheezy, and Windows 8. After mounting the other two
partitions manually everything works.

The versions that the packages were updated to:

# aptitude versions linux-compiler-gcc-4.6-x86
linux-headers-3.16.0-0.bpo.4-amd64 linux-headers-3.16.0-0.bpo.4-common
linux-image-3.16.0-0.bpo.4-amd64
Paket linux-compiler-gcc-4.6-x86:
i A 3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-compiler-gcc-4.6-x86:i386:
p   3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-headers-3.16.0-0.bpo.4-amd64:
i   3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-headers-3.16.0-0.bpo.4-amd64:i386:
p   3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-headers-3.16.0-0.bpo.4-common:
i A 3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-headers-3.16.0-0.bpo.4-common:i386:
p   3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-image-3.16.0-0.bpo.4-amd64:
i A 3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-image-3.16.0-0.bpo.4-amd64-dbg:
p   3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

Paket linux-image-3.16.0-0.bpo.4-amd64:i386:
p   3.16.7-ckt4-3~bpo70+1                         wheezy-backports
800

The versions of the responsible packages:

# aptitude versions grub2-common os-prober
Paket grub2-common:
i A 1.99-27+deb7u2                                stable
900
p A 2.02~beta2-21                                 unstable
10

Paket grub2-common:i386:
p   1.99-27+deb7u2                                stable
900
p   2.02~beta2-21                                 unstable
10

Paket os-prober:
i A 1.58                                          stable
900
p A 1.65                                          unstable
10

Paket os-prober:i386:
p   1.58                                          stable
900
p   1.65                                          unstable
10