Bug#546757: grub: os-prober tries (and fails) to mount crypted partition at grub installation time

Vincent Danjean vdanjean at debian.org
Tue Sep 15 14:00:18 UTC 2009


Package: grub-pc
Version: 1.97~beta3-1
Severity: important
File: grub

  Hi,

  I've seen the discussion about the use or not by default of os-prober.
On my machine, I've some encrypted partitions that I manually mount when
I need to access to the information.
  During grub package configuration, os-prober is launched and try to mount
these partitions. This stalls the grub installation (ie apt is blocked).

# apt-get dist-upgrade
[...]
Paramétrage de grub-common (1.97~beta3-1) ...
Installation de la nouvelle version du fichier de configuration /etc/grub.d/40_custom ...
Paramétrage de grub-pc (1.97~beta3-1) ...
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)	/dev/sda
Generating grub.cfg ...
Found Debian background: moreblue-orbit-grub.png
Found linux image: /boot/vmlinuz-2.6.31-rc6-amd64
Found initrd image: /boot/initrd.img-2.6.31-rc6-amd64
Found linux image: /boot/vmlinuz-2.6.31-rc5-amd64
Found initrd image: /boot/initrd.img-2.6.31-rc5-amd64
Found linux image: /boot/vmlinuz-2.6.31-rc4-amd64
Found initrd image: /boot/initrd.img-2.6.31-rc4-amd64
Found linux image: /boot/vmlinuz-2.6.31-rc3-amd64
Found initrd image: /boot/initrd.img-2.6.31-rc3-amd64
Found linux image: /boot/vmlinuz-2.6.30-1-amd64
Found initrd image: /boot/initrd.img-2.6.30-1-amd64
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64

And I'm stalled here.

Here is the (partial) result of "ps axf" during the stall:
24164 pts/3    S+     0:00  |                   \_ /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/grub-pc.postinst configure 1.97~beta2-2
24176 pts/3    S+     0:00  |                       \_ /bin/bash -e /var/lib/dpkg/info/grub-pc.postinst configure 1.97~beta2-2
24772 pts/3    S+     0:00  |                           \_ /bin/sh -e /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
25349 pts/3    S+     0:00  |                               \_ /bin/sh -e /etc/grub.d/30_os-prober
25360 pts/3    S+     0:00  |                                   \_ /bin/sh -e /etc/grub.d/30_os-prober
25361 pts/3    S+     0:00  |                                       \_ /bin/sh /usr/bin/os-prober
25744 pts/3    S+     0:00  |                                       |   \_ /bin/sh /usr/lib/os-probes/50mounted-tests /dev/mapper/eyak-private
25748 pts/3    S+     0:00  |                                       |       \_ mount -o ro -t crypto_LUKS /dev/mapper/eyak-private /var/lib/os-prober/mount
25749 pts/3    S+     0:00  |                                       |           \_ /sbin/mount.crypto_LUKS /dev/mapper/eyak-private /var/lib/os-prober/mount -o ro
25362 pts/3    S+     0:00  |                                       \_ tr   ^
25363 pts/3    S+     0:00  |                                       \_ paste -s -d  


I think this is primary a bug in grub: it must not use os-prober if such stall occurs.
Perhaps you will want to clone this bug to os-proper for a wishbug in order to have an
option to avoid such filesystems.

  Regards,
    Vincent

PS: after killing 25749, here is what I got in the apt-get console:
Found initrd image: /boot/initrd.img-2.6.31-rc3-amd64
Found linux image: /boot/vmlinuz-2.6.30-1-amd64
Found initrd image: /boot/initrd.img-2.6.30-1-amd64
Found linux image: /boot/vmlinuz-2.6.26-2-amd64
Found initrd image: /boot/initrd.img-2.6.26-2-amd64
Found   on Password
    is not yet supported by grub-mkconfig.
done
Paramétrage de libbrlapi0.5 (4.0-8) ...
[...]

And apt finishes its run without a complain.


-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/mapper/eyak-root / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/sda1 /boot ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/mapper/eyak-home /home ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/mapper/eyak-data /srv/data ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/mapper/eyak-photos /srv/photos ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/mapper/eyak-kvm--lenny /srv/kvm ext3 rw,relatime,errors=continue,data=ordered 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/sda
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
set default=0
insmod lvm
insmod ext2
set root=(eyak-root)
search --no-floppy --fs-uuid --set adafa709-e055-46df-8592-4e277e1dcdde
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
insmod png
if background_image /grub/moreblue-orbit-grub.png ; then
  set color_normal=black/black
  set color_highlight=magenta/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, Linux 2.6.31-rc6-amd64" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc6-amd64 root=/dev/mapper/eyak-root ro  quiet
	initrd	/initrd.img-2.6.31-rc6-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc6-amd64 (recovery mode)" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc6-amd64 root=/dev/mapper/eyak-root ro single 
	initrd	/initrd.img-2.6.31-rc6-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc5-amd64" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc5-amd64 root=/dev/mapper/eyak-root ro  quiet
	initrd	/initrd.img-2.6.31-rc5-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc5-amd64 (recovery mode)" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc5-amd64 root=/dev/mapper/eyak-root ro single 
	initrd	/initrd.img-2.6.31-rc5-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc4-amd64" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc4-amd64 root=/dev/mapper/eyak-root ro  quiet
	initrd	/initrd.img-2.6.31-rc4-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc4-amd64 (recovery mode)" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc4-amd64 root=/dev/mapper/eyak-root ro single 
	initrd	/initrd.img-2.6.31-rc4-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc3-amd64" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc3-amd64 root=/dev/mapper/eyak-root ro  quiet
	initrd	/initrd.img-2.6.31-rc3-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.31-rc3-amd64 (recovery mode)" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.31-rc3-amd64 root=/dev/mapper/eyak-root ro single 
	initrd	/initrd.img-2.6.31-rc3-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.30-1-amd64" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.30-1-amd64 root=/dev/mapper/eyak-root ro  quiet
	initrd	/initrd.img-2.6.30-1-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.30-1-amd64 (recovery mode)" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.30-1-amd64 root=/dev/mapper/eyak-root ro single 
	initrd	/initrd.img-2.6.30-1-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-amd64" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.26-2-amd64 root=/dev/mapper/eyak-root ro  quiet
	initrd	/initrd.img-2.6.26-2-amd64
}
menuentry "Debian GNU/Linux, Linux 2.6.26-2-amd64 (recovery mode)" {
	insmod ext2
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 5716556a-d7e0-4695-ad83-1fd7d4a251ac
	linux	/vmlinuz-2.6.26-2-amd64 root=/dev/mapper/eyak-root ro single 
	initrd	/initrd.img-2.6.26-2-amd64
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file is an example on how to add custom entries
### END /etc/grub.d/40_custom ###
*********************** END /boot/grub/grub.cfg

-- System Information:
Debian Release: squeeze/sid
  APT prefers oldstable
  APT policy: (500, 'oldstable'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-rc6-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]         1.5.27     Debian configuration management sy
pn  grub-common                   <none>     (no description available)
ii  libc6                         2.9-26     GNU C Library: Shared libraries
ii  ucf                           3.0022     Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  5.0.5      common files for the Debian Deskto
ii  genisoimage                   9:1.1.9-1  Creates ISO-9660 CD-ROM filesystem

-- debconf information:
  grub2/kfreebsd_cmdline:
* grub-pc/linux_cmdline:
* grub2/linux_cmdline:
* grub-pc/chainload_from_menu.lst: true
  grub-pc/kopt_extracted: false
  grub-pc/postrm_purge_boot_grub: false
  grub2/kfreebsd_cmdline_default: quiet
* grub2/linux_cmdline_default: quiet
* grub-pc/install_devices: /dev/sda





More information about the Pkg-grub-devel mailing list