Storage‎ > ‎Storage-disk‎ > ‎

Check HBA card and its driver's info in linux(RHEL6)

Thank you for visiting this page, I made some update on my another link, pleas visit Check HBA Card and its driver info on RHEL, for the update
This article also can be used for other cards with little or without change
1. To check if the host has HBA card installed and which type of card installed, physiical slot, driver, module information
# lspci | grep -i fibre
15:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
15:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
# lspci -v -s 15:00.0
15:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
    Subsystem: QLogic Corp. Device 015d
    Physical Slot: 2
    Flags: bus master, fast devsel, latency 0, IRQ 24
    I/O ports at 2200 [size=256]
    Memory at 97b00000 (64-bit, non-prefetchable) [size=16K]
    Expansion ROM at 90000000 [disabled] [size=256K]
    Capabilities: [44] Power Management version 3
    Capabilities: [4c] Express Endpoint, MSI 00
    Capabilities: [88] MSI: Enable- Count=1/32 Maskable- 64bit+
    Capabilities: [98] Vital Product Data
    Capabilities: [a0] MSI-X: Enable+ Count=2 Masked-
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [138] Power Budgeting <?>
    Kernel driver in use: qla2xxx
    Kernel modules: qla2xxx
The way to check other type HBA card is same, here is one for Emulex
]# lspci -v -s 10:00.0
10:00.0 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
    Subsystem: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter
    Physical Slot: 2
    Flags: bus master, fast devsel, latency 0, IRQ 26
    Memory at c7eff000 (64-bit, non-prefetchable) [size=4K]
    Memory at c7efec00 (64-bit, non-prefetchable) [size=256]
    I/O ports at 6000 [size=256]
    [virtual] Expansion ROM at c0000000 [disabled] [size=256K]
    Capabilities: [58] Power Management version 2
    Capabilities: [60] MSI: Enable+ Count=1/16 Maskable- 64bit+
    Capabilities: [44] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [12c] Power Budgeting <?>
    Kernel driver in use: lpfc
    Kernel modules: lpfc
2. check if the driver/module loaded in kernel.
# lsmod | grep qla2xxx
qla2xxx               425817  288
scsi_transport_fc      55299  1 qla2xxx
3.check author,description,mdule file name, license, driver version
# modinfo -a qla2xxx
QLogic Corporation
# modinfo -d qla2xxx
QLogic Fibre Channel HBA Driver
# modinfo -n qla2xxx
/lib/modules/2.6.32-358.14.1.el6.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
# modinfo -l qla2xxx
GPL
# modinfo -d qla2xxx
QLogic Fibre Channel HBA Driver
# modinfo qla2xxx | grep version
version:        8.04.00.08.06.4-k
4. check if the running one same with kernel one
# modinfo -k `uname -r` -n qla2xxx              
/lib/modules/2.6.32-358.14.1.el6.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
5. If you want to upgrade/downgrade driver, download the driver first, read README, then do following steps before upgrade/downgrade
6. remove current module, you will see that you have to remove all dependent devices/modules first

# modprobe -r qla2xxx
FATAL: Module qla2xxx is in use.
# modprobe --show-depends qla2xxx
insmod /lib/modules/2.6.32-358.14.1.el6.x86_64/kernel/drivers/scsi/scsi_tgt.ko
insmod /lib/modules/2.6.32-358.14.1.el6.x86_64/kernel/drivers/scsi/scsi_transport_fc.ko
insmod /lib/modules/2.6.32-358.14.1.el6.x86_64/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
# modprobe -r scsi_tgt
FATAL: Module scsi_tgt is in use.
The error above shows that the device is being used, which means probably there are some devices are connected via Fibre, so stop all application/filesystem which using them, then remove them from system. You can use scsi hot plug/unplug(in the link https://sites.google.com/site/itmyshare/storage/check-and-list-luns-attached-to-hba ), or disconnect Fibre connection with devices then have a host reboot(I don't like this way).
Once you are done, remove scsi_tgt, then scsi_transpot_fc, followed by qla2xxx.
7. follow instruction and install the driver. Make sure .ko file is in kernel module, you may need to reboot the node.
8. check the version is new
# modinfo qla2xxx | grep version
version:        8.04.00.08.06.4-k
9. remove the driver is simple, same as step 6, the follow the driver README to remove the driver, then have a double check by using
# lsmod | grep qla2xxx
10. On RHEL6/SL6, there is no file called /etc/modprobe.conf, instead there is /etc/modprobe.d/ you can specify your special configuration there, modify the configuration file, or create your own one. I don't see there is necessary to have alias for HBA cards on RHEL6/SL6.

Note:
       modprobe intelligently adds or removes a module from the Linux kernel: note that for convenience, there is no difference between _ and
       - in module names.  modprobe looks in the module directory /lib/modules/'uname -r' for all the modules and other files, except for the
       optional /etc/modprobe.conf configuration file and /etc/modprobe.d directory (see modprobe.conf(5)). modprobe  will  also  use  module
       options specified on the kernel command line in the form of <module>.<option>.



Comments