Bug#715184: lvm2: fails to boot with root on lvm, as wait loop for slow disk is too late

Luc Maisonobe luc at spaceroots.org
Sat Jul 6 17:34:44 UTC 2013

Package: lvm2
Version: 2.02.98-3
Severity: important
Tags: patch

Dear Maintainer,

Since kernel was updated to 3.9 on Jessie, my system completely failed to boot.
It was still able to boot with previous 3.2 kernel.

My configuration used several disks :
  /dev/sda1 : /boot
  /dev/sda2 : lvm partition, containing volume group vg00
  /dev/sd{b,c,d}1 : raid 5 array, containing another lvm partition, containing
volume group vg01

All system filesystems (/, /usr, swap, /var ...) are in the vg00 group, on the
same disk /boot is. The logical volumes
corresponding to these filesystems are vg00-root, vg00-swap ...
The vg01 group in the raid array contains only data partitions (/home,
/archive) and is not involved in the problem.

When attempting to boot on 3.9,  I always ended up in the busybox prompt in
The messages just before the prompt showed that the root partition in logical
volume vg00-root was not found.

However, if on the busyboc prompt I ran myself a command:

vgchange -a y

Then, all logical volumes were found and if I exited busibox, the rest of the
boot preceeded normaly.

After days of search, I found that what happened was that when the "lvm
lvchange" command that attempted to activate
the root logical volume was run from  local-top/lvm2 script,, the disks were
not ready yet. In fact, even /dev/disk was not
present in /dev. So the command failed and the local-top/lvm2 script exited.
After all scripts from local-top ended, the
boot process resumed execution of scripts/local and this script does include a
waiting loop, using either rootdelay or 30s
as its maximum wait. During the wait (in fact after less than one second), the
disks become ready, but since we have already
left the local-top/lvm2 script, we do not attempt anymore to run lvchange and
so the root file system does not appear.

As a consequence, the boot process gave up and an interactive session with
busybox was launched. At that time, I could
run vgchange myself, and it did complete normaly since at that time the disks
were available (/dev/disk exists, with all
subdirectories like /dev/disk/by-id and /dev/disk/by-path).

So basically, the problem is that we need another waiting loop *before* the
lvchange command in the local-top/lvm2 script.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.9-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lvm2 depends on:
ii  dmsetup                   2:1.02.77-3
ii  initscripts               2.88dsf-41
ii  libc6                     2.17-6
ii  libdevmapper-event1.02.1  2:1.02.74-7
ii  libdevmapper1.02.1        2:1.02.77-3
ii  libreadline5              5.2+dfsg-2
ii  libudev0                  175-7.2
ii  lsb-base                  4.1+Debian12

lvm2 recommends no packages.

lvm2 suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm2.patch
Type: text/x-diff
Size: 705 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20130706/acd3c45a/attachment.patch>

More information about the pkg-lvm-maintainers mailing list