DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

How to find HBA cards/ports and WWN Number details in Linux

October 28, 2017 DbAppWeb Admin

If any Linux server or system is connected to one or more SAN switches through Fibre Channel (FC) HBA cards then it is very important for the storage team that they assign the storage to the correct server via WWN numbers of FC HBA cards. There are many methods and commands through which you can determine the WWN number of a Fibre Channel (FC) HBA and their status online/offline.

WWN: World Wide Name

Find Fibre HBA WWN Details in Linux

Method 1

Run the below command to see the list of all hosts

[root@dbappweb ~]# ls /sys/class/scsi_host
host0  host1  host10  host11  host12  host2  host3  host4  host5  host6  host7  host8  host9

Run the below command for each host to see the WWN number of the HBA

[root@dbappweb ~]# cat /sys/class/scsi_host/host0/device/fc_host/host0/port_name
cat: /sys/class/scsi_host/host0/device/fc_host/host0/port_name: No such file or directory

[root@dbappweb ~]# cat /sys/class/scsi_host/host1/device/fc_host/host1/port_name
0x21000024ff12331c

Go to /sys/class/scsi_host directory and run the below command to see the WWN number of all the HBA cards connected to the server.

[root@dbappweb ~]# cd /sys/class/scsi_host

[root@dbappweb scsi_host]# for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do cat host$i/device/fc_host/host$i/port_name; done
cat: host0/device/fc_host/host0/port_name: No such file or directory
0x21000024ff12331c
0x21000024ff123304
cat: host3/device/fc_host/host3/port_name: No such file or directory
cat: host4/device/fc_host/host4/port_name: No such file or directory
cat: host5/device/fc_host/host5/port_name: No such file or directory
cat: host6/device/fc_host/host6/port_name: No such file or directory
cat: host7/device/fc_host/host7/port_name: No such file or directory
cat: host8/device/fc_host/host8/port_name: No such file or directory
cat: host9/device/fc_host/host9/port_name: No such file or directory
cat: host10/device/fc_host/host10/port_name: No such file or directory
cat: host11/device/fc_host/host11/port_name: No such file or directory
cat: host12/device/fc_host/host12/port_name: No such file or directory
[root@dbappweb scsi_host]#

Method 2

Run the below command to find all HBA cards installed on the server

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

Run the below command to find the available HBA ports

[root@dbappweb ~]# ls -l /sys/class/fc_host
total 0
lrwxrwxrwx 1 root root 0 Oct 26 17:10 host1 -> ../../devices/pci0000:00/0000:00:02.0/0000:03:00.0/host1/fc_host/host1
lrwxrwxrwx 1 root root 0 Oct 26 17:10 host2 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host2

Run the below command to check the status of the HBA ports whether they are online or offline

[root@dbappweb ~]# more /sys/class/fc_host/host?/port_state
::::::::::::::
/sys/class/fc_host/host1/port_state
::::::::::::::
Online
::::::::::::::
/sys/class/fc_host/host2/port_state
::::::::::::::
Online

Run the below command to find the WWN number of the HBA

[root@dbappweb ~]# more /sys/class/fc_host/host?/port_name
::::::::::::::
/sys/class/fc_host/host1/port_name
::::::::::::::
0x21000024ff12331c
::::::::::::::
/sys/class/fc_host/host2/port_name
::::::::::::::
0x21000024ff123304
Prev Article
Next Article
Tags:3PAR HP-UX Linux Mac OS X Storage System Sys Admin

No Responses

  1. Pingback: How to find HBA cards/ports and WWN Number details in HP-UX (vPar) - DbAppWeb.com
  2. Pingback: How to find system info, processor info, cache info, memory info etc from ESXi host CLI - DbAppWeb.com

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com