LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > pantdk
User Name
Password

Notices

Rate this Entry

Multipath disk identify

Posted 09-16-2013 at 02:57 AM by pantdk
Updated 01-01-2014 at 01:14 PM by pantdk

To find the fiber port & model name in the server.
$sudo /sbin/lspci |grep -i "Fibre"

$ sudo /usr/bin/systool -c scsi_host -v "
$ sudo /usr/bin/systool -c fc_host -v "port name node name"

WWN & WWPN
We have Two HBA here example (host0 and host1).

To get the WWNN (World Wide Node Number) in Linux:

dpant# cat /sys/class/fc_host/host0/node_name
0x20000000c9538d93
dpant# cat /sys/class/fc_host/host1/node_name
0x20000000c9538dbc

To get the WWPN (World Wide Port Number) in Linux:

dpant# cat /sys/class/fc_host/host0/port_name0x10000000c9538d93
dpant# cat /sys/class/fc_host/host1/port_name0x10000000c9538dbc

Disk attached in the SAN now scan the disk without reboot of server then below are the command
#echo "- - -" > /sys/class/scsi_host/host0/scan (First hba)
# echo "- - -" > /sys/class/scsi_host/host1/scan (Second hba, if present)

Multipath disk check

multipath -ll

To scan disk of multipath
Multipath -v2


To identify which disk is associated with fc

dpant@~ $ ll /sys/class/fc_host/host*/device
lrwxrwxrwx 1 root root 0 Jul 16 06:36 /sys/class/fc_host/host1/device -> ../../../host1
lrwxrwxrwx 1 root root 0 Jul 16 06:37 /sys/class/fc_host/host2/device -> ../../../host2

dpant@~$ ll /sys/class/fc_remote_ports/rport*/device
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-1:0-0/device -> ../../../rport-1:0-0
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-1:0-1/device -> ../../../rport-1:0-1
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-1:0-2/device -> ../../../rport-1:0-2
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-1:0-3/device -> ../../../rport-1:0-3
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-2:0-0/device -> ../../../rport-2:0-0
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-2:0-1/device -> ../../../rport-2:0-1
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-2:0-2/device -> ../../../rport-2:0-2
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_remote_ports/rport-2:0-3/device -> ../../../rport-2:0-3

dpant@ ~ $ ll /sys/class/fc_transport/target*/device
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target1:0:0/device -> ../../../target1:0:0
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target1:0:1/device -> ../../../target1:0:1
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target1:0:2/device -> ../../../target1:0:2
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target1:0:3/device -> ../../../target1:0:3
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target2:0:0/device -> ../../../target2:0:0
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target2:0:1/device -> ../../../target2:0:1
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target2:0:2/device -> ../../../target2:0:2
lrwxrwxrwx 1 root root 0 Jul 16 06:38 /sys/class/fc_transport/target2:0:3/device -> ../../../target2:0:3

We can say here that serve have single card in which double port 05:00.0 05:00.1 the only difference is "0 & 1"
if the port number is totally different value (05:00.0 06:00.0) then we can say that there is two different cards of HBA


also we can check the card info from "lspci" command

dpant@ ~ $ ll /sys/block/sd*/device
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdaa/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdab/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdac/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdad/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sda/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdae/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdaf/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:4
lrwxrwxrwx 1 root root 0 Jul 15 23:48 /sys/block/sdag/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:5
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdah/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdai/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/1:0:0:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdaj/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdak/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdal/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdam/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdan/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:5
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdao/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdap/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/1:0:1:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdaq/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdar/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdas/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdat/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdau/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:5
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdav/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdaw/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:7
lrwxrwxrwx 1 root root 0 Jul 15 23:48 /sys/block/sdax/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sday/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:1
lrwxrwxrwx 1 root root 0 Jul 15 23:48 /sys/block/sdaz/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdba/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdbb/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:5
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdbc/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdbd/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-3/target2:0:3/2:0:3:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdb/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdc/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdd/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sde/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:5
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdf/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdg/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/2:0:1:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdh/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdi/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdj/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdk/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdl/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:5
lrwxrwxrwx 1 root root 0 Jul 15 23:48 /sys/block/sdm/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:6
lrwxrwxrwx 1 root root 0 Jul 15 23:48 /sys/block/sdn/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/2:0:0:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdo/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdp/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdq/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdr/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sds/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:5
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdt/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:6
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdu/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-2/target1:0:2/1:0:2:7
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdv/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:0
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdw/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:1
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdx/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:2
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdy/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:4
lrwxrwxrwx 1 root root 0 Jul 15 23:49 /sys/block/sdz/device -> ../../devices/pci0000:00/0000:00:03.0/0000:05:00.0/host1/rport-1:0-3/target1:0:3/1:0:3:5

when Multipath few disk path fails then we need to identify the path of the disk which have the issue mean we have to chose the correct HBA


error when multipath failed

@dpant04 log $ sudo zcat messages.1.gz |egrep 'down'
Jul 10 22:18:51 dpant04 multipathd: mpath2: sdy - directio checker reports path is down
Jul 10 22:18:52 dpant04 multipathd: mpath0: sds - directio checker reports path is down
Jul 10 22:18:52 dpant04 multipathd: mpath1: sdae - directio checker reports path is down
Jul 10 22:18:53 dpant04 multipathd: mpath5: sdp - directio checker reports path is down
Jul 10 22:18:53 dpant04multipathd: mpath2: sdr - directio checker reports path is down
Jul 12 20:45:39 dpant04 multipathd: mpath4: sdf - directio checker reports path is down
Jul 12 20:45:41 dpant04 multipathd: mpath3: sdaq - directio checker reports path is down
Jul 12 20:45:41 dpant04 multipathd: mpath0: sdl - directio checker reports path is down
Jul 12 20:45:42 dpant04 multipathd: mpath5: sdb - directio checker reports path is down
Jul 12 20:45:42 dpant04 multipathd: mpath6: sdg - directio checker reports path is down
Jul 12 20:45:43 dpant04 multipathd: mpath3: sdax - directio checker reports path is down
Jul 12 20:45:43 dpant04 multipathd: mpath4: sdav - directio checker reports path is down
Jul 12 20:45:44 dpant04 multipathd: mpath1: sdc - directio checker reports path is down
Jul 12 20:45:44 dpant04 multipathd: mpath4: sdf - directio checker reports path is down
Jul 12 20:45:45 dpant04 multipathd: mpath6: sdn - directio checker reports path is down
Jul 12 20:45:46 dpant04 multipathd: mpath4: sdbc - directio checker reports path is down
Jul 12 20:45:46 dpant04 multipathd: mpath6: sdaw - directio checker reports path is down
Jul 12 20:45:46 dpant04 multipathd: mpath3: sdaq - directio checker reports path is down
Jul 12 20:45:46 dpant04 multipathd: mpath0: sdl - directio checker reports path is down
Jul 12 20:45:47 dpant04 multipathd: mpath5: sdb - directio checker reports path is down
Jul 12 20:45:47 dpant04 multipathd: mpath4: sdm - directio checker reports path is down
Jul 12 20:45:47 dpant04 multipathd: mpath6: sdg - directio checker reports path is down
Jul 12 20:45:47 dpant04 multipathd: mpath3: sda - directio checker reports path is down
Jul 12 20:45:48 dpant04 multipathd: mpath3: sdax - directio checker reports path is down
Jul 12 20:45:48 dpant04 multipathd: mpath4: sdav - directio checker reports path is down
Jul 12 20:45:49 dpant04 multipathd: mpath6: sdbd - directio checker reports path is down
Jul 12 20:45:49 dpant04 multipathd: mpath5: sday - directio checker reports path is down
Jul 12 20:45:49 dpant04 multipathd: mpath1: sdc - directio checker reports path is down
Jul 12 20:45:49 dpant04 multipathd: mpath4: sdf - directio checker reports path is down
Jul 12 20:45:49 dpant04 multipathd: mpath5: sdi - directio checker reports path is down
Posted in Uncategorized
Views 252 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 12:50 PM.

Main Menu

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration