• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • How to check the number of HBA cards or ports are available in my Linux setup ?

    In my earlier article I had given a bunch of commands which can help a newbie understand dm multipath

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


    Method 1

    On a Linux box with Emulex NIC card you can view the available HBA cards using below command
    # lspci  | grep -i fibre
    04:00.2 Fibre Channel: Emulex Corporation OneConnect 10Gb FCoE Initiator (be3) (rev 01)
    04:00.3 Fibre Channel: Emulex Corporation OneConnect 10Gb FCoE Initiator (be3) (rev 01)

    Here as you see my node has an Emulex 554FLB NIC card with be2net driver
    # ethtool -i eth0 | grep driver
    driver: be2net

    On a Linux machine with Qlogic card you can use below command to check the available HBA cards
    # lspci  | grep -i hba
    03:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
    03:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)

    Here as you see my node has an Qlogic 530FLB NIC card with bnx2x driver
    # ethtool -i eth0 | grep driver
    driver: bnx2x






    Method 2

    Or you can install sysfsutils rpm to get systool which can also show you similar information
    # systool -D -c fc_host
    Class = "fc_host"

      Class Device = "host0"

      Class Device = "host1"


    Method 3

    If you do not have this tool available then you can get the list of HBA at below location
    # ls -ld /sys/class/fc_host/*
    lrwxrwxrwx 1 root root 0 May 22 18:29 /sys/class/fc_host/host0 -> ../../devices/pci0000:00/0000:00:02.0/0000:04:00.2/host0/fc_host/host0
    lrwxrwxrwx 1 root root 0 May 22 18:29 /sys/class/fc_host/host1 -> ../../devices/pci0000:00/0000:00:02.0/0000:04:00.3/host1/fc_host/host1

    Here as you see I have two HBA with the name host0 and host1

    I hope the article was useful.

    Deepak Prasad

    is a techie and an author who is still trying to survive in this IT generation with very little knowledge he has on Linux/Unix, VMware, SAN Storage, Automation, networking etc

    You can follow him on Facebook or Google+


    Do you also have something to share here?
    Join GoLinuxHub Team as an Author, Click here for more information
    How to check the number of HBA cards or ports are available in my Linux setup ? How to check the number of HBA cards or ports are available in my Linux setup ? Reviewed by Deepak Prasad on Saturday, May 26, 2018 Rating: 5

    No comments:

    Powered by Blogger.