lvm on cryptsetup with initramfs infinite loop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm-common (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: lvm-common
Hey, I updated to edgy recently and there is a minor problem with the initramfs cryptroot and lvm scripts. First my setup... I have a luks encrypted partition on sda4, and inside that partition I have lvm, with lvm partitions for dapper root, edgy root, home, and some others.
/dev/sda4 ->
[cryptsetup luksOpen] /dev/mapper/
[vgchange -ay] /dev/mapper/
The problem is with both lvm and cryptsetup installed, the local-top/lvm script goes into an infinite loop. In my setup, the local-top/lvm script can be completly skipped, since the required lvm vgchange commands are carried out in local-top/
So what I did is add the following code into local-top/lvm directly before the loop.
# check that the device is actually a lvm device
if ! pvscan | grep 'VG ${vg}' > /dev/null 2>&1; then
exit 0
fi
slumber=360
while [ ${slumber} -gt 0 -a ! -d "/dev/${vg}" ]; do
pvscan > /dev/null 2>&1
vgchange -ay ${vg} > /dev/null 2>&1
/bin/sleep 0.5
slumber=$(( ${slumber} - 1 ))
done
vgchange -ay ${vg}
This works prefectly for me, since it just exits out there and continues to the cryptroot script.
I believe that this breaks the intended functionality of the loop. The purpose of the loop is to keep scanning devices until the ones containing the volume group appear, then enable the volume group. The line you added performs essentially the same scan only once, and if it is not found the first time, carries on.
In other words, you would accomplish the same thing by simply removing the while loop and letting the body execute only one time, which is how this script looked in edgy. It was changed in dapper because sometimes it takes some time for the disks to be detected and we don't want the script to decide it can't find the vg when it just needs to wait a while.