Multipath Device Identifiers
Each multipath device has a World Wide Identifier (WWID), which is guaranteed to be globally unique and unchanging. By default, the name of a multipath device is set to its WWID. For example, a node with two HBAs attached to a storage controller with two ports via a single unzoned FC switch sees four devices: /dev/sda, /dev/sdb, /dev/sdc, and /dev/sdd. DM-Multipath creates a single device with a unique WWID that reroutes I/O to those four underlying devices according to the multipath configuration
# multipath -ll
360080e50001818f80000138754ee12d6 dm-6 IBM,1814 FAStT
size=500G features='1 queue_if_no_path' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=14 status=active
| `- 1:0:0:18 sdk 8:160 active ready running
`-+- policy='round-robin 0' prio=9 status=enabled
`- 1:0:1:18 sdy 65:128 active ready running
Alternately, you can set the user_friendly_names option in the multipath configuration file, which causes DM-Multipath to use a node-unique alias of the form mpathn as the name. The name of the multipath device is set to mpathn. When new devices are brought under the control of DM-Multipath, the new devices may be seen in two different places under the /dev directory: /dev/mapper/mpathn and /dev/dm-n.
The devices in /dev/mapper are created early in the boot process. Use these devices to access the multipathed devices, for example when creating logical volumes
Any devices of the form /dev/dm-n are for internal use only and should never be used.
Multipath Devices in Logical Volumes
After creating multipath devices, you can use the multipath device names just as you would use a physical device name when creating an LVM physical volume.
Creating pv using multipath device
For example, if /dev/mapper/mpatha is the name of a multipath device, the following command will mark /dev/mapper/mpatha as a physical volume.
# pvcreate /dev/mapper/lun1
If you attempt to create an LVM physical volume on a whole device on which you have configured partitions, the pvcreate command will fail.
When you create an LVM logical volume that uses active/passive multipath arrays as the underlying physical devices, you should include filters in the lvm.conf to exclude the disks that underlie the multipath devices. This is because if the array automatically changes the active path to the passive path when it receives I/O, multipath will failover and failback whenever LVM scans the passive path if these devices are not filtered. For active/passive arrays that require a command to make the passive path active, LVM prints a warning message when this occurs.
Filter all physical devices underlying multipath devices
To filter all SCSI devices in the LVM configuration file (lvm.conf), include the following filter in the devices section of the file.
filter = [ "r/block/", "r/disk/", "r/sd.*/", "a/.*/" ]
update-initramfs -u -k all
Every time either /etc/lvm.conf or /etc/multipath.conf is updated, the initrd should be rebuilt to reflect these changes. This is imperative when blacklists and filters are necessary to maintain a stable storage configuration.