Table of Contents

multipath - How to Configure multipath in Linux



Configuration

/etc/multipath.conf

Creating multipath.conf

mpathconf --enable


Fix multipath Number

Method1
(abbr)

multipaths {
multipath {
       wwid         360060e800589590000008959000000xx
       alias        mpath0
}

multipath {
       wwid          360060e800589590000008959000000xx
       alias         mpath1
}


}
Method2

/var/lib/multipath/bindings #RHEL 4,5

mpath0 360060e80057094000000700000000xxx
mpath1 360060e80057094000000700000000xxx

/etc/multipath/bindings #RHEL 6

mpathb 360060e80057094000000700000000xxx
mpathc 360060e80057094000000700000000xxx


Operation

How to recognize multipath

[root@test-server1 etc]# /etc/init.d/multipathd start
[root@test-server1 etc]# multipath -ll
mpath0 (16465616462656166313a3100000000000000000000000000) dm-2 IET,VIRTUAL-DISK
[size=4.0G][features=0][hwhandler=0]
\_ round-robin 0 [prio=0][active]
 \_ 0:0:0:1 sda 8:0   [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 1:0:0:1 sdb 8:16  [active][undef]
[root@test-server1 etc]# ls -l /dev/mapper/mpath0
brw-rw---- 1 root disk 253, 2 Mar 28 21:27 /dev/mapper/mpath0


How to use multipath disk

# fdisk /dev/mapper/mpath0

# kpartx -a /dev/mapper/mpath0
# ls /dev/mapper/  <- check /dev/mapper/mpath0p1

# mkfs -t ext3 /dev/mapper/mpath0p1


Checking mpath devices

[root@host1 ~]# ls -l /dev/mapper
crw-------  1 root root  10, 63 10月 29 12:43 control
brw-rw----  1 root disk 253,  0 10月 29 12:43 mpath0
brw-rw----  1 root disk 253,  1 10月 29 12:43 mpath0p1
brw-rw----  1 root disk 253,  2 10月 29 12:43 mpath0p2
[root@host1 mapper]#


Testing of mount

# mkdir /mnt/test
# mount /dev/mapper/mpath0p1 /mnt/test


Tips

Changing Numbers

# /etc/init.d/multipathd stop

# multipath -F     <- delete
# multipath        <- reacknowledge

# /etc/init.d/multipathd start


Debug

-k multipathd will enter interactive mode. From this mode, the available commands can be viewed by entering “help”. When you are finished entering commands, press CTRL-D to quit.

# multipathd -k"show config"
# multipathd -k
multipathd> help

multipathd> show config

multipathd> show blacklist

multipathd> show device


multipathd> CTRL-D

Ref: DM-Multipath Administration and Troubleshooting ubuntu 14.04