Why do I get I/O errors when I run lvm commands on my system configured with multipath in RHEL?
Updated -
Issue
- If a active/passive storage array is used in a multipath configuration there is a set of LUN that are managed by the passive controller. If an application tries to access them the storage array will return an I/O error. Some lvm commands, like pvscan or vgscan for instance, needs to scan the devices available in the system to find lvm metadata. Each time one of the command tries to access a passive LUN it will generate I/O errors.
Environment
- Red Hat Enterprise Linux
- Storage LUN(s) operating in an active/passive mode which fails I/O sent down the passive path
Resolution
To avoid this problem filtering needs to be configured in /etc/lvm/lvm.conf to restrict the scan process only to the local disks and the multipath devices. To do so the following line should be added to /etc/lvm/lvm.conf to enable scanning of device-mapper block devices:
types = [ "device-mapper", 1]
To only scan mpath devices, change the filter line in lvm.conf to:
filter = [ "a/dev/mapper/.*/", "r/.*/" ]
If the local disks use lvm, add them into the filter configuration. For example, use the local cciss disks it requires:
filter = [ "a/dev/mapper/.*/", "a/dev/cciss/.*/", "r/.*/" ]
To include a volume on the second partition of the first local scsi disk add the following:
filter = [ "a/dev/mapper/.*/", "a/dev/sda2$/", "r/.*/" ]
After making those changes run this command to ensure the lvm cache is regenerated:
# vgscan
Comments