Beruflich Dokumente
Kultur Dokumente
In a multipath environment, more than one SCSI device (SD) points to the same
physical device. Using LVM on SD devices results in the duplicate entries being
reported during the LVM scan.
Depending on the order of the scan, it is conceivable that the LVM volumes are
specifically tied to particular SD devices instead of the multipath infrastructure.
This may result in multipath infrastructure not providing failover capabilities in
the event of a SAN failure or device unavailability.
The LVM2 configuration does not scan for multipath devices. For LVM2 operation in a
multipath environment with DM-MPIO, the SD devices must be filtered out and the
device mapper devices must be included as part of the volume scan operation. To
configure LVM2 for DM-MPIO on RHEL 4 and RHEL 5 follow these:
types = [ "device-mapper", 1]
Filter out all sd devices from the system and choose to scan for multipath
devices by adding the following line.
If there are Logical Volumes on devices that are not controlled by multipath,
enable selective scanning of those devices. In the following example, the partition
sda2 contains a Logical Volume. However, the SD device is not under multipath
control. To enable scanning for this device, set the following filter as follows:
5. Execute the lvmdiskscan command and ensure that the required SCSI devices are
scanned and that the LVM volume groups and partitions are available.
Notes: For more information, refer to the EMC Linux Host Connectivity guide on
Powerlink or EMC Support.
-----------------------------------------------------------------------------------
--------------------------------------
Notes:
For example, with Red Hat Linux and the Root File System Not Mounted on a Logical
Volume
filter=["a/.*/"]
with:
filter=["r/sd.*/", "a/.*/"]
or
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
Notes: The following is an example of what will be seen without using the
correct filter with LVM2 and PowerPath for Linux 4.4.0
Note this example is NOT applicable with RHEL4u4, see next note for RHEL4U4
We start with a newly created file system which is on a LVM2 logical volume, see
Knowledgebase solution emc118890 for details on creating this.
# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 68389076 2641008 62274012 5% /
/dev/sda1 101086 12631 83236 14% /boot
none 1037500 0 1037500 0% /dev/shm
/dev/mapper/testVG-testLV
1032088 1284 978376 1% /test
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "testVG" using metadata type lvm2
# vgscan -v
Wiping cache of LVM-capable devices
Wiping internal VG cache
Reading all physical volumes. This may take a while...
Finding all volume groups
Finding volume group "testVG"
Found volume group "testVG" using metadata type lvm2
Now using the lvmdiskscan command scan for all devices visible to LVM2
# lvmdiskscan
/dev/sdq [ 8.43 GB]
/dev/sda1 [ 101.94 MB]
/dev/emcpowera1 [ 8.43 GB] LVM physical volume
/dev/sda2 [ 2.00 GB]
/dev/root [ 66.26 GB]
/dev/sdb [ 11.25 MB]
/dev/sdr [ 63.21 GB]
/dev/emcpowerb [ 8.43 GB]
/dev/sds [ 134.85 GB]
/dev/emcpowerc [ 8.43 GB]
/dev/sdd [ 8.43 GB]
/dev/sdt [ 8.43 GB]
/dev/emcpowerd [ 8.43 GB]
/dev/sde [ 8.43 GB]
/dev/sdu [ 8.43 GB]
/dev/emcpowere [ 63.21 GB]
/dev/sdf [ 8.43 GB]
/dev/sdv [ 8.43 GB]
/dev/emcpowerf [ 134.85 GB]
/dev/sdg [ 63.21 GB]
/dev/emcpowerg [ 8.43 GB]
/dev/sdw1 [ 8.43 GB]
/dev/sdh [ 134.85 GB]
/dev/emcpowerh [ 8.43 GB]
/dev/sdi [ 8.43 GB]
/dev/emcpoweri [ 8.43 GB]
/dev/sdj [ 8.43 GB]
/dev/emcpowerj1 [ 8.43 GB]
/dev/sdk [ 8.43 GB]
/dev/sdl1 [ 8.43 GB]
/dev/sdm [ 11.25 MB]
/dev/sdo [ 8.43 GB]
/dev/sdp [ 8.43 GB]
27 disks
5 partitions
0 LVM physical volume whole disks
1 LVM physical volume
As you can see above the filter is not in place but PowerPath and LVM2 appear to be
working together nicely. Lets reboot and see what happens.
# reboot
After the reboot we log back in and we have a problem, vgscan and lvmdiskscan are
reporting duplicate physical volumes.
# vgscan
Reading all physical volumes. This may take a while...
Found duplicate PV kT5bpzX1DPK9wGxjjr80dRowFLeexudd: using /dev/sdc1 not
/dev/emcpowera1
Found duplicate PV kT5bpzX1DPK9wGxjjr80dRowFLeexudd: using /dev/sdn1 not
/dev/emcpowera1
Found volume group "testVG" using metadata type lvm2
# lvmdiskscan
/dev/sdq [ 8.43 GB]
/dev/sda1 [ 101.94 MB]
/dev/emcpowera1 [ 8.43 GB] LVM physical volume
/dev/sda2 [ 2.00 GB]
/dev/root [ 66.26 GB]
/dev/sdb [ 11.25 MB]
/dev/sdr [ 63.21 GB]
/dev/emcpowerb [ 8.43 GB]
/dev/sds [ 134.85 GB]
/dev/emcpowerc [ 8.43 GB]
Found duplicate PV kT5bpzX1DPK9wGxjjr80dRowFLeexudd: using /dev/sdc1 not
/dev/emcpowera1
/dev/sdc1 [ 8.43 GB] LVM physical volume
/dev/sdd [ 8.43 GB]
/dev/sdt [ 8.43 GB]
/dev/emcpowerd [ 8.43 GB]
/dev/sde [ 8.43 GB]
/dev/sdu [ 8.43 GB]
/dev/emcpowere [ 63.21 GB]
/dev/sdf [ 8.43 GB]
/dev/sdv [ 8.43 GB]
/dev/emcpowerf [ 134.85 GB]
/dev/sdg [ 63.21 GB]
/dev/emcpowerg [ 8.43 GB]
/dev/sdw1 [ 8.43 GB]
/dev/sdh [ 134.85 GB]
/dev/emcpowerh [ 8.43 GB]
/dev/sdi [ 8.43 GB]
/dev/emcpoweri [ 8.43 GB]
/dev/sdj [ 8.43 GB]
/dev/emcpowerj1 [ 8.43 GB]
/dev/sdk [ 8.43 GB]
/dev/sdl1 [ 8.43 GB]
/dev/sdm [ 11.25 MB]
Found duplicate PV kT5bpzX1DPK9wGxjjr80dRowFLeexudd: using /dev/sdn1 not
/dev/emcpowera1
/dev/sdn1 [ 8.43 GB] LVM physical volume
/dev/sdo [ 8.43 GB]
/dev/sdp [ 8.43 GB]
27 disks
5 partitions
0 LVM physical volume whole disks
3 LVM physical volumes
This can be fixed by putting the correct filter in place per the PowerPath for
Linux 4.4 Release Notes
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "testVG" using metadata type lvm2
# lvmdiskscan
/dev/emcpowera1 [ 8.43 GB] LVM physical volume
/dev/root [ 66.26 GB]
/dev/emcpowerb [ 8.43 GB]
/dev/emcpowerc [ 8.43 GB]
/dev/emcpowerd [ 8.43 GB]
/dev/emcpowere [ 63.21 GB]
/dev/emcpowerf [ 134.85 GB]
/dev/emcpowerg [ 8.43 GB]
/dev/emcpowerh [ 8.43 GB]
/dev/emcpoweri [ 8.43 GB]
/dev/emcpowerj1 [ 8.43 GB]
9 disks
1 partition
0 LVM physical volume whole disks
1 LVM physical volume
Notes: The following is an example of what will be seen without using the
correct filter with LVM2, RHEL4u4 and PowerPath for Linux 4.5.1
Note what happens with the default LVM filter, we see both emcpower and native
devices
-----------------------------------------------------------------------------------
----------------------------------
"Why do I see 'found duplicate pv' warnings when using LVM with multipathing
software in Red Hat Enterprise Linux?"
Question: Why do I see 'found duplicate pv' warnings when using LVM with
multipathing software in Red Hat Enterprise Linux?
Environment: OS: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Environment: EMC SW: PowerPath 5.3.1
Problem: # vgcreate vgSanData /dev/emcpowera
Found duplicate PV IBq2Fu90JZYA6tn5hk9dDha8maGcNvin: using /dev/sdd not
/dev/emcpowera
Found duplicate PV IBq2Fu90JZYA6tn5hk9dDha8maGcNvin: using /dev/sde not /dev/sdd
Found duplicate PV IBq2Fu90JZYA6tn5hk9dDha8maGcNvin: using /dev/sdh not /dev/sde
Found duplicate PV IBq2Fu90JZYA6tn5hk9dDha8maGcNvin: using /dev/sdi not /dev/sdh
Volume group "vgSanData" successfully created
Root Cause: With a default configuration, Logical Volume Manager (LVM) scans
all attached disks and determines which of them contain physical volumes. When
using device-mapper-multipath or other multipathing software such as EMC PowerPath
or Hitachi Dynamic Link Manager (HDLM), each path to a particular LUN is registered
as a different SCSI device, such as /dev/sdb, /dev/sdc, etc. The multipathing
software will then create a new device that maps to those individual paths such
as /dev/mapper/mpath1 (device-mapper-multipath), /dev/emcpowerb (EMC PowerPath), or
/dev/sddlmab (HDLM). Since each device points to the same LUN, they all contain
the same LVM metadata and thus when they are scanned they appear to be duplicates.
Upon running any LVM command, warnings such as the above may be printed
Fix: To ensure that LVM only scans the preferred multipath devices and not the
individual paths, a filter can be configured in /etc/lvm/lvm.conf.
When configuring a custom filter, the filter shown above, and any other filters
should either be removed or commented out with a '#' because LVM will only honor
one filter line.
The syntax of the filter accepts multiple regular expressions, enclosed in either
"a| |" (add) or "r| |" (remove), separated by commas. Any devices matching an
'add' regular expression are included in the scan, and any matching the 'remove'
expressions are omitted.
In most cases, it is beneficial to only add devices that are needed, and remove
everything else. This will prevent LVM from scanning devices which may take a long
time to respond, such as the CD-ROM or other non-block devices.
NOTE: If any local storage devices contain physical volumes, ensure that they are
included in the filter in addition to the multipath devices.
Example:
This is an example of a filter, which only scans device-mapper-multipath devices.
filter = [ "a|/dev/mapper/mpath.*|", "r|.*|" ]
Note that the above filter assumes the usage of user_friendly_names in the
multipath configuration. If physical volumes reside on local CCISS disks, they
should be added to the filter as well:
filter = [ "a|/dev/mapper/mpath.*|", "a|/dev/cciss/.*|", "r|.*|" ]
To include a volume on the second partition of the first local IDE disk in addition
to EMC PowerPath devices:
filter = [ "a|/dev/emcpower.*|", "a|/dev/hda2$|", "r|.*|" ]
After making those changes a rescan should be done to ensure all devices are
properly seen
# pvscan
# vgscan
NOTE: If the root filesystem resides on a logical volume, be certain that the above
scan commands list all physical volumes included in that volume group. If they are
not listed, do not reboot until a proper filter has been configured that allows for
scanning the necessary devices.