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
Open SSL HowTo: Decode SSL Certificate
Viewed 6231 times since Mon, Feb 18, 2019
How to Synchronize Directories Using Lsyncd in Linux
Viewed 14120 times since Wed, Oct 31, 2018
Linux An introduction to swap space on Linux systems
Viewed 2571 times since Thu, Jan 23, 2020
RHEL: Force system to prompt for password in Single User mode
Viewed 7654 times since Sat, Jun 2, 2018
RHEL7: How to get started with Firewalld.
Viewed 12257 times since Wed, May 22, 2019
RHEL: Displaying system info (firmware, serial numbers... )
Viewed 12243 times since Sun, May 27, 2018
stunnel basics and pki standards
Viewed 9590 times since Fri, Sep 28, 2018
Using IOzone for Linux disk performance analysis
Viewed 8407 times since Wed, Jul 25, 2018
LUKS dm-crypt/Device encryption GUIDE
Viewed 2466 times since Fri, Jul 13, 2018
Red Hat ADDING SWAP SPACE
Viewed 2199 times since Fri, Jun 8, 2018