ITPub博客

首页 > IT基础架构 > 服务器/存储 > 各操作系统查看HBA和WWN的方法

各操作系统查看HBA和WWN的方法

服务器/存储 作者:sDon 时间:2014-12-31 00:26:20 0 删除 编辑

1.         Linux 中使用Systool查看HBA信息

命令systool可以查看

[root@ABM-APP1 bin]# systool -c fc_host -v | more

Class = "fc_host"

  Class Device = "host3"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3/fc_host/host3"

    dev_loss_tmo        = "16"

    fabric_name         = "0x2001002a6a361e19"

    issue_lip           =

    max_npiv_vports     = "254"

    node_name           = "0x5001438028cec4bd"

    npiv_vports_inuse   = "0"

    port_id             = "0x051100"

    port_name           = "0x5001438028cec4bc"

    port_state          = "Online"

    port_type           = "NPort (fabric via point-to-point)"

    speed               = "8 Gbit"

    supported_classes   = "Class 3"

    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"

    symbolic_name       = "HPAJ764A FW:v5.06.05 DVR:v8.04.00.04.06.3-k"

    system_hostname     = ""

    tgtid_bind_type     = "wwpn (World Wide Port Name)"

    uevent              =

    vport_create        =

    vport_delete        =

    Device = "host3"

    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3"

      fw_dump             =

      nvram               = "ISP "

      optrom              =

      optrom_ctl          =

      reset               =

      sfp                 = ""

      uevent              = "DEVTYPE=scsi_host"

      vpd                 = ""

  Class Device = "host4"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.1/host4/fc_host/host4"

    dev_loss_tmo        = "16"

    fabric_name         = "0x2001002a6a361e19"

    issue_lip           =

    max_npiv_vports     = "254"

    node_name           = "0x5001438028cec4bf"

    npiv_vports_inuse   = "0"

    port_id             = "0x051200"

    port_name           = "0x5001438028cec4be"

    port_state          = "Online"

    port_type           = "NPort (fabric via point-to-point)"

    speed               = "8 Gbit"

    supported_classes   = "Class 3"

    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"

    symbolic_name       = "HPAJ764A FW:v5.06.05 DVR:v8.04.00.04.06.3-k"

    system_hostname     = ""

    tgtid_bind_type     = "wwpn (World Wide Port Name)"

    uevent              =

    vport_create        =

    vport_delete        =

    Device = "host4"

    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.1/host4"

      fw_dump             =

      nvram               = "ISP "

      optrom              =

      optrom_ctl          =

      reset               =

      sfp                 = ""

      uevent              = "DEVTYPE=scsi_host"

      vpd                 = ""

可以看出os把两个hba识别为host3host4(嗯~~风格和solaris很不一样)。一般情况下,一个卡

node_nameport_name 就是指该HBA卡的wwn,他们的值是一样的。速度啊什么的该列的参数都给你列出来了。

还有一个借助systool能看到你的hba卡和哪些设备连接(或者说能看到哪些存储)。

[root@ABM-APP1 bin]# systool -c fc_remote_ports -v|more

Class = "fc_remote_ports"

  Class Device = "0-0"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3/rport-3:0-0/fc_remote_ports/r

port-3:0-0"

    dev_loss_tmo        = "16"

    fast_io_fail_tmo    = "off"

    node_name           = "0x50000975f0065000"

    port_id             = "0x050900"

    port_name           = "0x50000975f0065144"

    port_state          = "Online"

    roles               = "FCP Target"

    scsi_target_id      = "0"

    supported_classes   = "Class 3"

    uevent              =

    Device = "rport-3:0-0"

    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3/rport-3:0-0"

      uevent              =

  Class Device = "0-0"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.1/host4/rport-4:0-0/fc_remote_ports/r

port-4:0-0"

    dev_loss_tmo        = "16"

    fast_io_fail_tmo    = "off"

    node_name           = "0xffffffffffffffff"

    port_id             = "0xffffffff"

    port_name           = "0x50000975f0065184"

    port_state          = "Not Present"

    roles               = "unknown"

    scsi_target_id      = "0"

    supported_classes   = "unspecified"

--More—

2.         Windows 系统

方法一:在Windows系统中,可以使用FC HBA卡厂家提供的管理软件查看光纤适配器的WWN号码,具体如下:

QlogicSANsurfer

EmulexHBAnyware

方法二:windows下如何查找HBA卡的wwn号, windows系统默认没有查看HBAWWN的软件,但是微软提供了一个名为“fcinfo”的公用程序可以实现这个功能,其按照和使用如下: 针对不同的CPU,此软件分为三个版本: fcinfo_amd64(AMD64平台) fcinfo_ia64(安腾平台) fcinfo_X86(X86平台) 选择合适的平台版本安装。软件下载官方地址:http://www.microsoft.com/en-us/download/details.aspx?id=17530 软件安装完以后,在CMD下运行“fninfo”,即可看见结果:

3.         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;

4.         SuSE Linux 10

查看 /sys/class/fc_host/host*/port_name 文件的内容即可看到对应FC HBA卡的WWN信息:

# cat /sys/class/fc_host/host*/port_name

0x210000e08b907955

0x210000e08b902856

5.         RedHat Linux AS4

查看HBAWWN

# 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;

Linux 内核从2.6.11开始,一部分设备信息从/proc中移到了/sys中。

6.         Solaris 10

提供了fcinfo命令,可以使用 fcinfo hba-port 查看FC HBAWWN信息:

# 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)

7.         HP-UX

找到HBA

# ioscan funC fc

查看HBA卡信息

# fcmsutil /dev/fcd0(1)

8.         AIX

找出HBA

# lsdev -Cc adapter

查看HBA卡的WWN

# lscfg –vpl fcs0 |grep network address

备注:

AIXHBAKWWN号的规律:

EmulexHBAWWN的第一个数字为1

QlogicHBAWWN的第一个数字为2

HP Tachyon HBAWWN的第一个数字为5

9.         RedHat Linux AS5SuSE Linux 10

RedHat Linux AS5SuSE Linux 10中查看FC HBA卡信息的方法基本一致,在此在RedHat Linux AS5为便介绍如何查看FC HBA卡信息。

RedHat AS5系统的 /sys/class/fc_host/host*/port_name 这个文件包含了所有已被系统发现的FC HBA卡的信息,使用查看命令查看该文件的内容即可看到FC HBA卡的信息。

查看WWPNcat /sys/class/fc_host/host*/port_name

查看WWNNcat /sys/class/fc_host/host*/node_name

1.         Linux 中使用Systool查看HBA信息

命令systool可以查看

[root@ABM-APP1 bin]# systool -c fc_host -v | more

Class = "fc_host"

  Class Device = "host3"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3/fc_host/host3"

    dev_loss_tmo        = "16"

    fabric_name         = "0x2001002a6a361e19"

    issue_lip           =

    max_npiv_vports     = "254"

    node_name           = "0x5001438028cec4bd"

    npiv_vports_inuse   = "0"

    port_id             = "0x051100"

    port_name           = "0x5001438028cec4bc"

    port_state          = "Online"

    port_type           = "NPort (fabric via point-to-point)"

    speed               = "8 Gbit"

    supported_classes   = "Class 3"

    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"

    symbolic_name       = "HPAJ764A FW:v5.06.05 DVR:v8.04.00.04.06.3-k"

    system_hostname     = ""

    tgtid_bind_type     = "wwpn (World Wide Port Name)"

    uevent              =

    vport_create        =

    vport_delete        =

    Device = "host3"

    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3"

      fw_dump             =

      nvram               = "ISP "

      optrom              =

      optrom_ctl          =

      reset               =

      sfp                 = ""

      uevent              = "DEVTYPE=scsi_host"

      vpd                 = ""

  Class Device = "host4"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.1/host4/fc_host/host4"

    dev_loss_tmo        = "16"

    fabric_name         = "0x2001002a6a361e19"

    issue_lip           =

    max_npiv_vports     = "254"

    node_name           = "0x5001438028cec4bf"

    npiv_vports_inuse   = "0"

    port_id             = "0x051200"

    port_name           = "0x5001438028cec4be"

    port_state          = "Online"

    port_type           = "NPort (fabric via point-to-point)"

    speed               = "8 Gbit"

    supported_classes   = "Class 3"

    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"

    symbolic_name       = "HPAJ764A FW:v5.06.05 DVR:v8.04.00.04.06.3-k"

    system_hostname     = ""

    tgtid_bind_type     = "wwpn (World Wide Port Name)"

    uevent              =

    vport_create        =

    vport_delete        =

    Device = "host4"

    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.1/host4"

      fw_dump             =

      nvram               = "ISP "

      optrom              =

      optrom_ctl          =

      reset               =

      sfp                 = ""

      uevent              = "DEVTYPE=scsi_host"

      vpd                 = ""

可以看出os把两个hba识别为host13host14(嗯~~风格和solaris很不一样)。一般情况下,一个卡

node_nameport_name 就是指该HBA卡的wwn,他们的值是一样的。速度啊什么的该列的参数都给你列出来了。

还有一个借助systool能看到你的hba卡和哪些设备连接(或者说能看到哪些存储)。

[root@ABM-APP1 bin]# systool -c fc_remote_ports -v|more

Class = "fc_remote_ports"

  Class Device = "0-0"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3/rport-3:0-0/fc_remote_ports/r

port-3:0-0"

    dev_loss_tmo        = "16"

    fast_io_fail_tmo    = "off"

    node_name           = "0x50000975f0065000"

    port_id             = "0x050900"

    port_name           = "0x50000975f0065144"

    port_state          = "Online"

    roles               = "FCP Target"

    scsi_target_id      = "0"

    supported_classes   = "Class 3"

    uevent              =

    Device = "rport-3:0-0"

    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.0/host3/rport-3:0-0"

      uevent              =

  Class Device = "0-0"

  Class Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:11:00.1/host4/rport-4:0-0/fc_remote_ports/r

port-4:0-0"

    dev_loss_tmo        = "16"

    fast_io_fail_tmo    = "off"

    node_name           = "0xffffffffffffffff"

    port_id             = "0xffffffff"

    port_name           = "0x50000975f0065184"

    port_state          = "Not Present"

    roles               = "unknown"

    scsi_target_id      = "0"

    supported_classes   = "unspecified"

--More—

2.         Windows 系统

方法一:在Windows系统中,可以使用FC HBA卡厂家提供的管理软件查看光纤适配器的WWN号码,具体如下:

QlogicSANsurfer

EmulexHBAnyware

方法二:windows下如何查找HBA卡的wwn号, windows系统默认没有查看HBAWWN的软件,但是微软提供了一个名为“fcinfo”的公用程序可以实现这个功能,其按照和使用如下: 针对不同的CPU,此软件分为三个版本: fcinfo_amd64(AMD64平台) fcinfo_ia64(安腾平台) fcinfo_X86(X86平台) 选择合适的平台版本安装。软件下载官方地址:http://www.microsoft.com/en-us/download/details.aspx?id=17530 软件安装完以后,在CMD下运行“fninfo”,即可看见结果:

3.         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;

4.         SuSE Linux 10

查看 /sys/class/fc_host/host*/port_name 文件的内容即可看到对应FC HBA卡的WWN信息:

# cat /sys/class/fc_host/host*/port_name

0x210000e08b907955

0x210000e08b902856

5.         RedHat Linux AS4

查看HBAWWN

# 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;

Linux 内核从2.6.11开始,一部分设备信息从/proc中移到了/sys中。

6.         Solaris 10

提供了fcinfo命令,可以使用 fcinfo hba-port 查看FC HBAWWN信息:

# 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)

7.         HP-UX

找到HBA

# ioscan funC fc

查看HBA卡信息

# fcmsutil /dev/fcd0(1)

8.         AIX

找出HBA

# lsdev -Cc adapter

查看HBA卡的WWN

# lscfg –vpl fcs0 |grep network address

备注:

AIXHBAKWWN号的规律:

EmulexHBAWWN的第一个数字为1

QlogicHBAWWN的第一个数字为2

HP Tachyon HBAWWN的第一个数字为5

9.         RedHat Linux AS5SuSE Linux 10

RedHat Linux AS5SuSE Linux 10中查看FC HBA卡信息的方法基本一致,在此在RedHat Linux AS5为便介绍如何查看FC HBA卡信息。

RedHat AS5系统的 /sys/class/fc_host/host*/port_name 这个文件包含了所有已被系统发现的FC HBA卡的信息,使用查看命令查看该文件的内容即可看到FC HBA卡的信息。

查看WWPNcat /sys/class/fc_host/host*/port_name

查看WWNNcat /sys/class/fc_host/host*/node_name

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/645199/viewspace-1385615/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-20

  • 博文量
    39
  • 访问量
    241131