Using LVM on local and SAN attached devices.

  • 3617600
  • 27-Jul-2006
  • 12-Jun-2018


SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 9
Logical Volume Management (LVM / LVM2)
Multipath I/O (MPIO)


A server is configured with system partitions carved out of logical LVM volumes stored on a local block device. After attaching a SAN and configuring the server for multipath (MPIO) using the SLES Storage Administration Guide, the local LVM volumes are no longer seen. The pvscan command does not show any local devices.

The default LVM filter, which activates LVM on all local storage devices, is as follows, and was originally in use on the machine:

filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|", "r|/dev/.*/by-name/.*|", "a/.*/"]

During the process of implementing MPIO, the LVM filter was changed to the following recommended configuration, which assumes LVM will only be used on the SAN devices:
filter = [ "a|/dev/disk/by-id/dm-uuid-.*mpath-.*|", "r|.*|"]
types = [ "device-mapper", 1 ]


To resolve this issue, modify the LVM filter to specifically scan both the local block device and the multipathing device nodes. Care should be taken to ensure the physical paths to the LUNs, typically represented as /dev/sd* devices, are excluded from the scan.

For example, if your local disk is /dev/sda and all SAN devices have the correct device nodes in /dev/disk/by-id/, the filter (in /etc/lvm/lvm.conf) should be similar to:

SLES11/12:  filter = [ "a|/dev/sda.*|", "a|/dev/disk/by-id/dm-uuid-.*mpath-.*|", "r|.*|"]
SLES10 : filter = [ "a|/dev/sda.*|", "a|/dev/disk/by-name/.*|", "r|.*|"]

If the local devices are on an HP SmartArray controller with cciss devices, the filter should look like:

SLES11/12:  filter = [ "a|/dev/cciss/.*|", "a|/dev/disk/by-id/dm-uuid-.*mpath-.*|", "r|.*|"]
SLES10 : filter = [ "a|/dev/cciss/.*|", "a|/dev/disk/by-name/.*|", "r|.*|"]

Likewise, for LVs on DASDs of IBM Z systems:

SLES11/12:  filter = [ "a|/dev/dasd.*|", "a|/dev/disk/by-id/dm-uuid-.*mpath-.*|", "r|.*|"]
SLES10 : filter = [ "a|/dev/dasd.*|", "a|/dev/disk/by-name/.*|", "r|.*|"]

After implementing the above filter, execute `pvscan`, `vgscan` and `lvscan` to activate the new configuration (In SLES12 you need first to restart lvm2-lvmetad service).

When using the filter specifically references the acceptable block devices, the 'types' setting in /etc/lvm/lvm.conf may be commented out as follows:

#types = [ "device-mapper", 1 ]

Additional Information

The following filter is not correct for use with multipathing:

filter = [ "a|/dev/sd.*|", "a|/dev/disk/by-name/.*|", "r|.*|"]
This filter scans all /dev/sd* and activates them for use with LVM. Multipathed devices use device nodes created under /dev/disk/by-id, but also have /dev/sd* device nodes created for each physical path to the LUN. If these raw device nodes are scanned by LVM, there is a possibility that the LVM metadata will be read and activated on a raw path, rather than the multipath device node. This will result in a loss of fault tolerance and load balancing.

Note: After LVM filter modification run "mkinitrd" to rebuild the initrd file with new configuration. 

For additional information on using LVM on MPIO devices, see TID 7007498 - Using LVM on Multipath (DM MPIO) Devices.

Change Log

2018 Jun 12: Joerg Reuter - Add IBM Z example
2017 Nov 7: Ahmad Al Zayed - Add a note regarding lvm2-lvmetad. 
2017 Nov 1: Ahmad Al Zayed - Add a note regarding initrd. 
2011 Jan 7: Mike Latimer - Updated to reference new documentation and additional TID.
2009 Sep 18: Jason Record - Updated products, label and emphasis.