References:
https://www.opentechguides.com/how-to/article/linux/18/fc-hba-linux.html
http://www.fibrevillage.com/sysadmin/9-storage/9-check-hba-card-and-its-driver-s-info-in-linux-rhel6
http://fibrevillage.com/storage/61-systool-a-useful-tool-for-san-as-well-for-sysfs-devices
https://access.redhat.com/articles/17054#NR2
https://access.redhat.com/articles/17628
Storage Connection Diagram
List your Fibre Channel Cards (HBAs) Hardware Info:
Determine the Manufacturer and Model of the HBAs (Fibre Channel Card):
[root@fcsmpsql4:~]# lspci | grep "Fibre Channel"
06:00.0 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
06:00.1 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
Get the Vendor and Device IDs for the HBAs installed:
| Vendor | 10df |
| Vendor Name | Emulex Corporation |
| Device | fe00 |
| Device Name | Zephyr-X LightPulse Fibre Channel Host Adapter |
[root@fcsmpsql4:~]# lspci -nn | grep "Fibre Channel"
06:00.0 Fibre Channel [0c04]: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter [10df:fe00] (rev 02)
06:00.1 Fibre Channel [0c04]: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter [10df:fe00] (rev 02)
[root@fcsmpsql4:~]# grep -e "10df Emulex Corporation" -e "fe00 Zephyr-X LightPulse Fibre Channel Host Adapter" /usr/share/hwdata/pci.ids
# List of PCI ID's
#
# Version: 2017.02.15
# Date: 2017-02-15 03:15:02
#
# Maintained by Albert Pool, Martin Mares, and other volunteers from
# the PCI ID Project at http://pci-ids.ucw.cz/.
#
# New data are always welcome, especially if they are accurate. If you have
# anything to contribute, please follow the instructions at the web site.
#
# This file can be distributed under either the GNU General Public License
# (version 2 or higher) or the 3-clause BSD License.
#
# Vendors, devices and subsystems. Please keep sorted.
# Syntax:
# vendor vendor_name
# device device_name
10df Emulex Corporation
fe00 Zephyr-X LightPulse Fibre Channel Host Adapter
Check if the HBA driver modules are installed:
[root@fcsmpsql4:~]# grep 10df /lib/modules/$(uname -r)/modules.* | grep fe00
/lib/modules/2.6.32-696.6.3.el6.x86_64/modules.pcimap:lpfc 0x000010df 0x0000fe00 0xffffffff 0xffffffff 0x00000000 0x00000000 0x0
Find HBA Kernel driver:
[root@fcsmpsql4:~]# lspci -v -s 06:00.0 | grep Kernel
Kernel driver in use: lpfc
Kernel modules: lpfc
Check if the drivers for HBA are loaded in the kernel:
[root@fcsmpsql4:~]# lsmod | grep -e Module -e lpfc
Module Size Used by
lpfc 664415 84
scsi_transport_fc 55235 1 lpfc
crc_t10dif 1209 2 sd_mod,lpfc
Collect information about HBA kernel module:
## -- HBA Kernel Module Dependencies -- ##
[root@fcsmpsql4:~]# modprobe --show-depends lpfc
WARNING: All config files need .conf: /etc/modprobe.d/fc-hba.conf.old, it will be ignored in a future release.
insmod /lib/modules/2.6.32-696.6.3.el6.x86_64/kernel/lib/crc-t10dif.ko
insmod /lib/modules/2.6.32-696.6.3.el6.x86_64/kernel/drivers/scsi/scsi_tgt.ko
insmod /lib/modules/2.6.32-696.6.3.el6.x86_64/kernel/drivers/scsi/scsi_transport_fc.ko
insmod /lib/modules/2.6.32-696.6.3.el6.x86_64/kernel/drivers/scsi/lpfc/lpfc.ko lpfc_lun_queue_depth=16 lpfc_nodev_tmo=30 lpfc_discovery_threads=32 lpfc_lun_queue_depth=16 lpfc_nodev_tmo=30 lpfc_discovery_threads=32
## -- HBA Author Infomation -- ##
[root@fcsmpsql4:~]# modinfo -a lpfc
Emulex Corporation - tech.support@emulex.com
## -- HBA Description -- ##
[root@fcsmpsql4:~]# modinfo -d lpfc
Emulex LightPulse Fibre Channel SCSI driver 11.0.0.6
## -- HBA Kernel Module Filename -- ##
[root@fcsmpsql4:~]# modinfo -n lpfc
/lib/modules/2.6.32-696.6.3.el6.x86_64/kernel/drivers/scsi/lpfc/lpfc.ko
## -- HBA Kernel Module Licence Info -- ##
[root@fcsmpsql4:~]# modinfo -l lpfc
GPL
## -- HBA Kernel Module Version and Source Version -- ##
[root@fcsmpsql4:~]# modinfo lpfc | grep -e ^version -e srcversion
version: 0:11.0.0.6
srcversion: 2BC7C844F14E68EDDECDE59
## -- Check if the current HBA Kernal module is the same with the current kernel one -- ##
[root@fcsmpsql4:~]# uname -r
2.6.32-696.6.3.el6.x86_64
[root@fcsmpsql4:~]# modinfo -k $(uname -r) -n lpfc
/lib/modules/2.6.32-696.6.3.el6.x86_64/kernel/drivers/scsi/lpfc/lpfc.ko
Check How many HBAs (Fibre Channels Card) you have - Two Cards here (host1, and host2):
[root@fcsmpsql4:~]# ls -lh /sys/class//fc_host/
total 0
lrwxrwxrwx 1 root root 0 May 10 14:50 host1 -> ../../devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/fc_host/host1
lrwxrwxrwx 1 root root 0 May 10 17:40 host2 -> ../../devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/fc_host/host2
OR
[root@fcsmpsql4:~]# systool -c fc_host
Class = "fc_host"
Class Device = "host1"
Device = "host1"
Class Device = "host2"
Device = "host2"
Collect:
1) HBA Name for the two above HBA.
2) FC SAN Switch World Wide Name (WWN).
3) HBA World Wide Node Name (WWNN) for the two above two HBAs.
4) HBA World Wide Port Number (WWPN) for the above two HBAs.
5) Fabric port id assigned by the SAN to above two HBAs
[root@fcsmpsql4:~]# systool -c fc_host -v
Class = "fc_host"
Class Device = "host1" --> HBA Name
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/fc_host/host1" --> Kernel assigned host name/number
fabric_name = "0x100050eb1a486d5d" --> FC SAN Switch WWN
node_name = "0x20000000c9be6c4e" --> HBA WWNN
port_name = "0x10000000c9be6c4e" --> HBA WWPN
port_id = "0x030918" --> fabric port id assigned by the san to this HBA
port_state = "Online"
port_type = "NPort (fabric via point-to-point)"
speed = "4 Gbit"
supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit"
Class Device = "host2" --> HBA Name
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/fc_host/host2" --> Kernel assigned host name/number
fabric_name = "0x100050eb1a4868c5" --> FC SAN Switch WWN
node_name = "0x20000000c9be6c4f" --> HBA WWNN
port_name = "0x10000000c9be6c4f" --> HBA WWPN
port_id = "0x040929" --> fabric port id assigned by the san to this HBA
port_state = "Online"
port_type = "NPort (fabric via point-to-point)"
speed = "4 Gbit"
supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit"
OR
## -- FC SAN Switch WWN -- ##
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host1/fabric_name
0x100050eb1a486d5d
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host2/fabric_name
0x100050eb1a4868c5
## -- HBA WWNN -- ##
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host1/node_name
0x20000000c9be6c4e
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host2/node_name
0x20000000c9be6c4f
## -- HBA WWPN -- ##
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host1/port_name
0x10000000c9be6c4e
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host2/port_name
0x10000000c9be6c4f
## -- fabric port id assigned by the san to this HBA --##
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host1/port_id
0x030918
[root@fcsmpsql4:~]# cat /sys/class/fc_host/host2/port_id
0x040929
List Storage Arrays (targets) Information:
Collect:
1) Storage (Target) World Wide Node Name (WWNN).
2) Storage (Target) World Wide Port Number (WWPN).
3) Fabric port id assigned by the san to this storage port
We have 4 paths for each HBA as shown in the first diagram, so we can see the following targets:
Host1 -> "target1:0:0", "target1:0:6", "target1:0:7" and "target1:0:8"
Host2 -> "target2:0:1", "target2:0:6", "target2:0:7" and "target2:0:8"
[root@fcsmpsql4:~]# systool -c fc_transport -v
Class Device = "0:0"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/rport-1:0-2/target1:0:0/fc_transport/target1:0:0"
node_name = "0x5000144047606984" --> Storage target WWNN
port_id = "0x033800" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442a0698400" --> Storage target WWPN
Class Device = "0:1"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-3/target2:0:1/fc_transport/target2:0:1"
node_name = "0x5000144047706984" --> Storage target WWNN
port_id = "0x043800" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442b0698401" --> Storage target WWPN
Class Device = "0:6"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/rport-1:0-8/target1:0:6/fc_transport/target1:0:6"
node_name = "0x5000144047706991" --> Storage target WWNN
port_id = "0x033c00" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442b0699100" --> Storage target WWPN
Class Device = "0:6"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-8/target2:0:6/fc_transport/target2:0:6"
node_name = "0x5000144047606991" --> Storage target WWNN
port_id = "0x040c00" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442a0699101" --> Storage target WWPN
Class Device = "0:7"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/rport-1:0-9/target1:0:7/fc_transport/target1:0:7"
node_name = "0x5000144047b02b61" --> Storage target WWNN
port_id = "0x034d00" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442d02b6101" --> Storage target WWPN
Class Device = "0:7"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-9/target2:0:7/fc_transport/target2:0:7"
node_name = "0x5000144047b02b9c" --> Storage target WWNN
port_id = "0x044900" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442d02b9c00" --> Storage target WWPN
Class Device = "0:8"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/rport-1:0-10/target1:0:8/fc_transport/target1:0:8"
node_name = "0x5000144047a02b9c" --> Storage target WWNN
port_id = "0x034800" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442c02b9c01" --> Storage target WWPN
Class Device = "0:8"
Class Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-10/target2:0:8/fc_transport/target2:0:8"
node_name = "0x5000144047a02b61" --> Storage target WWNN
port_id = "0x044c00" --> Fabric port id assigned by the SAN to this storage port
port_name = "0x50001442c02b6100" --> Storage target WWPN
OR
RHEL 5:
[root@fcsmpsql4:~]# ls -1c /sys/class/fc_transport/target*/*_name 2> /dev/null | xargs -I {} grep -H -v "ZzZz" {} | sort
[root@fcsmpsql4:~]# ls -1c /sys/class/fc_transport/target*/port_id 2> /dev/null | xargs -I {} grep -H -v "ZzZz" {} | sort
RHEL 6 and RHEL 7:
[root@fcsmpsql4:~]# ls -1c /sys/bus/scsi/devices/target*/fc_transport/target*/*_name 2> /dev/null | xargs -I {} grep -H -v "ZzZz" {} | sort
/sys/bus/scsi/devices/target1:0:0/fc_transport/target1:0:0/node_name:0x5000144047606984
/sys/bus/scsi/devices/target1:0:0/fc_transport/target1:0:0/port_name:0x50001442a0698400
/sys/bus/scsi/devices/target1:0:6/fc_transport/target1:0:6/node_name:0x5000144047706991
/sys/bus/scsi/devices/target1:0:6/fc_transport/target1:0:6/port_name:0x50001442b0699100
/sys/bus/scsi/devices/target1:0:7/fc_transport/target1:0:7/node_name:0x5000144047b02b61
/sys/bus/scsi/devices/target1:0:7/fc_transport/target1:0:7/port_name:0x50001442d02b6101
/sys/bus/scsi/devices/target1:0:8/fc_transport/target1:0:8/node_name:0x5000144047a02b9c
/sys/bus/scsi/devices/target1:0:8/fc_transport/target1:0:8/port_name:0x50001442c02b9c01
/sys/bus/scsi/devices/target2:0:1/fc_transport/target2:0:1/node_name:0x5000144047706984
/sys/bus/scsi/devices/target2:0:1/fc_transport/target2:0:1/port_name:0x50001442b0698401
/sys/bus/scsi/devices/target2:0:6/fc_transport/target2:0:6/node_name:0x5000144047606991
/sys/bus/scsi/devices/target2:0:6/fc_transport/target2:0:6/port_name:0x50001442a0699101
/sys/bus/scsi/devices/target2:0:7/fc_transport/target2:0:7/node_name:0x5000144047b02b9c
/sys/bus/scsi/devices/target2:0:7/fc_transport/target2:0:7/port_name:0x50001442d02b9c00
/sys/bus/scsi/devices/target2:0:8/fc_transport/target2:0:8/node_name:0x5000144047a02b61
/sys/bus/scsi/devices/target2:0:8/fc_transport/target2:0:8/port_name:0x50001442c02b6100
[root@fcsmpsql4:~]# ls -1c /sys/bus/scsi/devices/target*/fc_transport/target*/port_id 2> /dev/null | xargs -I {} grep -H -v "ZzZz" {} | sort
/sys/bus/scsi/devices/target1:0:0/fc_transport/target1:0:0/port_id:0x033800
/sys/bus/scsi/devices/target1:0:6/fc_transport/target1:0:6/port_id:0x033c00
/sys/bus/scsi/devices/target1:0:7/fc_transport/target1:0:7/port_id:0x034d00
/sys/bus/scsi/devices/target1:0:8/fc_transport/target1:0:8/port_id:0x034800
/sys/bus/scsi/devices/target2:0:1/fc_transport/target2:0:1/port_id:0x043800
/sys/bus/scsi/devices/target2:0:6/fc_transport/target2:0:6/port_id:0x040c00
/sys/bus/scsi/devices/target2:0:7/fc_transport/target2:0:7/port_id:0x044900
/sys/bus/scsi/devices/target2:0:8/fc_transport/target2:0:8/port_id:0x044c00
Collecting LUNs information:
Collect LUN General Information
I have two HBAs:
[root@B54LFRTMPSTG01 ~]# ls /sys/class/fc_host/
host0 host1
[root@B54LFRTMPSTG01 ~]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 01 Lun: 00 --> LUN is shown using HBA 'host0'
Vendor: IBM Model: 2145 Rev: 0000 --> Vendor is "IBM" and Model is "2145"
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 01 Lun: 01
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 01 Lun: 03
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 01 Lun: 04
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 01
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 03
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 04
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 01
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 03
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 04
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 01 Lun: 00
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 01 Lun: 01
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 01 Lun: 03
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 01 Lun: 04
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 02
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 01 Lun: 02
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 02
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 01 Lun: 02
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Collect LUN World Wide ID [WWID] and other Information:
Way #1 - "multipathd":
Best and simple way if you have "multipathd" installed:
[root@B54LFRTMPSTG01 ~]# multipath -ll
mpathe (3600507680c800507f0000000000000c6) dm-4 IBM ,2145 --> LUN WWID is "600507680c800507f0000000000000c6" (without "3")
size=55G features='1 queue_if_no_path' hwhandler='0' wp=rw --> LUN size is 55 GB
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:2 sdc 8:32 active ready running
| `- 1:0:0:2 sdm 8:192 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:2 sdh 8:112 active ready running
`- 1:0:1:2 sdr 65:16 active ready running
mpathd (3600507680c800507f0000000000000c5) dm-3 IBM ,2145 --> LUN WWID is "600507680c800507f0000000000000c5" (without "3")
size=55G features='1 queue_if_no_path' hwhandler='0' wp=rw --> LUN size is 55 GB
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:1 sdg 8:96 active ready running
| `- 1:0:0:1 sdl 8:176 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:1 sdb 8:16 active ready running
`- 1:0:1:1 sdq 65:0 active ready running
mpathc (3600507680c800507f0000000000000c4) dm-2 IBM ,2145 --> LUN WWID is "600507680c800507f0000000000000c4" (without "3")
size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw --> LUN size is 500 GB
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:0 sdf 8:80 active ready running
| `- 1:0:0:0 sdk 8:160 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:0 sda 8:0 active ready running
`- 1:0:1:0 sdp 8:240 active ready running
mpathg (3600507680c800507f0000000000000c8) dm-6 IBM ,2145 --> LUN WWID is "600507680c800507f0000000000000c8" (without "3")
size=1000G features='1 queue_if_no_path' hwhandler='0' wp=rw --> LUN size is 1000 GB
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:4 sdj 8:144 active ready running
| `- 1:0:0:4 sdo 8:224 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:4 sde 8:64 active ready running
`- 1:0:1:4 sdt 65:48 active ready running
mpathf (3600507680c800507f0000000000000c7) dm-5 IBM ,2145 --> LUN WWID is "600507680c800507f0000000000000c7" (without "3")
size=55G features='1 queue_if_no_path' hwhandler='0' wp=rw --> LUN size is 55 GB
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:3 sdi 8:128 active ready running
| `- 1:0:0:3 sdn 8:208 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:3 sdd 8:48 active ready running
`- 1:0:1:3 sds 65:32 active ready running
Way # 2 - Using "lsscsi" or "scsi_id" commands:
If you don't have "multipathd" installed or you want to list WWID for each SCSI Disk you have:
RHEL 7
"/dev/sdf", "/dev/sda", "/dev/sdk" and "/dev/sdp" are the same disk over 4 different paths and they are the same LUN as shown in above "multipath -ll" output
[root@B54LFRTMPSTG01 ~]# lsscsi --scsi-id -g
[0:0:0:0] disk IBM 2145 0000 /dev/sdf 3600507680c800507f0000000000000c4 /dev/sg5 --> "/dev/sdf" WWID is "600507680c800507f0000000000000c4" (without 3)
[0:0:0:1] disk IBM 2145 0000 /dev/sdg 3600507680c800507f0000000000000c5 /dev/sg6
[0:0:0:2] disk IBM 2145 0000 /dev/sdc 3600507680c800507f0000000000000c6 /dev/sg2
[0:0:0:3] disk IBM 2145 0000 /dev/sdi 3600507680c800507f0000000000000c7 /dev/sg8
[0:0:0:4] disk IBM 2145 0000 /dev/sdj 3600507680c800507f0000000000000c8 /dev/sg9
[0:0:1:0] disk IBM 2145 0000 /dev/sda 3600507680c800507f0000000000000c4 /dev/sg0 --> "/dev/sda" WWID is "600507680c800507f0000000000000c4" (without 3)
[0:0:1:1] disk IBM 2145 0000 /dev/sdb 3600507680c800507f0000000000000c5 /dev/sg1
[0:0:1:2] disk IBM 2145 0000 /dev/sdh 3600507680c800507f0000000000000c6 /dev/sg7
[0:0:1:3] disk IBM 2145 0000 /dev/sdd 3600507680c800507f0000000000000c7 /dev/sg3
[0:0:1:4] disk IBM 2145 0000 /dev/sde 3600507680c800507f0000000000000c8 /dev/sg4
[1:0:0:0] disk IBM 2145 0000 /dev/sdk 3600507680c800507f0000000000000c4 /dev/sg10 --> "/dev/sdk" WWID is "600507680c800507f0000000000000c4" (without 3)
[1:0:0:1] disk IBM 2145 0000 /dev/sdl 3600507680c800507f0000000000000c5 /dev/sg11
[1:0:0:2] disk IBM 2145 0000 /dev/sdm 3600507680c800507f0000000000000c6 /dev/sg12
[1:0:0:3] disk IBM 2145 0000 /dev/sdn 3600507680c800507f0000000000000c7 /dev/sg13
[1:0:0:4] disk IBM 2145 0000 /dev/sdo 3600507680c800507f0000000000000c8 /dev/sg14
[1:0:1:0] disk IBM 2145 0000 /dev/sdp 3600507680c800507f0000000000000c4 /dev/sg15 --> "/dev/sdp" WWID is "600507680c800507f0000000000000c4" (without 3)
[1:0:1:1] disk IBM 2145 0000 /dev/sdq 3600507680c800507f0000000000000c5 /dev/sg16
[1:0:1:2] disk IBM 2145 0000 /dev/sdr 3600507680c800507f0000000000000c6 /dev/sg17
[1:0:1:3] disk IBM 2145 0000 /dev/sds 3600507680c800507f0000000000000c7 /dev/sg18
[1:0:1:4] disk IBM 2145 0000 /dev/sdt 3600507680c800507f0000000000000c8 /dev/sg19
RHEL 6:
[root@fcsmpsql4:~]# multipath -ll mpaths
mpaths (36000144000000010b02b614439810a61) dm-5 EMC,Invista
size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:0:5 sdg 8:96 active ready running
|- 2:0:1:5 sdam 66:96 active ready running
|- 1:0:6:5 sdbg 67:160 active ready running
|- 2:0:8:5 sdaq 66:160 active ready running
|- 1:0:8:5 sdq 65:0 active ready running
|- 2:0:7:5 sdaf 65:240 active ready running
|- 1:0:7:5 sdl 8:176 active ready running
`- 2:0:6:5 sdaa 65:160 active ready running
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdg
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdam
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdbg
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdaq
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdq
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdaf
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdl
36000144000000010b02b614439810a61
[root@fcsmpsql4:~]# scsi_id --replace-whitespace --whitelisted --device /dev/sdaa
RHEL 5
# scsi_id -g -u -s /block/sdm
Way # 3 - Using "sg_inq" commands:
[root@B54LFRTMPSTG01 ~]# lsscsi --scsi-id -g
[0:0:0:0] disk IBM 2145 0000 /dev/sdf 3600507680c800507f0000000000000c4 /dev/sg5
[0:0:0:1] disk IBM 2145 0000 /dev/sdg 3600507680c800507f0000000000000c5 /dev/sg6
[0:0:0:2] disk IBM 2145 0000 /dev/sdc 3600507680c800507f0000000000000c6 /dev/sg2
[0:0:0:3] disk IBM 2145 0000 /dev/sdi 3600507680c800507f0000000000000c7 /dev/sg8
[0:0:0:4] disk IBM 2145 0000 /dev/sdj 3600507680c800507f0000000000000c8 /dev/sg9
[0:0:1:0] disk IBM 2145 0000 /dev/sda 3600507680c800507f0000000000000c4 /dev/sg0
[0:0:1:1] disk IBM 2145 0000 /dev/sdb 3600507680c800507f0000000000000c5 /dev/sg1
[0:0:1:2] disk IBM 2145 0000 /dev/sdh 3600507680c800507f0000000000000c6 /dev/sg7
[0:0:1:3] disk IBM 2145 0000 /dev/sdd 3600507680c800507f0000000000000c7 /dev/sg3
[0:0:1:4] disk IBM 2145 0000 /dev/sde 3600507680c800507f0000000000000c8 /dev/sg4
[1:0:0:0] disk IBM 2145 0000 /dev/sdk 3600507680c800507f0000000000000c4 /dev/sg10
[1:0:0:1] disk IBM 2145 0000 /dev/sdl 3600507680c800507f0000000000000c5 /dev/sg11
[1:0:0:2] disk IBM 2145 0000 /dev/sdm 3600507680c800507f0000000000000c6 /dev/sg12
[1:0:0:3] disk IBM 2145 0000 /dev/sdn 3600507680c800507f0000000000000c7 /dev/sg13
[1:0:0:4] disk IBM 2145 0000 /dev/sdo 3600507680c800507f0000000000000c8 /dev/sg14
[1:0:1:0] disk IBM 2145 0000 /dev/sdp 3600507680c800507f0000000000000c4 /dev/sg15
[1:0:1:1] disk IBM 2145 0000 /dev/sdq 3600507680c800507f0000000000000c5 /dev/sg16
[1:0:1:2] disk IBM 2145 0000 /dev/sdr 3600507680c800507f0000000000000c6 /dev/sg17
[1:0:1:3] disk IBM 2145 0000 /dev/sds 3600507680c800507f0000000000000c7 /dev/sg18
[1:0:1:4] disk IBM 2145 0000 /dev/sdt 3600507680c800507f0000000000000c8 /dev/sg19
RHEL 6 and RHEL 7:
[root@B54LFRTMPSTG01 ~]# sg_inq -p 0x83 /dev/sdf | grep -A1 "Vendor Specific Identifier Extension:"
Vendor Specific Identifier Extension: 0xf0000000000000c4
[0x600507680c800507f0000000000000c4] --> LUN WWID is "600507680c800507f0000000000000c4" (without "0x")
[root@B54LFRTMPSTG01 ~]# sg_inq -p 0x83 /dev/sda | grep -A1 "Vendor Specific Identifier Extension:"
Vendor Specific Identifier Extension: 0xf0000000000000c4
[0x600507680c800507f0000000000000c4] --> LUN WWID is "600507680c800507f0000000000000c4" (without "0x")
[root@B54LFRTMPSTG01 ~]# sg_inq -p 0x83 /dev/sdk | grep -A1 "Vendor Specific Identifier Extension:"
Vendor Specific Identifier Extension: 0xf0000000000000c4
[0x600507680c800507f0000000000000c4] --> LUN WWID is "600507680c800507f0000000000000c4" (without "0x")
[root@B54LFRTMPSTG01 ~]# sg_inq -p 0x83 /dev/sdp | grep -A1 "Vendor Specific Identifier Extension:"
Vendor Specific Identifier Extension: 0xf0000000000000c4
[0x600507680c800507f0000000000000c4] --> LUN WWID is "600507680c800507f0000000000000c4" (without "0x")
RHEL 5
# sg_inq --page 0x83 /dev/sdp | grep -A1 "Vendor Specific Identifier Extension:
Collecting Data for the current mount points that based on LVM system or direct multipath devices
>Case #1 - We have LVM system
[root@B54LFRTMPSTG01 ~]# multipath -ll mpathe
mpathe (3600507680c800507f0000000000000c6) dm-4 IBM ,2145
size=55G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:2 sdc 8:32 active ready running
| `- 1:0:0:2 sdm 8:192 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:2 sdh 8:112 active ready running
`- 1:0:1:2 sdr 65:16 active ready running
[root@B54LFRTMPSTG01 ~]# lsblk | grep -B1 -A1 mpathe
sdc 8:32 0 55G 0 disk
└─mpathe 253:4 0 55G 0 mpath
└─vg--community--master-community--master 253:7 0 55G 0 lvm /home/databases/community-master
--
sdh 8:112 0 55G 0 disk
└─mpathe 253:4 0 55G 0 mpath
└─vg--community--master-community--master 253:7 0 55G 0 lvm /home/databases/community-master
--
sdm 8:192 0 55G 0 disk
└─mpathe 253:4 0 55G 0 mpath
└─vg--community--master-community--master 253:7 0 55G 0 lvm /home/databases/community-master
--
sdr 65:16 0 55G 0 disk
└─mpathe 253:4 0 55G 0 mpath
└─vg--community--master-community--master 253:7 0 55G 0 lvm /home/databases/community-master
[root@B54LFRTMPSTG01 ~]# pvs | grep -e "PV" -e "mpathe"
PV VG Fmt Attr PSize PFree
/dev/mapper/mpathe vg-community-master lvm2 a-- <55.00g 0
[root@B54LFRTMPSTG01 ~]# vgs | grep -e "VG" -e -e "vg-community-master"
VG #PV #LV #SN Attr VSize VFree
vg-community-master 1 1 0 wz--n- <55.00g 0
[root@B54LFRTMPSTG01 ~]# lvs | grep -e "LV" -e "community-master"
Volume group VolGroup00 is exported
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
community-master vg-community-master -wi-ao---- <55.00g
[root@B54LFRTMPSTG01 ~]# df -hT /home/databases/community-master
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg--community--master-community--master ext3 55G 52M 52G 1% /home/databases/community-master
Case #2 - We don't have LVM system:
[root@B54LFRTMPSTG01 ~]# multipath -ll mpathc
mpathc (3600507680c800507f0000000000000c4) dm-2 IBM ,2145
size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:0 sdf 8:80 active ready running
| `- 1:0:0:0 sdk 8:160 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 0:0:1:0 sda 8:0 active ready running
`- 1:0:1:0 sdp 8:240 active ready running
[root@B54LFRTMPSTG01 ~]# lsblk | grep -B1 mpathc
sda 8:0 0 500G 0 disk
└─mpathc 253:2 0 500G 0 mpath /home/databases/mysql/binlogs
--
sdf 8:80 0 500G 0 disk
└─mpathc 253:2 0 500G 0 mpath /home/databases/mysql/binlogs
--
sdk 8:160 0 500G 0 disk
└─mpathc 253:2 0 500G 0 mpath /home/databases/mysql/binlogs
--
sdp 8:240 0 500G 0 disk
└─mpathc 253:2 0 500G 0 mpath /home/databases/mysql/binlogs
[root@B54LFRTMPSTG01 ~]# df -hT /home/databases/mysql/binlogs
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/mpathc ext4 493G 73M 467G 1% /home/databases/mysql/binlogs