[pkg-cryptsetup-devel] Bug#762032: cryptsetup: cryptroot fails on lvm if device isn't ready in time
Niall Walsh
niallwalsh at celtux.org
Wed Sep 17 21:36:43 UTC 2014
Package: cryptsetup
Version: 2:1.6.6-1
Severity: normal
With the rootfs on lvm on crypt on lvm on a usb device the system can (will) fail to boot if the usb device has not appeared in time.
The lvm initramfs-tools script will just call lvm lvchange for the root device, but in this case the root device is /dev/mapper/cryptvg-root which cannot be seen until the crypt device has been setup.
The cryptsetup initramfs-tools script will run activate_vg if the cryptsource does not exist, but if the device it is on is not present yet this won't help.
If the cryptsouce still does not exist then the rootdelay loop will be run, but this does nothing more then wait for the device to appear. Simply adding activate_vg inside this loop (e.g. on the line after the "/bin/sleep 0.1") will make the system bring up the prompt for the crypt devices password and then boot up. The debsums error below is due to that addition.
The above "fix" creates a lot of noise as each loop before the device appears will trigger a couple of lines of "no volume groups found".
Sorry if I missed anything and thanks for your work,
Niall
-- Package-specific info:
-- /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.16-2.slh.3-aptosid-amd64 root=/dev/mapper/cryptvg-root ro cryptopts=source=/dev/mapper/vg-crypt,target=cryptroot,lvm=cryptvg-root quiet
-- /etc/crypttab
# <target name> <source device> <key file> <options>
cryptroot /dev/mapper/vg-crypt none luks
-- /etc/fstab
UUID=47120949-a8f4-46a2-9abc-98fc6279a912 /boot ext4 defaults,relatime,errors=remount-ro 0 2
UUID=6d78821a-9796-4fa4-b643-64b67e73d31a / ext4 defaults,relatime,errors=remount-ro 0 1
-- lsmod
Module Size Used by
cpufreq_stats 3535 0
cpufreq_conservative 6616 0
cpufreq_powersave 982 0
af_packet 29254 2
intel_agp 11016 0
bochs_drm 15505 2
ttm 62823 1 bochs_drm
drm_kms_helper 41134 1 bochs_drm
drm 233783 5 ttm,bochs_drm,drm_kms_helper
syscopyarea 3438 1 bochs_drm
sysfillrect 3674 1 bochs_drm
sysimgblt 2159 1 bochs_drm
i2c_piix4 8649 0
fuse 78742 1
i2c_core 21182 3 drm,i2c_piix4,drm_kms_helper
intel_gtt 12280 1 intel_agp
pcspkr 1891 0
processor 23745 0
evdev 11032 4
pvpanic 1675 0
psmouse 85762 0
serio_raw 4393 0
button 4568 0
parport_pc 29663 1
ppdev 5638 0
lp 9883 0
parport 29749 3 lp,ppdev,parport_pc
autofs4 22913 2
ext4 343217 2
crc16 1319 1 ext4
jbd2 58309 1 ext4
mbcache 8795 1 ext4
xts 3063 1
gf128mul 5722 1 xts
algif_skcipher 6091 0
af_alg 4916 1 algif_skcipher
sd_mod 38684 2
crc_t10dif 1095 1 sd_mod
crct10dif_generic 1429 1
crct10dif_common 1332 2 crct10dif_generic,crc_t10dif
uas 16266 0
usb_storage 47348 2 uas
dm_crypt 16399 1
dm_mod 80028 12 dm_crypt
md_mod 102656 0
sg 22108 0
sr_mod 14871 0
cdrom 27134 1 sr_mod
ata_generic 3394 0
pata_acpi 3283 0
xhci_hcd 99281 0
ehci_pci 3624 0
ehci_hcd 42430 1 ehci_pci
usbcore 163179 5 uas,usb_storage,ehci_hcd,ehci_pci,xhci_hcd
ata_piix 24944 0
usb_common 1608 1 usbcore
libata 166437 3 pata_acpi,ata_generic,ata_piix
e1000 101292 0
scsi_mod 153282 6 sg,uas,usb_storage,libata,sd_mod,sr_mod
floppy 58764 0
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16-2.slh.3-aptosid-amd64 (SMP w/6 CPU cores; PREEMPT)
Locale: LANG=en_IE.utf8, LC_CTYPE=en_IE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages cryptsetup depends on:
ii cryptsetup-bin 2:1.6.6-1
ii debconf [debconf-2.0] 1.5.53
ii dmsetup 2:1.02.90-1
ii libc6 2.19-11
Versions of packages cryptsetup recommends:
ii busybox 1:1.22.0-8
ii console-setup 1.112
ii initramfs-tools [linux-initramfs-tool] 0.116
ii kbd 1.15.5-1
Versions of packages cryptsetup suggests:
ii dosfstools 3.0.26-3
pn keyutils <none>
ii liblocale-gettext-perl 1.05-8+b1
-- debconf information:
cryptsetup/prerm_active_mappings: true
-- debsums errors found:
debsums: changed file /usr/share/initramfs-tools/scripts/local-top/cryptroot (from cryptsetup package)
More information about the pkg-cryptsetup-devel
mailing list