Christian Jaeger wrote: >> and if the missing recursion of get_lvm_deps() is really >> the reason, why does it only fail on some kernels for you? >> > > As I did say in my previous mails, I don't know. > > And I don't know whether it's got anything to do with kernels. Or the > order in which something is initialized at boot, or the phase of moon, > or maybe whether I've got snapshots running. >
Hey, I've tested now with and without snapshots and it's clearly the culprit. See the attached observation log. You can see (1) that while there is a snapshot on the root volume, on my setup, the current cryptsetup from Debian is broken; it is *not* broken if I remove the snapshot. (2) I see confirmed that my patch works for me in both cases. So, I hope now you've got at least something to reproduce the case. Christian.
novo:/usr/src/linux# make modules_install ... DEPMOD 2.6.27.9 novo:/usr/src/linux# make install sh /mnt/rootextend/usr/src/linux_2.6.27/arch/x86/boot/install.sh 2.6.27.9 arch/x86/boot/bzImage System.map "/boot" novo:/usr/src/linux# linux-initrd-createinstall -c 2.6.27.9 update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../a 35897 blocks novo:/tmp/root# grep cryptroot a ./conf/conf.d/cryptroot ./scripts/local-top/cryptroot This was with my patched cryptsetup: ii cryptsetup 2:1.0.6-6.cj configures encrypted block devices Now I'm going to install the upstream one: novo:~# aptinstall cryptsetup=2:1.0.6-6 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be DOWNGRADED: cryptsetup 0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 152 not upgraded. Need to get 308kB of archives. After this operation, 135kB of additional disk space will be used. Do you want to continue [Y/n]? ... Setting up cryptsetup (2:1.0.6-6) ... update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../b 35897 blocks novo:/tmp/root# diff -u a b novo:/tmp/root# Remember, I've got no snapshot on the root volume -- and it works (gives same results as my patched version). To be sure, run the same thing manually (using my old wrapper script): novo:/usr/src/linux# linux-initrd-createinstall 2.6.27.9 update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../c 35897 blocks novo:/tmp/root# diff -u a c novo:/tmp/root# still ok. Now going to create a snapshot volume: novo:~# lvcreate -s -L1G -n snap_test /dev/main/root /dev/md1: read failed after 0 of 4096 at 0: Input/output error Logical volume "snap_test" created novo:~# --- Logical volume --- LV Name /dev/main/root VG Name main LV UUID M51c6n-rw9j-vKBU-UnIJ-GvXD-nVw0-7yisre LV Write Access read/write LV snapshot status source of /dev/main/snap_test [active] LV Status available # open 2 LV Size 17.43 GB Current LE 4462 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:11 novo:/usr/src/linux# linux-initrd-createinstall 2.6.27.9 update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root# diff -u a d --- a 2008-12-16 03:05:35.100636522 +0100 +++ d 2008-12-16 03:10:11.183837682 +0100 @@ -39,7 +39,6 @@ ./conf ./conf/arch.conf ./conf/conf.d -./conf/conf.d/cryptroot ./conf/conf.d/md ./conf/conf.d/resume ./conf/conf.d/uswsusp The snapshot broke it! novo:~# lvremove /dev/main/snap_test /dev/md1: read failed after 0 of 4096 at 0: Input/output error Do you really want to remove active logical volume "snap_test"? [y/n]: y Logical volume "snap_test" successfully removed novo:~# novo:/usr/src/linux# linux-initrd-createinstall 2.6.27.9 update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/usr/src/linux# novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../e 35897 blocks novo:/tmp/root# diff -u a e novo:/tmp/root# Removing the snapshot fixed it! Ok, we're going to break it again, then upgrade to my patched cryptsetup version: novo:~# lvcreate -s -L1G -n snap_test /dev/main/root /dev/md1: read failed after 0 of 4096 at 0: Input/output error Logical volume "snap_test" created novo:~# novo:/usr/src/linux# linux-initrd-createinstall 2.6.27.9 update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../f 35897 blocks novo:/tmp/root# diff -u a f --- a 2008-12-16 03:05:35.100636522 +0100 +++ f 2008-12-16 03:11:52.054081741 +0100 @@ -39,7 +39,6 @@ ./conf ./conf/arch.conf ./conf/conf.d -./conf/conf.d/cryptroot ./conf/conf.d/md ./conf/conf.d/resume ./conf/conf.d/uswsusp confirmed brokenness. novo:/SRCREBUILD# dpkg -i cryptsetup_1.0.6-6.cj_amd64.deb (Reading database ... 235730 files and directories currently installed.) Preparing to replace cryptsetup 2:1.0.6-6 (using cryptsetup_1.0.6-6.cj_amd64.deb) ... Unpacking replacement cryptsetup ... Setting up cryptsetup (2:1.0.6-6.cj) ... update-initramfs: deferring update (trigger activated) Processing triggers for man-db ... Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../g 35897 blocks novo:/tmp/root# diff -u a g novo:/tmp/root# My patch confirmedly fixed this. (For confirmation: novo:/usr/src/linux# linux-initrd-createinstall 2.6.27.9 update-initramfs: Generating /boot/initrd.img-2.6.27.9 cryptsetup: WARNING: found more than one resume device candidate: /dev/mapper/main-swap /dev/mapper/plain-plainswap W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. novo:/tmp/root/t# rm -rf *; gunzip < /boot/initrd.img-2.6.27.9|cpio --extract && find |sort > ../h 35897 blocks novo:/tmp/root# diff -u a h novo:/tmp/root# still fixed. )