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)" 查看硬盘盘符与序列号