Bug#488332: LVM sysfs_scan with newer 2.6.x kernels needs deprecated sysfs layout
Stephen M. Benoit
linux at magnumline.com
Fri Jun 27 22:59:30 UTC 2008
Package: lvm2
Version: 2.02.06-4etch1
Severity: normal
File: /lib/lvm-200/lvm
Hi! I ran into an LVM bug when I upgraded my kernel to 2.6.25.9.
Briefly:
Upgrading kernel to 2.6.25.9, the LVM utilities could not find any Volume
Groups. This is due to the new /sys/block layout and the LVM sysfs_scan
expecting the old layout. Two fixes until sysfs_scan gets updated:
(1) configure kernel to use deprecated sysfs layout, or,
(2) set "sysfs_scan = 1" in /etc/lvm/lvm.conf.
In more detail:
In more recent 2.6.x kernels, the /sys/block/<device> are symlinks to
elsewhere in /sys/, instead actual directories like they used to be.
In the stable version of lvm2, pvscan, pvs, and (all?) other lvm tools skip
over the devices listed as symlinks in /sys/block/. This meant that none of
the Volume Groups or Physical Volumes were found.
I also note that /etc/lvm/lvm.conf uses the default setting of
sysfs_scan = 1
which checks if the device is a valid block device. I probably should have
just set this to 0, but to test another fix, I recompiled the kernel with
the options:
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
This reverted to the old layout of /sys/block/, and my Volume Groups came
back without other difficulty. But the kernel config warns that:
"None of these features or values should be used today, as they export
driver core implementation details to userspace or export properties which
can't be kept stable across kernel releases.
...
If enabled, this option will also move any device structures that belong
to a class, back into the /sys/class hierarchy, in order to support older
versions of udev and some userspace programs."
A real fix would be to adjust the sysfs_scan to use the new sysfs block
device layout (following symlinks).
Best regards,
Stephen Benoit
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (990, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.25.9
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages lvm2 depends on:
ii debconf [debconf-2.0] 1.5.11etch1 Debian configuration management sy
ii libc6 2.3.6.ds1-13etch5 GNU C Library: Shared libraries
ii libdevmapper1.02 2:1.02.08-1 The Linux Kernel Device Mapper use
ii libncurses5 5.5-5 Shared libraries for terminal hand
ii libreadline5 5.2-2 GNU readline and history libraries
ii libselinux1 1.32-3 SELinux shared libraries
ii libsepol1 1.14-2 Security Enhanced Linux policy lib
ii lvm-common 1.5.20 The Logical Volume Manager for Lin
lvm2 recommends no packages.
-- debconf information excluded
More information about the pkg-lvm-maintainers
mailing list