由於linux版本太多,咱們就以主流的,爲例,RedHat Linux AS四、RedHat Linux AS五、SuSe Linux 9和SuSe Linux 10爲例介紹在Linux系統中如何查看FC HBA卡的信息。
在查看FC HBA卡前請確保FC HBA卡物理鏈接正常,指示燈正常。
一、
RedHat Linux AS4
和
SuSE Linux 9
RedHat Linux AS4與SuSE Linux 9中查看FC HBA卡信息的方法基本同樣,在此以RedHat AS4爲例介紹如何查看FC HBA卡的信息。
在RedHat AS4或SuSE Linux 9系統的/proc/scsi/qla2xxx目錄下通常存在兩個文件:一、2或者三、4,這些文件包含FC HBA卡的配置信息。
[root@localhost qla2xxx]# pwd
/proc/scsi/qla2xxx
[root@localhost qla2xxx]# ls
3 4
[root@localhost qla2xxx]# cat 3
QLogic PCI to Fibre Channel Host Adapter for QLA2342:
Firmware version 3.03.18 IPX, Driver version 8.01.02-d4
ISP: ISP2312, Serial# P21735
Request Queue = 0x11f580000, Response Queue = 0x11f4d0000
Request Queue count = 4096, Response Queue count = 512
Total number of active commands = 0
Total number of interrupts = 3354
Device queue depth = 0x10
Number of free request entries = 4094
Number of mailbox timeouts = 0
Number of ISP aborts = 0
Number of loop resyncs = 0
Number of retries for empty slots = 0
Number of reqs in pending_q= 0, retry_q= 0, done_q= 0, scsi_retry_q= 0
Host adapter:loop state = <READY>, flags = 0x1a03
Dpc flags = 0x4000000
MBX flags = 0x0
Link down Timeout = 000
Port down retry = 035
Login retry count = 035
Commands retried with dropped frame(s) = 0
Product ID = 4953 5020 2020 0002
SCSI Device Information:
scsi-qla0-adapter-node=2000001882374738;
scsi-qla0-adapter-port=2100001882374738;
FC Port Information:
scsi-qla0-port-0=200000188237b206:210000188237b206:010a00:81;
SCSI LUN Information:
(Id:Lun) * - indicates lun is not registered with the OS.
其中,SCSI Device Information下面的scsi-qla0-adapter-port=2100001882374738即是主機光纖卡的WWN號。
二、
RedHat Linux AS5
和
SuSE Linux 10
RedHat Linux AS5與SuSE Linux 10中查看FC HBA卡信息的方法基本一致,在此在RedHat Linux AS5爲便介紹如何查看FC HBA卡信息。
RedHat AS5系統的 /sys/class/fc_host/host*/port_name 這個文件包含了全部已被系統發現的FC HBA卡的信息,使用查看命令查看該文件的內容便可看到FC HBA卡的信息。
查看WWPN:cat /sys/class/fc_host/host*/port_name
查看WWNN:cat /sys/class/fc_host/host*/node_name
最後就是Unix了,在此介紹實際應用較爲普遍的UNIX系統中如何查看FC HBA卡信息,包括IBM AIX、SUN SOLARIS、HP-UNIX。
一、
IBM AIX
① 查看AIX主機鏈接的光纖設備
# lsdev -Cc adapter -S a | grep fcs
fcs0 Available 09-08 FC Adapter
fcs1 Available 09-09 FC Adapter
上面的輸出顯示有2塊光纖卡:fcs0和fcs1。
② 查看光纖卡fcs0的WWN號
# lscfg -vpl fcs0
fcs0 U787B.001.DNWG664-P1-C1-T1 FC Adapter
Part Number.................10N8620
Serial Number...............1B74404468
Manufacturer................001B
EC Level....................A
Customer Card ID Number.....5759
FRU Number.................. 10N8620
Device Specific.(ZM)........3
Network Address.............10000000C96E2898
ROS Level and ID............02C82138
Device Specific.(Z0)........1036406D
Device Specific.(Z1)........00000000
Device Specific.(Z2)........00000000
Device Specific.(Z3)........03000909
Device Specific.(Z4)........FFC01159
Device Specific.(Z5)........02C82138
Device Specific.(Z6)........06C12138
Device Specific.(Z7)........07C12138
Device Specific.(Z8)........20000000C96E2898
Device Specific.(Z9)........BS2.10X8
Device Specific.(ZA)........B1F2.10X8
Device Specific.(ZB)........B2F2.10X8
Device Specific.(ZC)........00000000
Hardware Location Code......U787B.001.DNWG664-P1-C1-T1
上面命令的輸出中,加粗紅色的部分就是光纖卡的WWN號。
二、
SUN SOLARIS
① 查詢現有存儲設備和光纖設備,能夠讀到包括磁盤設備的WWN號
# luxadm probe
② 查看HBA的prot,能夠獲得HBA卡的port值以及屬性
# luxadm -e port
/devices/pci@0,0/pci1022,7450@2/pci1077,101@1/fp@0,0:devctl NOT CONNECTED
/devices/pci@0,0/pci1022,7450@2/pci1077,101@1,1/fp@0,0:devctl CONNECTED
從中能夠看到僅有一塊光纖卡鏈接到存儲設備。
③ 選擇已經鏈接的HBA卡,查看其WWN號
# luxadm -e dump_map /devices/pci@0,0/pci1022,7450@2/pci1077,101@1/fp@0,0:devctl
Pos Port_ID Hard_Addr Port WWN Node WWN Type
0 0 0 210000e08b19827a 200000e08b19827a 0x1f (Unknown Type,Host Bus Adapter)
三、
HP-UNIX
① 列出HP機上鍊接的光纖卡設備
# ioscan -fnC fc
Class I H/W Path Driver S/W State H/W Type Description
=================================================================
fc 0 0/3/1/0 fcd CLAIMED INTERFACE HP A6826-60001 2Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
/dev/fcd0
fc 1 0/3/1/1 fcd CLAIMED INTERFACE HP A6826-60001 2Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 2)
/dev/fcd1
從上面命令的輸出能夠看 ,/dev/fcd0 和 /dev/fcd1兩塊光纖卡。
② 查看光纖卡的WWN號
# fcmsutil /dev/fcd0
Vendor ID is = 0x001077
Device ID is = 0x002312
PCI Sub-system Vendor ID is = 0x00103c
PCI Sub-system ID is = 0x0012ba
PCI Mode = PCI-X 133 MHz
ISP Code version = 3.3.18
ISP Chip version = 3
Topology = PTTOPT_FABRIC
Link Speed = 2Gb
Local N_Port_id is = 0xa10500
Previous N_Port_id is = None
N_Port Node World Wide Name = 0x50060b00001db241
N_Port Port World Wide Name = 0x50060b00001db240
Switch Port World Wide Name = 0x205e000dec0e2e00
Switch Node World Wide Name = 0x2001000dec0e2e01
Driver state = ONLINE
Hardware Path is = 0/3/1/0
Maximum Frame Size = 2048
Driver-Firmware Dump Available = NO
Driver-Firmware Dump Timestamp = N/A
Driver Version = @(#) libfcd.a HP Fibre Channel ISP 23xx & 24xx Driver B.11.23.04 /ux/core/isu/FCD/kern/src/common/wsio/fcd_init.c:Oct 18 2005,08:21:11
其中紅色加粗部分顯示了HBA卡的WWNN和WWPN號,另外還能看到該HBA卡鏈接的光纖交換機端口的WWN號。