@cdmonkey
2024-09-12T09:26:56.000000Z
字数 1818
阅读 59
命令总结
yum install sysfsutils
首先查看日志:
[root@nxlmdg ~]# grep qla2xxx /var/log/messages
Sep 8 03:31:18 nxlmdg kernel: qla2xxx [0000:6e:00.0]-801c:17: Abort command issued nexus=17:1:5 -- 1 2002.
Sep 8 03:32:24 nxlmdg kernel: qla2xxx [0000:6e:00.0]-801c:17: Abort command issued nexus=17:1:5 -- 1 2002.
Sep 8 03:34:23 nxlmdg kernel: qla2xxx [0000:6e:00.0]-801c:17: Abort command issued nexus=17:1:5 -- 1 2002.
...
日志中显示的 6e:00:0
就是 PCI 总线地址,差不多就是逻辑 Slot(槽位、插槽)号。PCIE Slot 号是指 PCI Express 插槽之实际编号。
非常可惜,使用 lspci
指令不能定位。
lspci -vv -s 6e:00.0 # 查不出有用信息
而使用 dmidecode
指令倒是能找出 Slot 号,但是不能定位具体端口(Port):
[root@nxlmdg ~]# dmidecode -t 9
...
Handle 0x0904, DMI type 9, 17 bytes
System Slot Information
Designation: PCIe Slot 5
Type: x8 PCI Express 3 x16
Current Usage: In Use
Length: Long
ID: 5 # <== SLOT NUMBER
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:6d:00.0 # <== PCI BUS ADDRESS
Handle 0x0905, DMI type 9, 17 bytes
System Slot Information
Designation: PCIe Slot 6
Type: x8 PCI Express 3 x16
Current Usage: In Use
Length: Long
ID: 6
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:6e:00.0
...
[root@nxlmdg ~]# dmidecode -t 9 |awk '/ID:/ {id=$2} /Bus Address/ {print "Slot",id,"PCIe",$3}'
Slot 1 PCIe 0000:19:00.0
Slot 5 PCIe 0000:6d:00.0
Slot 6 PCIe 0000:6e:00.0
执行指令:
systool -c fc_host -v
这个指令其实就是读入相关系统信息:
[root@nxlmdg ~]# ll /sys/class/fc_host/host15
lrwxrwxrwx 1 root root 0 Sep 12 15:57 /sys/class/fc_host/host15 -> ../../devices/pci0000:6c/0000:6c:00.0/0000:6d:00.0/host15/fc_host/host15
[root@nxlmdg ~]# cat /sys/class/fc_host/host15/node_name
0x200034800d6efd1c
而后登入服务器 iDrac,查看网络设备,就能找出对应设备槽位了。
另外,整个 PCI 是个树形结构,没有深入研究,大概就是这样:
[root@nxlmdg ~]# lspci -tv|grep "Fibre Channel"
+-[0000:6c]-+-00.0-[6d]--+-00.0 QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter
| | \-00.1 QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter
| +-02.0-[6e]--+-00.0 QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter
| | \-00.1 QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter
参考内容: