各作業系統檢視HBA和WWN的方法

sdon發表於2014-12-31

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平臺) 選擇合適的平臺版本安裝。軟體下載官方地址: 軟體安裝完以後,在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.          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平臺) 選擇合適的平臺版本安裝。軟體下載官方地址: 軟體安裝完以後,在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.          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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章