How to check WWN Number in Linux (RedHat/CentOS/SUSE)?

In Linux, WWN stands for World Wide Name. It is a unique identifier assigned to a storage device, such as a hard drive or a Fibre Channel host bus adapter (HBA). WWNs are used to identify storage devices in a storage area network (SAN) and are typically composed of two parts: a vendor-assigned prefix and a unique identifier assigned by the vendor.

WWN can be used to identify a specific storage device, regardless of where it is located in the SAN. This allows for easier management and configuration of storage devices, as well as for the implementation of advanced features such as zoning and LUN masking.

How to check WWN number for all hosts?

By using below command, we can check WWN number for all hosts.

localhost:~ # more /sys/class/fc_host/host?/port_name
::::::::::::::
/sys/class/fc_host/host0/port_name
::::::::::::::
0xc0502609b02b0000
::::::::::::::
/sys/class/fc_host/host1/port_name
::::::::::::::
0xc0504609b02b0002
::::::::::::::
/sys/class/fc_host/host2/port_name
::::::::::::::
0xc0506609b02b0004

How to check WWN number for one single host?

By using below command, we can check WWN number for one single host.

localhost:~ # cat /sys/class/fc_host/host0/port_name
0xc0502609b02b0000

How to check the status of HBA port?

By using below command, we can be able to find the status of HBA Port in Linux. There will be two statuses(online/offline)

localhost:~ # more /sys/class/fc_host/host0/port_state
Online

How to check the type of HBA Port?

By using below command, we can be able to find the type of HBA Port in Linux

localhost:~ # more /sys/class/fc_host/host0/port_type
NPIV VPORT

How to check the Speed of HBA Port?

By using below command, we can be able to find the speed of HBA Port in Linux

localhost:~ # cat /sys/class/fc_host/host0/speed
16 Gbit

WWN can also be used to identify a specific LUN in a SAN environment, this is useful when working with storage area network and configuring LUN Masking and Zoning.

Leave a Reply

Your email address will not be published. Required fields are marked *