• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to identify the HBA cards/ports and WWN in Linux

By admin

There are several commands to determine the WWN of a Fibre Channel (FC) HBA and their status (online/offline). The post discusses few of the most commonly used methods.

Method 1
To find the HBA cards installed on your system use :

# lspci -nn | grep -i hba
07:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)
07:00.1 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)

To check the available HBA ports :

# ls -l /sys/class/fc_host
total 0
drwxr-xr-x 3 root root 0 Feb  3  2015 host2
drwxr-xr-x 3 root root 0 Feb  3  2015 host3

To find the state of HBA ports (online/offline) :

# more /sys/class/fc_host/host?/port_state
::::::::::::::
/sys/class/fc_host/host2/port_state
::::::::::::::
Online
::::::::::::::
/sys/class/fc_host/host3/port_state
::::::::::::::
Online

To find the WWN numbers of the above ports :

# more /sys/class/fc_host/host?/port_name
::::::::::::::
/sys/class/fc_host/host2/port_name
::::::::::::::
0x500143802426baf4
::::::::::::::
/sys/class/fc_host/host3/port_name
::::::::::::::
0x500143802426baf6

Method 2 : Using systool
Another useful command to find the information about HBAs is systool. If not already install, you may need to install the sysfsutils package.

# yum install sysfsutils

To check the available HBA ports :

# systool -c fc_host
Class = "fc_host"

  Class Device = "host2"
    Device = "host2"

  Class Device = "host3"
    Device = "host3"

To find the WWNs for the HBA ports :

# systool -c fc_host -v | grep port_name
    port_name           = "0x500143802426baf4"
    port_name           = "0x500143802426baf6"

To check the state of the HBA ports (online/offline) :

# systool -c fc_host -v | grep port_state
    port_state          = "Online"
    port_state          = "Online"
How to identify the HBA cards/ports and WWN in Solaris

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Configure a Fiber-Channel Over Ethernet (FCoE) Interface in CentOS/RHEL
  2. How to Disable Ctrl+c or Ctrl+z Using the “trap” Command in Linux
  3. How to recover from deleted root entry in /etc/shadow and/or /etc/passwd files in CentOS / RHEL 6
  4. CentOS/RHEL : Unmounting a Windows Share Fails – “device is busy”
  5. CentOS / RHEL : How to configure iptable rules to allow FTP ports 20/21
  6. Unable To Boot Up Linux OS with Auditd (CentOS/RHEL)
  7. Linux / UNIX : How to create primary partition using fdisk
  8. How to set “max_report_luns” and “max_luns” on CentOS/RHEL 6 to scan more than 512 LUNs
  9. Understanding rsyslog Templates
  10. How To Add/Remove Locale Archive in CentOS/RHEL 5,6

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary