Bug#678954: lvm2: Inconsistencies between lvm.conf and udev rules lead to hide VG, and worse

bilibop project quidame at poivron.org
Mon Jun 25 10:47:11 UTC 2012

Package: lvm2
Version: 2.02.95-4
Severity: important

Dear Maintainer,

Here is the partition scheme of my system:

$ lsblk --noheadings -o TYPE,NAME,MOUNTPOINT /dev/sdb
disk  sdb
part  └─sdb1
lvm     ├─usb-boot (dm-0)  /boot
lvm     └─usb-luks (dm-1)
crypt     └─luks (dm-2)
lvm         ├─luks-root (dm-3) /
lvm         └─luks-home (dm-4) /home

It worked fine, but recently, and because several other drives using LVM can be
plugged on the same computer and I don't want to automatically activate them
when my system boots, I have modified the 'filter' assignment in
Knowing that:
$ ls -l /dev/disk/by-id | awk '/\/sdb1$/ {print $9}'

my filter is:
filter = [ "a|^/dev/disk/by-id/usb-Storage_Media_07BB103100182DD2-0:0-part1$|",
"a|^/dev/mapper/luks$|", "r|.*|" ]

# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "usb" using metadata type lvm2

The "luks" VG is not found !

In lvm.conf, only filter has been modified, and in the 'devices' section, I
have this default:
obtain_device_list_from_udev = 1

$ /sbin/udevadm info --query symlink --name dm-0

$ /sbin/udevadm info --query symlink --name dm-1

$ /sbin/udevadm info --query symlink --name dm-2

$ /sbin/udevadm info --query symlink --name dm-3
$ /sbin/udevadm info --query symlink --name dm-4

The symlinks exist (at least in /dev/mapper) but are no more managed by udev !
It seems they have been created from the initramfs environment.
After what, when udev runs again from the system environment, some rules I
don't understand make those symlinks no more managed by udev, and unusable by
LVM tools !

In /lib/udev/rules.d/60-persistent-storage-dm.rules:
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="persistent_storage_dm_end"

In /lib/udev/rules.d/60-persistent-storage-lvm.rules:

What about the two previous rules ?
What is the need to prevent creation of symlinks by udev the second time it
runs ?

After 'update-initramfs -u', I have to boot the system manually from the
initramfs shell, because
/conf/conf.d/cryptroot don't exist, because /dev/mapper/luks-root is not seen
as a Logical Volume,
and the 'cryptroot' initramfs hook fails. But I'm not sure I have to report a
bug against the cryptsetup
package for that.

When the responsible files 60-persistent-storage-{dm,lvm}.rules are copied in
and then the above rules are just commented, all works fine (symlinks,
cryptroot and other expected
behaviours). But I suppose that there can be side effects concerning temporary
nodes. What about ?


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-proposed-updates')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-486
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lvm2 depends on:
ii  dmsetup                   2:1.02.74-4
ii  initscripts               2.88dsf-22.1
ii  libc6                     2.13-33
ii  libdevmapper-event1.02.1  2:1.02.74-4
ii  libdevmapper1.02.1        2:1.02.74-4
ii  libreadline5              5.2-11
ii  libudev0                  175-3.1
ii  lsb-base                  4.1+Debian6

lvm2 recommends no packages.

lvm2 suggests no packages.

-- Configuration Files:
/etc/lvm/lvm.conf changed [not included]

-- no debconf information

More information about the pkg-lvm-maintainers mailing list