Account Links: Cart | Register | Log In

Skip to content

Red Hat Knowledgebase
Red Hat Knowledgebase Search
Article translations:
Currently Being Moderated

How do I setup device-mapper multipathing in Red Hat Enterprise Linux 4?

Article ID: 3691 - Created on: Nov 13, 2005 6:00 PM - Last Modified:  Sep 27, 2009 12:06 PM

Release Found: Red Hat Enterprise Linux 4 Update 2 and later

 

Note: This functionality does not exist in releases of Red Hat Enterprise Linux 4 prior to Update 2. We recommend using the latest available release of Red Hat Enterprise Linux version 4 or later releases.

 

Red Hat Enterprise Linux has native support for storage that has multiple paths presented to the OS. Configuring Red Hat Enterprise Linux to use the multipath functionality is a straightforward process, which we describe below.

 

Required Packages

 

Make sure that the device-mapper-multipath package and its dependencies are installed:

 

# rpm -q device-mapper-multipath
device-mapper-multipath-0.4.7-17.el5

 

If the package is not installed, use up2date in Red Hat Enterprise Linux 4, or yum in Red Hat Enterprise Linux 5 and later, to install the package and its dependencies.

 

Basic Configuration

 

The configuration for multipath is controlled by the file /etc/multipath.conf. The default attributes of this file are the best options in the majority of circumstances. For details on all of the options, see the following sources:

 

  • The annotated configuration file included with the package: /usr/share/doc/device-mapper-multipath-VERSION/multipath.conf.annotated

  • The Red Hat Guide to Multipath

 

Starting the Service

 

Multipath is controlled by the multipathd service. To start the service for the first time, execute the following commands:

 

# service multipathd start
# multipath -v2

 

The multipath -v2 command scans, identifies and configures multipath maps for devices that could have multiple paths to storage, as configured in /etc/multipath.conf. For example, it will create single-path maps for devices that are not excluded by blacklisting so that if secondary paths appear later they can be added.

 

The output of the above commands will look similar to the following:

 

create: SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1
[size=33 GB][features="0"][hwhandler="0"]
\\_ round-robin 0
  \\_ 0:0:0:0 sda  8:0

device-mapper ioctl cmd 9 failed: Invalid argument
device-mapper ioctl cmd 14 failed: No such device or address
create: 3600a0b80001327d80000006d43621677
[size=12 GB][features="0"][hwhandler="0"]
\\_ round-robin 0
  \\_ 2:0:0:0 sdb  8:16
  \\_ 3:0:0:0 sdf  8:80

create: 3600a0b80001327510000009a436215ec
[size=12 GB][features="0"][hwhandler="0"]
\\_ round-robin 0
  \\_ 2:0:0:1 sdc  8:32
  \\_ 3:0:0:1 sdg  8:96

create: 3600a0b80001327d800000070436216b3
[size=12 GB][features="0"][hwhandler="0"]
\\_ round-robin 0
  \\_ 2:0:0:2 sdd  8:48
  \\_ 3:0:0:2 sdh  8:112

create: 3600a0b80001327510000009b4362163e
[size=12 GB][features="0"][hwhandler="0"]
\\_ round-robin 0
  \\_ 2:0:0:3 sde  8:64
  \\_ 3:0:0:3 sdi  8:128

 

To enable the service to start automatically on boot, use the following command (this only needs to be run once):

chkconfig multipathd on

 

Understanding Multipath Device Names and Using Partitions

The multipath devices will be created as /dev/mapper/mpath#, where # is the multipath group. For example, if /dev/sdc is the only device with multiple paths, then /dev/mapper/mpath0 will be the multipath device for /dev/sdc and /dev/sdd. For more information on multipath device names, see When using device-mapper-multipath, the devices appear in three different places. Which device should I use for creating logical volumes?.

 

Note that fdisk cannot be used with the multipath devices. In order to create partitions, use fdisk on the underlying disks (e.g. /dev/sdc). Execute the following command when device-mapper-multipath maps the device to create a /dev/mapper/mpath# device for the partition:

 


kpartx -a /dev/mapper/mpath#

 

Note: dmsetup ls --target=multipath will list all active device-mapper multipath devices on a system.

Feedback from users like yourself is a critical factor in helping us make the Red Hat Knowledgebase as useful as possible.

More Like This

  • Retrieving data ...