Linux MultiPathing Howto. By Syed Asim Abbas
Date: 24-10-2009
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Device Mapper Multipath (DM-MP) allows nodes to route I/O over multiple paths to a storage controller.
A path refers to the connection from an HBA port to a storage controller port. As paths
fail and new paths come up, DM-MP reroutes the I/O over the available paths.
Easy way to configure Multipathing
------------------------------------
[root@power root]# rpm -qa |grep multipath
device-mapper-multipath-0.4.8-7.fc10.i386
[root@power root]# fdisk -l
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3f443f43
Device Boot Start End Blocks Id System
Disk /dev/sdg: 107.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdn: 107.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdh: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdo: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
MultiPathing packaged avilable on Distribution
###Check the SCSI IDs to see the disk are pairs. /dev/sda is my system disk so no need to configure it for multipathing. Sdg , sdn, sdh and sdo are SAN connected disks.
[root@power root]# scsi_id -g -u -s /block/sdg
360060e8005bcaf000000bcaf00006024
[root@power root]# scsi_id -g -u -s /block/sdn
360060e8005bcaf000000bcaf00006024
[root@power root]# scsi_id -g -u -s /block/sdh
360060e8005bcaf000000bcaf00005033
[root@power root]# scsi_id -g -u -s /block/sdo
360060e8005bcaf000000bcaf00005033
##Ok sdg,sdn Pair and sdh,sdo Pair .
###To implement multipath environment, you must define the alias names for the multipath devices by editing the multipath.conf file that resides in the /etc/ directory:
[root@power root]# vi /etc/multipath.conf
# Blacklist all devices by default. Remove this to enable multipathing
# on the default devices.
blacklist {
devnode "*"
}
##############Comment The above lines
# Blacklist all devices by default. Remove this to enable multipathing
# on the default devices.
#blacklist {
# devnode "*"
#}
#########Define the Disks Aliases ##########
multipaths {
multipath {
wwid 360060e8005bcaf000000bcaf00006024
alias ora1
}
multipath {
wwid 360060e8005bcaf000000bcaf00005033
alias ora2
}
}
####### Save the configuration
[root@power root]# chkconfig multipathd on
[root@power root]# service multipathd restart
Stopping multipathd daemon: [FAILED]
Starting multipathd daemon: [ OK ]
[root@power root]#
[root@power root]# fdisk -l
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3f443f43
Device Boot Start End Blocks Id System
Disk /dev/sdg: 107.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdn: 107.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdh: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdo: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
##########No update same result. Restart the system and run fdisk -l
[root@power root]# fdisk -l
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3f443f43
Device Boot Start End Blocks Id System
Disk /dev/sdg: 107.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdn: 107.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdh: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdo: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/dm-0: 70.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/dm-1: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/mpath/ora1: 70.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
Disk /dev/mpath/ora2: 153.0 GB, 60011642880 bytes
Device Boot Start End Blocks Id System
#########Ok four more disks are aviavlable. Don't confude just used your paths /dev/mpath/ora1 /dev/mpath/ora2
[root@power root]# ls /dev/mpath*
ora1 ora2
####Disks multipath names are available now. Mount the devices using new name.
[root@power root]# mount /dev/mpath/ora1 /ora1
[root@power root]# mount /dev/mpath/ora2 /ora2
For testing unplugged one fiber link and see the results.