How to Find the HBA/Fibre Channel Cards, Ports and WWN in Linux


Find HBA/Fibre Channel Card installed

# lspci -nn |egrep -i "fibre|hba"
04:00.0 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03)
04:00.1 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03)
05:00.0 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03)
05:00.1 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03)
82:00.0 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03)
82:00.1 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03)

Find the Physical Port, Driver details

# lspci -v -s 04:00.0
04:00.0 Fibre Channel: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter (rev 03)
 Subsystem: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter
 Flags: bus master, fast devsel, latency 0, IRQ 84, NUMA node 0
 Memory at 92009000 (64-bit, non-prefetchable) [size=4K]
 Memory at 92004000 (64-bit, non-prefetchable) [size=16K]
 Expansion ROM at 92040000 [disabled] [size=256K]
 Capabilities: [58] Power Management version 3
 Capabilities: [60] MSI: Enable- Count=1/16 Maskable+ 64bit+
 Capabilities: [78] MSI-X: Enable+ Count=32 Masked-
 Capabilities: [84] Vital Product Data
 Capabilities: [94] Express Endpoint, MSI 00
 Capabilities: [100] Advanced Error Reporting
 Capabilities: [12c] Power Budgeting <?>
 Kernel driver in use: lpfc
 Kernel modules: lpfc

Check Kernel Modules and details

# lsmod |grep lpfc
 lpfc 697278 0
 crc_t10dif 12714 2 lpfc,sd_mod
 scsi_transport_fc 64007 1 lpfc

Author Info

# modinfo -a lpfc
 Emulex Corporation - [email protected]

HBA Description

# modinfo -d lpfc
 Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6

Module name

# modinfo -n lpfc
 /lib/modules/3.10.0-693.17.1.el7.x86_64/kernel/drivers/scsi/lpfc/lpfc.ko.xz

Driver License

# modinfo -l lpfc
 GPL

Version

# modinfo lpfc|grep version
version: 0:11.2.0.6
rhelversion: 7.4
srcversion: 61B09422B7415BF170E0D67
vermagic: 3.10.0-693.17.1.el7.x86_64 SMP mod_unload modversions

Verify available ports

# ls -l /sys/class/fc_host
total 0
lrwxrwxrwx. 1 root root 0 May 3 06:31 host11 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host11/fc_host/host11
lrwxrwxrwx. 1 root root 0 May 3 06:31 host13 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.1/host13/fc_host/host13
lrwxrwxrwx. 1 root root 0 May 3 06:31 host14 -> ../../devices/pci0000:00/0000:00:03.2/0000:05:00.0/host14/fc_host/host14
lrwxrwxrwx. 1 root root 0 May 3 06:31 host15 -> ../../devices/pci0000:00/0000:00:03.2/0000:05:00.1/host15/fc_host/host15
lrwxrwxrwx. 1 root root 0 May 3 06:31 host16 -> ../../devices/pci0000:80/0000:80:02.0/0000:82:00.0/host16/fc_host/host16
lrwxrwxrwx. 1 root root 0 May 3 06:31 host17 -> ../../devices/pci0000:80/0000:80:02.0/0000:82:00.1/host17/fc_host/host17

Verify port status

# cat /sys/class/fc_host/host11/port_state
Linkdown

# cat /sys/class/fc_host/host13/port_state
Linkdown

Find the WWN number

# cat /sys/class/fc_host/host13/port_name
0x10000090fafd1f8d
# cat /sys/class/fc_host/host15/port_name
0x10000090fafd0927

Using systool to find FC infomation

You can use systool utility to find these details. (If not installed, install sysfsutils package)

# yum install sysfsutils

Quick check on WWN names

# systool -c fc_host -v | grep port_name
 port_name = "0x10000090fafd1f8c"
 port_name = "0x10000090fafd1f8d"
 port_name = "0x10000090fafd0926"
 port_name = "0x10000090fafd0927"
 port_name = "0x10000090fafd2156"
 port_name = "0x10000090fafd2157"

 Check Port status

# systool -c fc_host -v | grep port_state
 port_state = "Online"
 port_state = "Online"
 port_state = "Online"
 port_state = "Online"
 port_state = "Online"
 port_state = "Linkdown"

More detailed output

# systool -c fc_host -v |egrep "Class Device|port_name|port_state|port_type|symbolic_name|uevent"
 Class Device = "host12"
 Class Device path = "/sys/devices/pci0000:00/0000:00:02.2/0000:04:00.0/host12/fc_host/host12"
 port_name = "0x10000090fafd1f8c"
 port_state = "Linkdown"
 port_type = "Unknown"
 symbolic_name = "Emulex LPe12002-M8 FV2.02A3 DV11.2.0.6 HN:ams13 OS:Linux"
 uevent =
 uevent = "DEVTYPE=scsi_host"
 Class Device = "host13"
 Class Device path = "/sys/devices/pci0000:00/0000:00:02.2/0000:04:00.1/host13/fc_host/host13"
 port_name = "0x10000090fafd1f8d"
 port_state = "Linkdown"
 port_type = "Unknown"
 symbolic_name = "Emulex LPe12002-M8 FV2.02A3 DV11.2.0.6 HN:ams13 OS:Linux"
 uevent =
 uevent = "DEVTYPE=scsi_host"
 Class Device = "host14"
 Class Device path = "/sys/devices/pci0000:00/0000:00:03.2/0000:05:00.0/host14/fc_host/host14"
 port_name = "0x10000090fafd0926"
 port_state = "Linkdown"
 port_type = "Unknown"
 symbolic_name = "Emulex LPe12002-M8 FV2.02A3 DV11.2.0.6 HN:am13 OS:Linux"
 uevent =
 uevent = "DEVTYPE=scsi_host"
 Class Device = "host15"
 Class Device path = "/sys/devices/pci0000:00/0000:00:03.2/0000:05:00.1/host15/fc_host/host15"
 port_name = "0x10000090fafd0927"
 port_state = "Online"
 port_type = "Point-To-Point (direct nport connection)"
 symbolic_name = "Emulex LPe12002-M8 FV2.02A3 DV11.2.0.6 HN:ams13 OS:Linux"
 uevent =
 uevent = "DEVTYPE=scsi_host"
 Class Device = "host16"
 Class Device path = "/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.0/host16/fc_host/host16"
 port_name = "0x10000090fafd2156"
 port_state = "Linkdown"
 port_type = "Unknown"
 symbolic_name = "Emulex LPe12002-M8 FV2.02A3 DV11.2.0.6 HN:ams13 OS:Linux"
 uevent =
 uevent = "DEVTYPE=scsi_host"
 Class Device = "host17"
 Class Device path = "/sys/devices/pci0000:80/0000:80:02.0/0000:82:00.1/host17/fc_host/host17"
 port_name = "0x10000090fafd2157"
 port_state = "Online"
 port_type = "Point-To-Point (direct nport connection)"
 symbolic_name = "Emulex LPe12002-M8 FV2.02A3 DV11.2.0.6 HN:ams13 OS:Linux"
 uevent =
 uevent = "DEVTYPE=scsi_host"

Once you have connection, you can verify the device detection on the ports.

# dmesg |grep -i seq
[ 10.582143] scsi 12:0:0:0: Sequential-Access IBM ULTRIUM-HH7 HB81 PQ: 0 ANSI: 6
[ 107.302044] scsi 13:0:0:0: Sequential-Access IBM ULTRIUM-HH7 HB81 PQ: 0 ANSI: 6
[ 274.768874] scsi 13:0:0:0: Sequential-Access IBM ULTRIUM-HH7 HB81 PQ: 0 ANSI: 6
[ 376.296432] scsi 12:0:0:0: Sequential-Access IBM ULTRIUM-HH7 HB81 PQ: 0 ANSI: 6

# dmesg |grep -i 'media changer'
[ 107.331305] SCSI Media Changer driver v0.25

# lsscsi
[0:2:0:0] disk DELL PERC H730P Mini 4.27 /dev/sda
[0:2:1:0] disk DELL PERC H730P Mini 4.27 /dev/sdb
[10:0:0:0] cd/dvd HL-DT-ST DVD+-RW GTA0N A3C0 /dev/sr1
[11:0:0:0] cd/dvd iDRAC RHEL7 0329 /dev/sr0
[12:0:0:0] tape IBM ULTRIUM-HH7 HB81 /dev/st0
[13:0:0:0] tape IBM ULTRIUM-HH7 HB81 /dev/st1
[13:0:0:1] mediumx QUANTUM Scalar i3-i6 152G /dev/sch0

 


Also published on Medium.

Gini Gangadharan

Gineesh Madapparambath | Backpacker, Foodie, Techie | techbeatly.com|rovervibes.com

You may also like...

Leave a Reply

avatar
  Subscribe  
Notify of
%d bloggers like this: