Linux 磁盘命令 HBA卡命令
首页 > IT > Unix/Linux   作者:eehello  2020年12月24日 14:46 星期四  浏览:4404  字号:   评论:0 条
时间:2020-12-24 14:46   浏览:4404  评论:0 条 

smartctl 命令查看硬盘序列号


在配置磁盘阵列或虚拟磁带库时,往往会以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)
八、AIX
# lsdev -Cc adapter                        // 找出HBA卡
# lscfg –vpl fcs0 |grep network address

九、Debian

First you will need to install sysfsutils:

sudo apt-get install sysfsutils

Next: systool -c fc_host -v

 

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

[tmp]# systool -c fc_remote_ports -v|more
Class = "fc_remote_ports"

  Class Device = "0-0"
  Class Device path = "/sys/class/fc_remote_ports/rport-13:0-0"
    dev_loss_tmo        = "60"
    fast_io_fail_tmo    = "off"
    node_name           = "0xxxxxxxxxxxx"
    port_id             = "0x330400"
    port_name           = "0xxxxxxxxxxx"
    port_state          = "Online"
    roles               = "FCP Initiator"
    scsi_target_id      = "-1"
    supported_classes   = "Class 3"
    uevent              = <store method only>

备注:
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

------------------------------------------------------------------------------------------


这个一个用于控制和监控支持smart技术的硬盘的命令。通常配合 -a 选项我们可以查看到比较详尽的硬盘信息(比如序列号、硬盘容量、已运行时间、硬盘健康状况等)。用法如下:

#yum -y install smartmontools

root@linuxtechi:~# smartctl -i /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Momentus 5400.6
Device Model:     ST9320325AS
Serial Number:    5VD2V59T
LU WWN Device Id: 5 000c50 020a37ec4
Firmware Version: 0002BSM1
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    5400 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 2.6, 1.5 Gb/s
Local Time is:    Sun Nov 16 12:32:09 2014 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


systool 工具查看HBA卡WWN号
systool 是系统上一的个查看sys信息的工具,在redhat、suse发行版里都有该工具,其位于sysfsutils rpm包中:
# rpm -qf /usr/bin/systool
sysfsutils-2.1.0-7.el6.x86_64
查看HBA卡的信息,如下:
# systool -av -c fc_host

Class = "fc_host"
  Class Device = "host1"
  Class Device path = "/sys/class/fc_host/host1"
    active_fc4s         = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    fabric_name         = "0x100000051efabe32"
    issue_lip           = <store method only>
    maxframe_size       = "2048 bytes"
    node_name           = "0x2000286ed4233d6a"
    port_id             = "0x010900"
    port_name           = "0x2100286ed4233d6a"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "2 Gbit"
    supported_classes   = "Class 3"
    supported_fc4s      = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit"
    symbolic_name       = "Emulex FC3532 FV2.72A2 DV8.1.10.3"
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>
    Device = "host1"
    Device path = "/sys/devices/pci0000:00/0000:00:04.0/0000:0b:00.0/host1"
      uevent              = <store method only>






 您阅读这篇文章共花了: 
二维码加载中...
本文作者:eehello      文章标题: Linux 磁盘命令 HBA卡命令
本文地址:https://www.xxnet.eu.org/?post=270
版权声明:若无注明,本文皆为“点滴记忆---观雨亭”原创,转载请保留文章出处。

返回顶部| 首页| 手气不错| 留言板|后花园

Copyright © 2014-2023 点滴记忆---观雨亭