在配置磁盘阵列或虚拟磁带库时,往往会以FC接口与主机对接,那就涉及FC HBA卡的查看,本文就此问题在各种系统下的查看方法进行总结与整理。
一、Windows 系统
在Windows系统中,可以使用FC HBA卡厂家提供的管理软件查看光纤适配器的WWN号码,具体如下:
Qlogic:SANsurfer
Emulex:HBAnyware
二、SuSE Linux 9
查看 /proc/scsi/qla2xxx/* ,并以 adapter-port 为关键字过滤即可查看FC HBA卡的WWN信息:
# cat /proc/scsi/qla2xxx/* | grep adapter-port
scsi-qla0-adapter-port=21000018822c8a2c;
scsi-qla1-adapter-port=21000018822c8a2d;
三、SuSE Linux 10
查看 /sys/class/fc_host/host*/port_name 文件的内容即可看到对应FC HBA卡的WWN信息:
# cat /sys/class/fc_host/host*/port_name
0x210000e08b907955
0x210000e08b902856
四、RedHat Linux AS4
# grep scsi /proc/scsi/qla2xxx/3
Number of reqs in pending_q= 0, retry_q= 0, done_q= 0, scsi_retry_q= 0
scsi-qla0-adapter-node=20000018822d7834;
scsi-qla0-adapter-port=21000018822d7834;
scsi-qla0-target-0=202900a0b8423858;
scsi-qla0-port-0=200800a0b8423858:202900a0b8423858:0000e8:1;
五、RedHat Linux AS5
# cat /sys/class/fc_host/hostx/port_name
六、Solaris 10
提供了fcinfo命令,可以使用 fcinfo hba-port 查看FC HBA的WWN信息:
# fcinfo hba-port
查看光纤卡端口的路径及连接状态:
# luxadm -e port
查看端口的WWN:
# luxadm -e dump_map fibre_channel_HBA_port // 上一命令的输出
# prtconf –vp | grep -i wwn
# prtpicl –v | grep -i wwn (prtpicl - print PICL tree)
七、HP-UX
# ioscan –funC fc // 找到HBA卡,再用fcmsutil查看HBA卡信息
# fcmsutil /dev/fcd0(1)
ioscan -fn
将会得到一个所有 I/O 相关的信息,包括光纤卡信息:
Class I - H/W Path----Driver - S/W State - H/W Type ---Description
======================================================================
ba -------3 -0/3 -------lba ----- CLAIMED -BUS_NEXUS --Local PCI Bus Adapter
fc -------0 -0/3/0/0-----td ---- -CLAIMED -INTERFACE---HP TachyonTL/TS
Fibre
------------------------/dev/td0
fcp ------4 -0/3/0/0.2 -fcp ---- -CLAIMED -INTERFACE --FCP Domain
ext_bus -28 -0/3/0/0.2
-------------- .16.0.0 -fcparray -CLAIMED--INTERFACE --FCP ArrayInterfac ----
target ---6 -0/3/0/0.2--tgt ----- CLAIMED -DEVICE
-------------.16.0.0.0
在上例中,第一个光纤卡的设备名是/dev/td0。我们用 fcsmutil 来显示这一特定卡的信息:
-> fcsmutil /dev/td0
--------------------Vendor ID is = 0x00103c
--------------------Device ID is = 0x001028
--------------------PCI Sub-system Vendor ID is = 0x00103c
--------------------PCI Sub-system ID is = 0x000006
--------------------Topology = PTTOPT_FABRIC
--------------------Local N_Port_id is = 0x021c00
--------------------N_Port Node World Wide Name = 0x50060b0000072dad
--------------------N_Port Port World Wide Name = 0x50060b0000072dac
--------------------Driver state = ONLINE
--------------------Hardware Path is = 0/3/0/0
-------------Number of Assisted IOs = 538248
--------------------Number of Active Login Sessions = 1
->
从以上的输出中,可以得到光纤卡的WWN。
八、AIX
# lsdev -Cc adapter // 找出HBA卡
# lscfg –vpl fcs0 |grep network address
备注:
Emulex的HBA的WWN的第一个数字为1
Qlogic的HBA的WWN的第一个数字为2
HP Tachyon HBA的WWN的第一个数字为5
Qlogic参数
Connection Options
0 - Loop only
1 - Point-to-point only
2 - Loop preferred,otherwise point-to-point.
按服务器那边的建议,DAS直连存储时选择loop only,通过光纤交换机连接存储时选择point-to-point only
Data Rate
该配置项定义FC端口速率
0 - 1Gb/s
1 - 2Gb/s
2 – Auto
九 补充一点
Linux 在系统日志文件中记载加载模块和驱动程序过程中提供了这样的信息,该文件通常放在 /var/log/messages中。每过一段时间,会生成一个新的日志文件messages,旧的文件就会被改名成messages.#,其中 # 是一个增加的编号。
以root登录,并查看系统日志文件中包含最后服务器启动时的信息,
用以下的命令:
less /var/log/messages
查找最后系统启动和对光纤卡初始化信息。对每个卡,你将看到启动的过程,当卡被打开时,将会显示 WWN 信息:
Mar 5 10:32:25 kernel: (scsi): Found a QLA2200 @ bus 10,device 8, irq 23, iobase 0xb000
Mar 5 10:32:25 kernel: scsi(2): Configure NVRAM parameters...
Mar 5 10:32:25 kernel: scsi(2): Verifying loaded RISC code...
Mar 5 10:32:25 kernel: scsi(2): Verifying chip...
Mar 5 10:32:25 kernel: scsi(2): LIP reset occurred
Mar 5 10:32:25 kernel: scsi(2): LIP occurred.
Mar 5 10:32:25 kernel: scsi(2): Waiting for LIP to complete...
Mar 5 10:32:25 kernel: scsi(2): LOOP UP detected
Mar 5 10:32:25 kernel: scsi(2): Waiting for LIP to complete...
Mar 5 10:32:25 kernel: scsi2: Topology - (Loop), Host Loop address 0x0
Mar 5 10:32:25 kernel: scsi-qla0-adapter-node=0000000000000000;
Mar 5 10:32:25 kernel: scsi-qla0-adapter-port=210000e08b027386;
Mar 5 10:32:25 kernel: scsi-qla0-target-0=200500a0b80b1223;
Mar 5 10:32:25 kernel: (scsi): Found a QLA2200 @ bus 10, device 9, irq 24, iobase 0xb100
Mar 5 10:32:25 kernel: scsi(3): Configure NVRAM parameters...
Mar 5 10:32:25 kernel: scsi(3): Verifying loaded RISC code...
Mar 5 10:32:25 kernel: scsi(3): Verifying chip...
Mar 5 10:32:25 kernel: scsi(3): Waiting for LIP to complete...
Mar 5 10:32:25 kernel: scsi(3): LIP reset occurred
Mar 5 10:32:25 kernel: scsi(3): LIP occurred.
Mar 5 10:32:25 kernel: scsi(3): LOOP UP detected
Mar 5 10:32:25 kernel: scsi(3): Waiting for LIP to complete...
Mar 5 10:32:25 kernel: scsi3: Topology - (Loop), Host Loop address 0x1
Mar 5 10:32:25 kernel: scsi-qla1-adapter-node=0000000000000000;
Mar 5 10:32:25 kernel: scsi-qla1-adapter-port=210000e08b027286;
Mar 5 10:32:25 kernel: scsi-qla1-target-0=200400a0b80b1223;
可以看到在 scsi-qla?-adapter-port 行中的等号后就是该卡的 WWN.
注意:还有一种更简单的办法,用dmesg命令同样可以查找到wwn。