Linux Admin Reference – Device Mapper Multipath ( DM-Multipath) Configuration – Red Hat Enterprise Linux 6
Other Learning Articles that you may like to read
Free Courses We Offer
Paid Training Courses we Offer
In Enterprise Linux Environment, External storage often permits devices to be accessed by multiple physical paths. This improves redundancy and availability. SAN environment Red Hat Enterprise Linux provides the device-mapper-multipath component to manage multipath capable storage and to present multipath devices to applications running on the system. Device mapper multipath includes built-in support for common storage arrays.
The supported devices and configuration defaults can be found in the in /usr/share/doc/device-mapper-multipath-*/multipath.conf.defaults file.
This article describes to procedure to Configure DM-Multipath in RHEL6
Installation of DM-Multipath Components:
Step 1: If not already installed, install the device-mapper-multipath package:
# yum install device-mapper-multipath
Step 2: Enable device mapper multipath
Generate a default /etc/multipath.conf file using the mpathconf command. To determine the default settings for the installed version use the –help option:
# mpathconf –help
usage: /usr/sbin/mpathconf <command>Commands:
Enable: –enable
Disable: –disable
Set user_friendly_names (Default n): –user_friendly_names <y|n>
Set find_multipaths (Default n): –find_multipaths <y|n>
Load the dm-multipath modules on enable (Default y): –with_module <y|n>
start/stop/reload multipathd (Default n): –with_multipathd <y|n>
chkconfig on/off multipathd (Default y): –with_chkconfig <y|n>
Options that default to the required value do not need to be specified on the command line.
For example, to enable multipath with the user friendly names feature leaving all other options set to the default values, issue the following command:
# mpathconf –enable –user_friendly_names y
How to BlackList Certain Storage from Multipath
Device mapper multipath supports a number of mechanisms to allow blacklisting of devices that match certain criteria. A blacklisted device will be skipped when detecting and creating multipath devices.
One use for this mechanism is to exclude local devices (built-in disks, or removable media, for example) from the multipath configuration. This allows those devices to continue to be used as normal single-path devices without interference from the multipath subsystem.
To Blacklist some Storage Devices, Edit the blacklist section in /etc/multipath.conf and add the device section with the vendor and model indicated in /var/log/messages :
blacklist {
……
device {
vendor Generic
model External
}
}
then, reload multipath configuration
# service multipathd reload
Connect the external hard drive and check if it can be mounted.
Device mapper multipath also includes a built-in blacklist to exclude devices that do not support multiple paths. This list is preconfigured and does not need to be included in multipath.conf to be effective. The current set of built-in blacklists is as follows:
blacklist {
devnode “^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*”
}
Versions of device mapper multipath in Red Hat Enterprise Linux 6 and later include the ‘find_multipaths’ feature. This excludes any device from multipath configuration until at least two paths to the device have been detected simultaneously. This is an effective alternative to manual blacklisting that requires less configuration and maintenance for common scenarios. The feature is enabled by adding the following line to the global ‘defaults’ section of multipath.conf:
defaults {
…
find_multipaths yes
…
}
Customisation to the Storage Multipath Configuration
Device mapper multipath will apply different settings based on the make (vendor) and model (product) of storage in use. The default values for any given release may be found in the file /usr/share/doc/device-mapper-multipath-*/multipath.conf.defaults. You can use this file as template file to configure appropriate settings to /etc/multipath.conf and modifying parameters as desired.
Note: We normally don’t need any changes to this defaults file, except for those storage arrays that may be configured to operate in multiple failover modes (for instance standards-based ALUA mode or a proprietary failover mode specific to the array vendor). In this case array-specific configuration steps may be required.
- To determine the make and model of any storage device attached to the system
check the information provided in the /proc and /sys file systems.
- To view all attached SCSI devices:
# cat /proc/scsi/scsi
For example, a system attached to an EMC CLARiiON storage array may include entries similar to the following:
Attached devices:
Host: scsi11 Channel: 00 Id: 00 Lun: 00
Vendor: DGC Model: RAID 0 Rev: 0851
Type: Direct-Access ANSI SCSI revision: 04
…
- To determine vendor and model (product) strings for a specific SCSI disk device (replace sda with the device in question):
# cat /sys/block/sda/device/vendor
DGC# cat /sys/block/sda/device/model
RAID 5
- Finally, Review the configuration and amend as necessary based on device configuration and vendor recommendations.
How do we Detect and configure Multipath devices in your RHEL6
In order to detail and configure multipath devices , we need to have a multipath.conf file. Once we have the basic file we can customize the configuration with appropriate settings.
Just Run the multipath command to detect and configure multipath devices:
# multipath
mpatha (3600601f0d057000018fc7845f46fe011) dm-1 DGC,RAID 0
size=98G features=’0′ hwhandler=’1 emc’ wp=rw
|-+- policy=’round-robin 0′ prio=1 status=active
| – 11:0:0:0 sdd 8:128 active ready running
| – 10:0:0:0 sde 8:64 active ready running
-+- policy=’round-robin 0′ prio=0 status=enabled
|- 8:0:0:0 sdc 8:32 active ready running
– 9:0:0:0 sdf 8:80 active ready runningThe command can print additional information which may be of use in diagnosing problems or creating custom configurations. This includes information on blacklist settings and the matching of storage devices to built-in configurations. Specifying a verbose option with the -v<number> option enables this additional output:
May 05 16:48:56 | Found matching alias [mpatha] in bindings file.
Setting wwid to 3600601608e661a00e4710bf88370e211
May 05 16:48:56 | ram0: device node name blacklisted
May 05 16:48:56 | ram1: device node name blacklisted
May 05 16:48:56 | ram2: device node name blacklisted
<snip>
May 05 16:48:56 | loop5: device node name blacklisted
May 05 16:48:56 | loop6: device node name blacklisted
May 05 16:48:56 | loop7: device node name blacklisted
May 05 16:48:56 | sr0: device node name blacklisted
May 05 16:48:56 | sda: device node name blacklisted
May 05 16:48:56 | sdc: not found in pathvec
May 05 16:48:56 | sdc: mask = 0x3f
May 05 16:48:56 | sdc: dev_t = 8:32
May 05 16:48:56 | sdc: size = 10485760
May 05 16:48:56 | sdc: subsystem = scsi
May 05 16:48:56 | sdc: vendor = DGC
May 05 16:48:56 | sdc: product = RAID 5
May 05 16:48:56 | sdc: rev = 0220
May 05 16:48:56 | sdc: h:b:t:l = 3:0:0:1
May 05 16:48:56 | sdc: tgt_node_name = 0x50060160ba601693
May 05 16:48:56 | sdc: serial = FCNPR063600652
May 05 16:48:56 | sdc: get_state
May 05 16:48:56 | loading /lib64/multipath/libcheckemc_clariion.so checker
…
Display and review the configuration with:
# multipath -ll
mpatha (3600601f0d057000018fc7845f46fe011) dm-1 DGC,RAID 0
size=98G features=’0′ hwhandler=’1 emc’ wp=rw
|-+- policy=’round-robin 0′ prio=1 status=active
| – 11:0:0:0 sdd 8:128 active ready running
| – 10:0:0:0 sde 8:64 active ready running
-+- policy=’round-robin 0′ prio=0 status=enabled
|- 8:0:0:0 sdc 8:32 active ready running
– 9:0:0:0 sdf 8:80 active ready running
hi ramdev,
i have some query on multipathing can you pls ur mail id to discuss