PowerPath: How to set up a Linux host to use emcpower devices in LVM
Summary: This article explains the procedure to set up a Linux host to use emcpower devices in LVM.
Instructions
Root File System Not Mounted on a Logical Volume
Modify the filters field of the /etc/lvm/lvm.conf file to prevent LVM2 from scanning sd device nodes.
1. Modify the filter field in the /etc/lvm/lvm.conf file. Replace:
filter=["a/.*/"]
with:
filter=["r/sd*/", "a/.*/"]
2. Rebuild the LVM2 cache. Enter:
vgscan -v
3. Verify that the filter field is working correctly. Run the command below and verify that the filtered device nodes are not listed in the command output. Enter:
lvmdiskscan
Root File System Mounted on a Logical Volume
Identify the underlying device(s) for the root/swap logical volume(s) and the /boot devices (if any). Modify the filters field of the /etc/lvm/lvm.conf file to prevent LVM2 from scanning all sd device nodes except for root/swap and /boot device(s).
1. Identify the root/swap logical volume(s) and the /boot devices (if any). Enter:
df -k
or
mount
2. Identify the underlying device(s) for the root/swap logical volume(s). For example, if the root file system is mounted on logical volume /dev/vg01/lv01, enter:
vgdisplay -v /dev/vg01/lv01
3. Modify the filter field in the /etc/lvm/lvm.conf file to prevent LVM2 from scanning all sd device nodes except for root/swap and /boot devices identified in steps 1 and 2. For example, if the underlying device for the root/swap file system is /dev/sda2 and /boot is mounted on /dev/sda3, set the filter filter field to:
filter=["a/sda[1-9]$/", r/sd*/", "a/.*/"]
Modify the filter as needed using standard shell-scripting regular expressions. For example, to include partitions sda1 to sda9 for LVM2 while filtering out the remaining sd device nodes, set the filter field to filter=["a/sda[1-9]$/", "r/sd*/", "a/.*/"].
4. Rebuild the LVM2 cache. Enter:
vgscan -v
5. Verify that the filter field is working correctly. Run the command below and verify that the sd device nodes containing the root/swap/boot devices identified in steps 1 and 2 are listed in the command output, and that the filtered device nodes are not listed in the command output. Enter:
lvmdiskscan
6. Recreate the initrd image to reflect the changes to the /etc/lvm/lvm.conf file. Enter:
mkinitrd
Root File System Mounted on Mirrored Logical Volumes
Identify the underlying device(s) for the root/swap logical volume(s) and the /boot devices (if any). Modify the filters field of the /etc/lvm/lvm.conf file to prevent LVM2 from scanning all sd device nodes except for root/swap and /boot device(s). 1. Identify the root/swap logical volume(s) and the /boot devices(if any). Enter:
2. Identify the underlying device(s) for the root/swap and mirror logical volume(s). For example, if the root file system is mounted on logical volume /dev/vg01/lv01 and its mirror is mounted on /dev/vg01/lv02, enter:df -k
or
mount
3. Modify the filter field in the /etc/lvm/lvm.conf file to prevent LVM2 from scanning all sd device nodes except for root/swap and /boot devices identified in steps 1 and 2. For example, if the underlying logical device for the root/swap file system is /dev/sda2 and its mirror is /dev/sdb3, set the filter field to:vgdisplay -v /dev/vg01/lv01
vgdisplay -v /dev/vg01/lv02
Modify the filter as needed using standard shell-scripting regular expressions. For example, to include partitions sda1 to sda9 for LVM2 while filtering out the remaining sd device nodes, set the filter field to filter=["a/sda[1-9]$/", "r/sd*/", "a/.*/"]. 4. Rebuild the LVM2 cache. Enter:filter=["a/sda[1-3]$/", "a/sdb[1-3]$/", "r/sd.\*/", "a/.*/"]
5. Verify that the filter field is working correctly. Run the command below and verify that the sd device nodes containing the root/swap/boot devices identified in steps 1 and 2 are listed in the command output, and that the filtered device nodes are not listed in the command output. Enter:vgscan -v
6. Recreate the initrd image to reflect the changes to the /etc/lvm/lvm.conf file. Enter:lvmdiskscan
mkinitrd
Additional Information
You must modify the /etc/lvm/lvm.conf file to filter out sd device nodes from its internal cache so that LVM2 recognizes a PowerPath pseudo device as the single path to LUN.
The following sections describe how to modify /etc/lvm/lvm.conf on a host where the root file system is:
- Not mounted on a logical volume.
- Is mounted on a logical volume.
- Is mounted on mirrored logical volumes.
On RHEL 4.0, PowerPath 4.4.0 requires LVM2 version 2.01.08-1.0 and above due to Bugzilla #151657.
Filter syntax has changed for PowerPath 5.0:
If root is NOT on a logical volume:
RHEL5 / RHEL4.4:
filter = [ "r/sd.*/", "r/disk.*/", "a/.*/" ]
RHEL4.3 or lower:
filter=["r/sd.*/", "a/.*/"]
SLES10 SP1, SLES10, SLES9 SP3:
filter = [ "r|/dev/.*/by-path/.*|",
"r|/dev/.*/by-id/.*|",
"r|/dev/.*/by-name/.*|", "r/sd.*/", "a/.*/" ]
If root IS on a logical volume you need to script carefully to ensure that the correct devices are scanned or excluded from LVM support. Please see the PowerPath 5.0 installation guide for details.
PowerPath 4.4.0 for Linux supports the Sistina LVM2 on the RHEL 4.0 and SLES 9 SP1 platforms. PowerPath supports the creation of logical volumes on PowerPath pseudo devices only.