How to check the HBA name, make, model, firmware, driver version in Linux

In my earlier article I had given a bunch of commands to help understand dm multipath

Tutorial/Cheatsheet: Begineer's Guide to Understanding Device Mapper Multipath for Linux

NOTE: The commands to validate this may vary based on the type of HBA being used so I will show some commands and examples for Emulex HBA card where these commands can be used. I cannot assure if the same would work for a Linux machine with Qlogic card.

Below command will give you the connected HBA detail

# lspci -nn | grep -i Fibre
04:00.2 Fibre Channel [0c04]: Emulex Corporation OneConnect 10Gb FCoE Initiator (be3) [19a2:0714] (rev 01)
04:00.3 Fibre Channel [0c04]: Emulex Corporation OneConnect 10Gb FCoE Initiator (be3) [19a2:0714] (rev 01)

With this we know we have a Emulex HBA

Next install sysfsutils rpm if not installed already.

Now use the below command. This will give you a bunch of information regarding your HBA card.

# systool -a -v -c scsi_host | egrep "Class Device|model|version|proc_name|info|fwrev"
  Class Device = "host0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.2/host0/scsi_host/host0"
    bg_info             = "BlockGuard Disabled"
    fwrev               = "11.1.183.23, sli-4:0:1"
    info                = "HP FlexFabric 10Gb 2-port 554FLB Adapter on PCI bus 04 device 02 irq 36 port 1 Logical Link Speed: 8000 Mbps"
    lpfc_drvr_version   = "Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6"
    modeldesc           = "HP FlexFabric 10Gb 2-port 554FLB Adapter"
    modelname           = "554FLB"
    npiv_info           = "NPIV Physical"
    option_rom_version  = "11.1.183.23"
    proc_name           = "lpfc"
  Class Device = "host1"
  Class Device path = "/sys/devices/pci0000:00/0000:00:02.0/0000:04:00.3/host1/scsi_host/host1"
    bg_info             = "BlockGuard Disabled"
    fwrev               = "11.1.183.23, sli-4:0:1"
    info                = "HP FlexFabric 10Gb 2-port 554FLB Adapter on PCI bus 04 device 03 irq 41 port 2 Logical Link Speed: 8000 Mbps"
    lpfc_drvr_version   = "Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6"
    modeldesc           = "HP FlexFabric 10Gb 2-port 554FLB Adapter"
    modelname           = "554FLB"
    npiv_info           = "NPIV Physical"
    option_rom_version  = "11.1.183.23"
    proc_name           = "lpfc"

These fields are populated from below location so if you wish to get any more information then navigate around all the files from this location

# ls /sys/class/scsi_host/host*
# ls /sys/class/fc_host/host*

To get the Model Name

# grep -v "zZzZ" /sys/class/scsi_host/host*/model*
/sys/class/scsi_host/host0/modeldesc:HP FlexFabric 10Gb 2-port 554FLB Adapter
/sys/class/scsi_host/host0/modelname:554FLB
/sys/class/scsi_host/host1/modeldesc:HP FlexFabric 10Gb 2-port 554FLB Adapter
/sys/class/scsi_host/host1/modelname:554FLB

To get the driver name

# grep -v "zZzZ" /sys/class/scsi_host/host*/proc_name
/sys/class/scsi_host/host0/proc_name:lpfc
/sys/class/scsi_host/host1/proc_name:lpfc

Now since we know the driver name, we can get more information for our driver

# modinfo lpfc
filename:       /lib/modules/3.10.0-693.21.1.el7.x86_64/kernel/drivers/scsi/lpfc/lpfc.ko.xz
version:        0:11.2.0.6
author:         Emulex Corporation - tech.support@emulex.com
description:    Emulex LightPulse Fibre Channel SCSI driver 11.2.0.6
license:        GPL
retpoline:      Y
rhelversion:    7.4
srcversion:     61B09422B7415BF170E0D67

NOTE: Although most Fibre Channel drivers register a model name and description within sysfs, not all scsi drivers will. For example, the Smart Array, SIL2424 and ATA HBA, as shown in the above configuration, do not supply that information. For those types of cards you must use lspci -k to retrieve the information.

I hope the article was useful.

1 thought on “How to check the HBA name, make, model, firmware, driver version in Linux”

Leave a Comment