硬盘定位方法总结

1.具体机器的位置,与现场的维护人员 核对机器的序列号  :

dmidecode -t system

2.系统层面查看报错盘符

tail -1000 /var/log/messages|grep -i -e

warning -e error -e panic -e fail

或者

tail -1000 /var/log/messages|grep -i -E "(warning|error|panic)"


3.定位磁盘

3.1.查看RAID卡型号

lspci | grep -i sas 或 lspci | grep -i lsi

3.2.磁盘点灯

3.2.1 根据RAID卡型号选择合适的工具点灯

3.2.1.1 sas2ircu/sas3ircu

sas2ircu

LSISAS2004  LSISAS2008  LSISAS2108  LSISAS2208  LSISAS2304  LSISAS2308

https://docs.broadcom.com/docs/12353380

sas3ircu

LSISAS3008  LSISAS3004

https://docs.broadcom.com/docs/12353382

https://blog.csdn.net/AXW2013/article/details/79592914

(1)通过盘符确定 磁盘序列号(也可用wwn定位)

ls /dev/disk/by-id/ -la | grep sdc

或smartctl -a /dev/sdc |grep Seri -A7 -B3

或hdparm -I /dev/sdc

(2)通过序列号定位磁盘

./sas3ircu 0 display |grep PN1334PEK3ZNES -A2 -B7

(3)硬盘点灯

打开定位灯:

sas3ircu ${SAS_ID} locate 2:${SLOT} on

本例:

sas3ircu ${SAS_ID} locate 2:3 on

关闭定位灯:

sas3ircu ${SAS_ID} locate 2:${SLOT} off

本例:

sas3ircu ${SAS_ID} locate 2:3 off

3.2.1.2 Megacli

LSI SAS3108

(1) 通过盘符确定 磁盘wwn (也可用序列号定位)

ls -la /dev/disk/by-id/ | grep sdag

或smartctl -i /dev/sdb

或hdparam -I /dev/sdb

(2) 通过wwn 定位 位置 MegaCli64  -PDList -aALL  |grep -e "Enclosure Device ID" -e "Slot Number:" -e "WWN:"

[root@node111 MegaCli]# ./MegaCli64  -PDList -aALL  |grep -e "Enclosure Device ID" -e "Slot Number:" -e "WWN:"

Enclosure Device ID: 252

Slot Number: 0

WWN: 5000cca39ccd3367

Enclosure Device ID: 252

Slot Number: 1

WWN: 5000cca39ccd5618

Enclosure Device ID: 252

Slot Number: 2

WWN: 55cd2e404c7a2d57

Enclosure Device ID: 252

Slot Number: 3

WWN: 55cd2e404c77d90e

Enclosure Device ID: 252

Slot Number: 4

WWN: 5000cca39ccd1432

Enclosure Device ID: 252

Slot Number: 5

WWN: 5000cca39ccd1c6d

Enclosure Device ID: 252

Slot Number: 6

WWN: 5000cca39ccd2749

Enclosure Device ID: 252

Slot Number: 7

WWN: 5000cca39ccd335b

或者直接用命令 :

/opt/MegaRAID/MegaCli/MegaCli64  -PDList -aALL  |grep -e "Enclosure Device ID" -e "Slot Number:" -e "WWN:"| grep -i "5000cca098c55ae1" -B2

[root@sdsgl-4f-b01-9u2-node02 ~]# /opt/MegaRAID/MegaCli/MegaCli64  -PDList -aALL  |grep -e "Enclosure Device ID" -e "Slot Number:" -e "WWN:"| grep -i "5000c500a4d5927e" -B2

Enclosure Device ID: 0

Slot Number: 4

WWN: 5000c500a4d5927e

(3) 给硬盘点灯 

/opt/MegaRAID/MegaCli/MegaCli64  -PdLocate  -start  –physdrv[Enclosure Device ID:Slot Number]  -a0

本例中:

/opt/MegaRAID/MegaCli/MegaCli64  -PdLocate  -start  –physdrv[9:18]  -a0

关闭定位灯(针对有些机器磁盘的状态灯常亮 ):

/opt/MegaRAID/MegaCli/MegaCli64  -PdLocate  -stop  –physdrv[Enclosure Device ID:Slot Number]  -a0

本例中:

/opt/MegaRAID/MegaCli/MegaCli64 -PDLocate -start -physdrv[64:26] -a0

补充:

./MegaCli64 -PDList -aALL | grep -Ei "(Slot Number|Inquiry Data)" 查看硬盘盘符与序列号

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 前述 很多情况下,我们需要从OS下查询硬盘的SN,来定位硬盘的物理槽位。如:系统下硬盘报错,对于系统下的硬盘的报错...
    小蜗牛1218阅读 5,455评论 0 2
  • 由于本人是从事IDC运维工作,需要经常和服务器打交道。接触过IDC的朋友,一定会使用过ipmitool和megac...
    妞儿是只猫阅读 26,707评论 1 8
  • 在线制作举例: 注意:如果在线做raid要先卸载磁盘再做,要不然磁盘盘位会后移 /opt/MegaRAID/Meg...
    潘志成_82ef阅读 1,866评论 0 0
  • 按照常理说,硬盘故障了,会自动亮红灯,故障消除后会自动恢复正常,这个本来是服务器自带的功能。但现实情况往往不是这样...
    小小运维阅读 16,619评论 1 8
  • trouble shooting Dell的raid卡是lsi mega raid的重新封装,芯片是一样的,型号是...
    user1678阅读 2,624评论 0 2