RHEL: Checking HBAs

# Tested on RHEL 6


# Show the instances of FC ports connected to the pci bus:

lspci | grep -i "Fibre"
   07:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
   07:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)



systool -c fc_host
   Class = "fc_host"

     Class Device = "host1"
       Device = "host1"

     Class Device = "host2"
       Device = "host2"


# "systool -c fc_host" command in verbose mode shows the WWN of our HBAs (port_name).
# In the example below, the WWNs of our HBAs are '5001438028cb8124' & '5001438028cb8126'
# respectively

systool -c fc_host -v
   Class = "fc_host"

     Class Device = "host1"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/fc_host/host1"
       dev_loss_tmo        = "16"
       fabric_name         = "0x10000005339ade00"
       issue_lip           = <store method only>
       max_npiv_vports     = "254"
       node_name           = "0x5001438028cb8125"
       npiv_vports_inuse   = "0"
       port_id             = "0x1aab00"
       port_name           = "0x5001438028cb8124"
       port_state          = "Online"
       port_type           = "NPort (fabric via point-to-point)"
       speed               = "8 Gbit"
       supported_classes   = "Class 3"
       supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
       symbolic_name       = "HPAJ764A FW:v7.00.01 DVR:v8.05.00.03.06.5-k2"
       system_hostname     = ""
       tgtid_bind_type     = "wwpn (World Wide Port Name)"
       uevent              =
       vport_create        = <store method only>
       vport_delete        = <store method only>

       Device = "host1"
       Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1"
         fw_dump             =
         nvram               = "ISP "
         optrom              =
         optrom_ctl          = <store method only>
         reset               = <store method only>
         sfp                 = ""
         uevent              = "DEVTYPE=scsi_host"
         vpd                 = "$"


     Class Device = "host2"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/fc_host/host2"
       dev_loss_tmo        = "16"
       fabric_name         = "0x10000005339ac200"
       issue_lip           = <store method only>
       max_npiv_vports     = "254"
       node_name           = "0x5001438028cb8127"
       npiv_vports_inuse   = "0"
       port_id             = "0x20ab00"
       port_name           = "0x5001438028cb8126"
       port_state          = "Online"
       port_type           = "NPort (fabric via point-to-point)"
       speed               = "8 Gbit"
[...]




# For each FC initiator port should have an instance under /sys/class/fc_host

ll /sys/class/fc_host/
   total 0
   lrwxrwxrwx 1 root root 0 Mar 25 11:53 host1 -> ../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/fc_host/host1
   lrwxrwxrwx 1 root root 0 Mar 25 11:53 host2 -> ../../devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/fc_host/host2


# If FC have never been scanned before, LUNs are not yet visible to the system and commands
# like "multipath" or "systool" won't be able to show the LUNs


ll /sys/class/fc_transport/
   total 0

systool -c fc_transport -v
   Class = "fc_transport"


# Let's see what happens after scanning the FC. Based on the FC instances found before:

echo "- - -" >> /sys/class/scsi_host/host1/scan
echo "- - -" >> /sys/class/scsi_host/host2/scan


ll /sys/class/fc_transport/
   total 0
   lrwxrwxrwx 1 root root 0 Apr  3 10:27 target1:0:0 -> ../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/rport-1:0-0/target1:0:0/fc_transport/target1:0:0
   lrwxrwxrwx 1 root root 0 Apr  3 10:27 target1:0:1 -> ../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/rport-1:0-1/target1:0:1/fc_transport/target1:0:1
   lrwxrwxrwx 1 root root 0 Apr  3 10:27 target2:0:0 -> ../../devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/rport-2:0-0/target2:0:0/fc_transport/target2:0:0
   lrwxrwxrwx 1 root root 0 Apr  3 10:27 target2:0:1 -> ../../devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/rport-2:0-1/target2:0:1/fc_transport/target2:0:1


systool -c fc_transport
   Class = "fc_transport"

     Class Device = "0:0"
       Device = "target1:0:0"

     Class Device = "0:0"
       Device = "target2:0:0"

     Class Device = "0:1"
       Device = "target1:0:1"

     Class Device = "0:1"
       Device = "target2:0:1"



# Now, we are also able to see the LUNs attached to the server (if any) via "multipath"

multipath -ll
   200255c3a1108000e dm-2 NEC,DISK ARRAY
   size=15G features='0' hwhandler='1 alua' wp=rw
   |-+- policy='round-robin 0' prio=130 status=active
   | |- 1:0:0:0 sdc 8:32  active ready running
   | `- 2:0:1:0 sdi 8:128 active ready running
   `-+- policy='round-robin 0' prio=10 status=enabled
     |- 2:0:0:0 sdg 8:96  active ready running
     `- 1:0:1:0 sde 8:64  active ready running
   200255c3a1108000f dm-3 NEC,DISK ARRAY
   size=160G features='0' hwhandler='1 alua' wp=rw
   |-+- policy='round-robin 0' prio=130 status=active
   | |- 1:0:1:1 sdf 8:80  active ready running
   | `- 2:0:0:1 sdh 8:112 active ready running
   `-+- policy='round-robin 0' prio=10 status=enabled
     |- 1:0:0:1 sdd 8:48  active ready running
     `- 2:0:1:1 sdj 8:144 active ready running




# "systool -c fc_transport" command in verbose mode can give some interesting information
# like the WWNN of the ports of the Fibre Channel storage servers (port_name)

systool -c fc_transport -v
   Class = "fc_transport"

     Class Device = "0:0"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/rport-1:0-0/target1:0:0/fc_transport/target1:0:0"
       node_name           = "0x200000255c3a1108"
       port_id             = "0x031500"
       port_name           = "0x220000255c3a1108"
       uevent              =

       Device = "target1:0:0"
       Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/rport-1:0-0/target1:0:0"
         uevent              = "DEVTYPE=scsi_target"


     Class Device = "0:0"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/rport-2:0-0/target2:0:0/fc_transport/target2:0:0"
       node_name           = "0x200000255c3a1108"
       port_id             = "0x1fdb00"
       port_name           = "0x2f0000255c3a1108"
       uevent              =

       Device = "target2:0:0"
       Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/rport-2:0-0/target2:0:0"
         uevent              = "DEVTYPE=scsi_target"


     Class Device = "0:1"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/rport-1:0-1/target1:0:1/fc_transport/target1:0:1"
       node_name           = "0x200000255c3a1108"
       port_id             = "0x032600"
       port_name           = "0x2a0000255c3a1108"
       uevent              =

[...]




# To look at information regarding the SCSI adapters present ('-v' for verbose):

systool -c scsi_host
   Class = "scsi_host"

     Class Device = "host0"
       Device = "host0"

     Class Device = "host1"
       Device = "host1"

     Class Device = "host2"
       Device = "host2"

     Class Device = "host3"
       Device = "host3"

     Class Device = "host4"
       Device = "host4"



# To see what Fibre Channel devices are connected to the Fibre Channel HBA cards:

systool -c fc_remote_ports -d
   Class = "fc_remote_ports"

     Class Device = "0-0"
       Device = "rport-1:0-0"

     Class Device = "0-0"
       Device = "rport-2:0-0"

     Class Device = "0-1"
       Device = "rport-1:0-1"

     Class Device = "0-1"
       Device = "rport-2:0-1"


systool -c fc_remote_ports -v -d
   Class = "fc_remote_ports"

     Class Device = "0-0"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0/host1/rport-1:0-0/fc_remote_ports/rport-1:0-0"
       dev_loss_tmo        = "864000"
       fast_io_fail_tmo    = "5"
       node_name           = "0x200000255c3a1108"
       port_id             = "0x031500"
       port_name           = "0x220000255c3a1108"
       port_state          = "Online"
       roles               = "FCP Target"
       scsi_target_id      = "0"
       supported_classes   = "Class 3"
       uevent              =


     Class Device = "0-0"
     Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:04:00.1/host2/rport-2:0-0/fc_remote_ports/rport-2:0-0"
       dev_loss_tmo        = "864000"
       fast_io_fail_tmo    = "5"
       node_name           = "0x200000255c3a1108"
       port_id             = "0x1fdb00"
       port_name           = "0x2f0000255c3a1108"
       port_state          = "Online"
[...]




# For information on SCSI disks connected to a system ('-v' for verbose):

systool -c scsi_disk
Class = "scsi_disk"

  Class Device = "0:0:0"
    Device = "0:0:0:0"

  Class Device = "0:0:0"
    Device = "1:0:0:0"

  Class Device = "0:0:0"
    Device = "2:0:0:0"

  Class Device = "0:0:1"
    Device = "0:0:0:1"

  Class Device = "0:0:1"
    Device = "1:0:0:1"

  Class Device = "0:0:1"
    Device = "2:0:0:1"

  Class Device = "0:1:0"
    Device = "1:0:1:0"

  Class Device = "0:1:0"
    Device = "2:0:1:0"

  Class Device = "0:1:1"
    Device = "1:0:1:1"

  Class Device = "0:1:1"
    Device = "2:0:1:1"



# To show more disk information including which hosts are connected to which disks:

systool -b scsi -v

[...]

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Linux LVM recovery
Viewed 1855 times since Wed, Jan 23, 2019
YUM CRON Enabling automatic updates in Centos 7 and RHEL 7
Viewed 1573 times since Fri, Oct 26, 2018
OpenSSL: Find Out SSL Key Length – Linux Command Line
Viewed 760 times since Mon, Feb 18, 2019
Kernel sysctl configuration file for Linux
Viewed 1414 times since Fri, Aug 3, 2018
How to Analyze or Read OS Watcher Output in three easy steps -- With Example ?
Viewed 4800 times since Thu, Jun 21, 2018
Top 20 OpenSSH Server Best Security Practices ssh linux aix
Viewed 338 times since Fri, May 15, 2020
UUIDs and Linux: Everything you ever need to know [Update]
Viewed 717 times since Tue, Jul 17, 2018
Linux Proxy Server Settings – Set Proxy For Command Line
Viewed 780 times since Mon, Feb 18, 2019
How To Use Systemctl to Manage Systemd Services and Units
Viewed 129 times since Mon, Dec 7, 2020
SYS: Configure a local repository. local repo
Viewed 877 times since Mon, Oct 29, 2018