[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#544487: cryptroot fails to recognize root fs (/dev/mapper/<hostname>-root links to /dev/dm-1)



Package: initramfs-tools
Version: 0.93.4
Severity: important

I'm using Debian with an encrypted root filesytem, (as set up by the
Debian installer). I've been installing custom kernels for sometime,
and for the most part update-initramfs has been working fine for me,
so thanks!

However, when I installed 2.6.31-rc7 today, the initramfs no longer
prompted for my password so failed to mount root. I tracked this down
to a missing /conf/conf.d/cryptroot options file in the initramfs. I
re-ran mkinitramfs against my current 2.6.31-rc2 kernel and it also
failed to include this file. (As opposed to the working 2.6.31-rc2
initramfs I generated on 2009-07-28---presumably I have updated the
initramfs-tools package in the meantime.)

A little bit of work with "sh -x" and I found that the problem is that
my root filesystem /dev/mapper/yoom-root is a symlink to /dev/dm-1,
(see fstab and mtab below). With this setup, the canonical_device
function in /usr/share/initramfs-tools/hooks/cryptroot returns 1 since
the target of the symlink is not in /dev/mapper, (without having
checked that the symlink itself *is* in /dev/mapper).

I've worked around the bug by commenting out the following lines of
canonical_device, but presumably other systems require these lines,
(presumably they have symlinks *into* /dev/mapper). So I imagine a
more general solution is desired.

	## Workaround bug with /dev/mapper/yoom-root -> /dev/dm-1 (cworth)
	#       if [ -h "$dev" ]; then
	#               dev=$(readlink -e "$dev")
	#       fi

I'd be glad to test a better fix, or even work on generating one with
guidance.

Thanks

-Carl

-- /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/mapper/yoom-root /               ext3    errors=remount-ro 0       1
/dev/sda1       /boot           ext2    defaults        0       2
/dev/mapper/yoom-swap_1 none            swap    sw              0       0

-- /etc/mtab
/dev/dm-1 / ext3 rw,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
/dev/sda1 /boot ext2 rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0

-- $(ls -l /dev/mapper)
total 0
crw-rw---- 1 root root 10, 60 2009-08-31 14:18 control
lrwxrwxrwx 1 root root      7 2009-08-31 14:18 sda2_crypt -> ../dm-0
lrwxrwxrwx 1 root root      7 2009-08-31 14:18 yoom-root -> ../dm-1
lrwxrwxrwx 1 root root      7 2009-08-31 14:18 yoom-swap_1 -> ../dm-2

-- Package-specific info:
-- /proc/cmdline
root=/dev/mapper/yoom-root ro 

-- /proc/filesystems
	ext3
	ext2

-- lsmod
Module                  Size  Used by
binfmt_misc             7052  1 
ppdev                   5816  0 
lp                      8084  0 
parport                31276  2 ppdev,lp
sco                     8880  2 
bridge                 39716  0 
stp                     2128  1 bridge
bnep                   10692  2 
rfcomm                 30292  4 
l2cap                  18172  16 bnep,rfcomm
ipv6                  233520  48 
acpi_cpufreq            7624  0 
cpufreq_conservative     6148  0 
cpufreq_userspace       2692  0 
cpufreq_powersave       1308  0 
cpufreq_stats           3568  0 
ext2                   54028  1 
i915                  190632  2 
drm                   138140  2 i915
i2c_algo_bit            4876  1 i915
loop                   13508  0 
snd_hda_codec_conexant    16448  1 
arc4                    1576  2 
ecb                     2384  2 
snd_hda_intel          23068  1 
snd_hda_codec          64232  2 snd_hda_codec_conexant,snd_hda_intel
snd_hwdep               6176  1 snd_hda_codec
snd_pcm_oss            32260  0 
snd_mixer_oss          12384  1 snd_pcm_oss
iwlagn                 72940  0 
snd_pcm                63412  3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
iwlcore                94628  1 iwlagn
snd_seq_dummy           2436  0 
snd_seq_oss            22924  0 
snd_seq_midi            5704  0 
btusb                  10344  2 
mac80211              121564  2 iwlagn,iwlcore
snd_rawmidi            18724  1 snd_seq_midi
evdev                   8160  13 
snd_seq_midi_event      6228  2 snd_seq_oss,snd_seq_midi
bluetooth              47360  9 sco,bnep,rfcomm,l2cap,btusb
psmouse                37672  0 
serio_raw               4620  0 
cfg80211               76536  3 iwlagn,iwlcore,mac80211
snd_seq                42172  6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer              17580  2 snd_pcm,snd_seq
snd_seq_device          6152  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
i2c_i801                8556  0 
pcspkr                  2204  0 
i2c_core               19844  4 i915,drm,i2c_algo_bit,i2c_i801
snd                    47664  14 snd_hda_codec_conexant,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore               6352  1 snd
thinkpad_acpi          54740  0 
snd_page_alloc          8040  2 snd_hda_intel,snd_pcm
rfkill                 16328  3 bluetooth,cfg80211,thinkpad_acpi
led_class               3868  2 iwlcore,thinkpad_acpi
wmi                     6204  0 
ac                      2852  0 
nvram                   6460  1 thinkpad_acpi
battery                 5844  0 
button                  5080  0 
processor              34404  3 acpi_cpufreq
ext3                  106216  1 
jbd                    41536  1 ext3
mbcache                 7008  2 ext2,ext3
sha256_generic         11232  0 
aes_i586                8108  2 
aes_generic            27452  1 aes_i586
cbc                     3028  1 
usbhid                 31536  0 
hid                    34436  1 usbhid
dm_crypt               11088  1 
sd_mod                 29584  3 
crc_t10dif              1648  1 sd_mod
uhci_hcd               19084  0 
ahci                   32748  2 
ehci_hcd               29800  0 
ata_generic             4364  0 
libata                150968  2 ahci,ata_generic
scsi_mod              132768  2 sd_mod,libata
e1000e                105536  0 
usbcore               122792  4 btusb,usbhid,uhci_hcd,ehci_hcd
nls_base                6784  1 usbcore
ide_pci_generic         3652  0 
intel_agp              23376  1 
ide_core               88828  1 ide_pci_generic
agpgart                30752  2 drm,intel_agp
video                  18296  1 i915
output                  2624  1 video
thermal                12600  0 
fan                     4064  0 
thermal_sys            13160  4 processor,video,thermal,fan
dm_mirror              12652  0 
dm_region_hash         10632  1 dm_mirror
dm_log                  8648  2 dm_mirror,dm_region_hash
dm_mod                 57692  11 dm_crypt,dm_mirror,dm_log

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
postinst_hook = update-grub
postrm_hook   = update-grub

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
BOOT=local
DEVICE=eth0
NFSROOT=auto

-- /etc/crypttab
sda2_crypt /dev/sda2 none luks


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

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

Versions of packages initramfs-tools depends on:
ii  cpio                          2.10-1     GNU cpio -- a program to manage ar
ii  findutils                     4.4.2-1    utilities for finding files--find,
ii  klibc-utils                   1.5.15-1   small utilities built with klibc f
ii  module-init-tools             3.10-1     tools for managing Linux kernel mo
ii  udev                          0.141-2    /dev/ and hotplug management daemo

Versions of packages initramfs-tools recommends:
ii  busybox                       1:1.14.2-1 Tiny utilities for small and embed

initramfs-tools suggests no packages.

-- no debconf information



Reply to: