How To find HBA Link on Linux (RHEL) or Solaris


To find out the HBA Link staTus on Unix (Solaris) or Linux (RHEL), run the following command:

On Linux (RHEL) system

Make sure you have systool utility installed on your system first

which systool

example:

# which systool
/usr/bin/systool

If it return an error, please install the package sysfsutils

yum install -y sysfsutils

Run the following command to see the HBA Link status

for list in `ls -ld /sys/class/fc_host/host[0-9]*/ |cut -d ‘/’ -f5`; do systool -c fc_host -v $list | egrep -e ‘path|fabric_name|node_name|port_name|port_state|port_type|speed’ ; done

example:

# for list in `ls -ld /sys/class/fc_host/host[0-9]*/ |cut -d ‘/’ -f5`; do systool -c fc_host -v $list | egrep -e ‘path|fabric_name|node_name|port_name|port_state|port_type|speed’ ; done
Class Device path = “/sys/devices/pci0000:80/0000:80:01.0/0000:86:00.0/host3/fc_host/host3”
fabric_name = “0x0”
node_name = “0x20000090fa47a382”
port_name = “0x10000090fa47a382”
port_state = “Linkdown”
port_type = “Unknown”
speed = “unknown”
supported_speeds = “2 Gbit, 4 Gbit, 8 Gbit”
Device path = “/sys/devices/pci0000:80/0000:80:01.0/0000:86:00.0/host3”
Class Device path = “/sys/devices/pci0000:80/0000:80:03.0/0000:8b:00.0/host4/fc_host/host4”
fabric_name = “0x0”
node_name = “0x20000090fa47a6a5”
port_name = “0x10000090fa47a6a5”
port_state = “Linkdown”
port_type = “Unknown”
speed = “unknown”
supported_speeds = “2 Gbit, 4 Gbit, 8 Gbit”
Device path = “/sys/devices/pci0000:80/0000:80:03.0/0000:8b:00.0/host4”
Class Device path = “/sys/devices/pci0000:80/0000:80:07.0/0000:90:00.0/host5/fc_host/host5”
fabric_name = “0x1000000533beec13”
node_name = “0x20000090fa5284f4”
port_name = “0x10000090fa5284f4”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “8 Gbit”
supported_speeds = “2 Gbit, 4 Gbit, 8 Gbit”
Device path = “/sys/devices/pci0000:80/0000:80:07.0/0000:90:00.0/host5”
Class Device path = “/sys/devices/pci0000:80/0000:80:07.0/0000:90:00.1/host6/fc_host/host6”
fabric_name = “0x1000000533bef762”
node_name = “0x20000090fa5284f5”
port_name = “0x10000090fa5284f5”
port_state = “Online”
port_type = “NPort (fabric via point-to-point)”
speed = “8 Gbit”
supported_speeds = “2 Gbit, 4 Gbit, 8 Gbit”
Device path = “/sys/devices/pci0000:80/0000:80:07.0/0000:90:00.1/host6”

On Unix (Solaris) System

run the following command to see HBA Link status

fcinfo hba-port | egrep -e ‘OS|Type|State|Speed|WWN’

example:

# fcinfo hba-port | egrep -e ‘OS|Type|State|Speed|WWN’
HBA Port WWN: 2100001b329c54b5
OS Device Name: /dev/cfg/c2
FCode/BIOS Version: BIOS: 2.02; fcode: 2.01; EFI: 2.00;
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 2000001b329c54b5
HBA Port WWN: 2100001b329c92b4
OS Device Name: /dev/cfg/c3
FCode/BIOS Version: BIOS: 2.02; fcode: 2.01; EFI: 2.00;
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 2000001b329c92b4

You are Done!

Comments are closed.