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
LVM: Rename root VG/LV
Viewed 8330 times since Sat, Jun 2, 2018
How to run command or code in parallel in bash shell under Linux or Unix
Viewed 3892 times since Tue, Aug 6, 2019
zabbix linux How to solve apache error No space left on device: Cannot create SSLMutex
Viewed 3038 times since Wed, Nov 11, 2020
How To Use the Linux Auditing System on CentOS 7
Viewed 4635 times since Fri, Apr 5, 2019
Open SSL Creating Certificate Signing Request — CSR Generation
Viewed 2410 times since Mon, Feb 18, 2019
Watchdog script to keep an application running
Viewed 19641 times since Tue, Jul 31, 2018
Build a simple RPM that packages a single file
Viewed 9382 times since Sat, Jun 2, 2018
How do I add ethtool settings to a network device permanently?
Viewed 7412 times since Mon, May 21, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 7
Viewed 7928 times since Sat, Jun 2, 2018
LVM: Extend an existing Volume Group by adding a new disk
Viewed 2595 times since Sat, Jun 2, 2018