Bug#330900: lvm2 vs. udev (LVM2 does not scan non-partitioned block devices)

Sergio Gelato Sergio.Gelato at astro.su.se
Tue Aug 1 11:23:03 UTC 2006


I can reproduce this bug, or a very similar one. And I think I now have
a cure for it; see below.

My setup:
* boot disk is /dev/hda, with a PV on /dev/hda8.
* /dev/sda and /dev/sdb are PVs on an external SCSI controller.
* Kernel 2.6.12 (self-compiled, based on an earlier package from
  testing, with only security patches added), with udev from Debian sarge
  (should I upgrade udev?). For hardware compatibility reasons,
  downgrading the kernel to 2.6.8 is not an option.

After some experimentation, I've found out that:
1. pvscan -vvv, when run at S25 or S26 of rcS.d, does not see /dev/sda
   or /dev/sdb . It finds /dev/hda8 all right.
2. At that time, /proc/scsi/scsi already shows the two SCSI disks; so it
   doesn't seem to be a module loading issue.
3. Also at that time, "ls -l /dev/sda /dev/sdb" doesn't show anything.
   pvscan doesn't look in /dev/.static/dev by default; maybe one could
   tell it to.

It looks like:
* rcS.d/S04udev populates /dev by running /sbin/udevstart, but does not
  start udevd. It does tell the hotplug subsystem about udevsend, which
  presumably starts udevd the first time it is run.
* Modules from /etc/modules, including the one for my SCSI controller,
  aren't loaded until rcS.d/S20modutils.
* When is udevd started? Apparently sometime around rcS.d/S36discover;
  in any case after rcS.d/S26lvm. 

I've now added the following script as /etc/rcS.d/S20udevstart:

#! /bin/sh

ls -l /dev > /root/debug.S20udevstart.pre
[ -x /sbin/udevstart ] && /sbin/udevstart
ls -l /dev > /root/debug.S20udevstart.post

The result is that (a) all my PVs are now found, VGs activated, LVs
mounted during the normal boot sequence; and (b) diffing the .pre
and .post files shows that /dev/sda and /dev/sdb have been added
by this udevstart run.




More information about the pkg-lvm-maintainers mailing list