系统环境:Centos系统
服务器需要链接外接存储,通过光纤连接,在获取接口时候需要查询hba卡型号,命令如下:
[root@localhost ~]# lspci | grep -i fibre
84:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
84:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
[root@localhost ~]# cd /sys/class/fc_host/
[root@localhost fc_host]# ll
总用量 0
lrwxrwxrwx. 1 root root 0 12月 11 14:57 host6 -> ../../devices/pci0000:80/0000:80:03.0/0000:84:00.0/host6/fc_host/host6
lrwxrwxrwx. 1 root root 0 12月 11 14:57 host7 -> ../../devices/pci0000:80/0000:80:03.0/0000:84:00.1/host7/fc_host/host7
[root@localhost fc_host]# ls /sys/class/fc_host/
host6 host7
[root@localhost fc_host]# cat /sys/class/fc_host/host6/port_name
0x21000024ff8fa016
[root@localhost fc_host]# cat /sys/class/fc_host/host7/port_name
0x21000024ff8fa017
以上加粗部分即是HBA卡型号。