操作系统是centos7.3,本方法仅适用于支持LSI的raid卡
1. 安装storcli
下载rpm包: storcli-1.16.06-1.noarch.rpm
传到操作系统上,本地安装:
#yum localinstall storcli-1.16.06-1.noarch.rpm
2. 查询raid卡
#/opt/MegaRAID/storcli/storcli64 show
如果你的机器有多张raid卡,会按照顺序显示
3. 查询raid卡下的磁盘
#/opt/MegaRAID/storcli/storcli64/c$x show
$x替换成0或者1,可以从步骤2中获取这个值
示例:
#/opt/MegaRAID/storcli/storcli64 /c1 show
结果示例:
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
----------------------------------------------------------------------------------------------
8:0 10 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:1 20 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:2 9 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:3 12 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:4 11 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:5 13 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:6 18 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
8:7 14 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
其中,关键数值是:
EID:EnclosureDevice ID
DID:DeviceID
SLT:SlotNo.
4. 查询盘符
[root@test-5 ~]# lsscsi
[0:0:8:0] disk ATA SSDSC2BA400G4N LS36 /dev/sda
[0:0:9:0] disk ATA SSDSC2BA400G4N LS36 /dev/sdb
[1:0:8:0] enclosu IBM-ESXS SAS EXP BP N551 -
[1:0:9:0] disk ATA MG04ACA600E TJ42 /dev/sdc
[1:0:10:0] disk ATA MG04ACA600E TJ42 /dev/sdd
[1:0:11:0] disk ATA MG04ACA600E TJ42 /dev/sde
[1:0:12:0] disk ATA MG04ACA600E TJ42 /dev/sdf
[1:0:13:0] disk ATA MG04ACA600E TJ42 /dev/sdg
[1:0:14:0] disk ATA MG04ACA600E TJ42 /dev/sdh
[1:0:16:0] disk ATA MG04ACA600E TJ42 /dev/sdk
[1:0:18:0] disk ATA MG04ACA600E TJ42 /dev/sdi
[1:0:20:0] disk ATA MG04ACA600E TJ42 /dev/sdj
[1:0:20:0] 左边括号里面值的含义是:
[controllerID:未知:DID:未知]
5. 结合步骤4和步骤5,可以定位指定盘符的位置编号
例如需要定位sdj盘,那么controllerID/EID/slt编号就应该是c1/e8/s1,关联示例如下:
[1:0:20:0] disk ATA MG04ACA600E TJ42 /dev/sdj
8:1 20 JBOD - 5.456 TB SATA HDD N N 512B MG04ACA600E 00FN17400FN177LEN U
6. 点亮磁盘
#/opt/MegaRAID/storcli/storcli64 /c$x/e$y/s%z start locate
示例:
#/opt/MegaRAID/storcli/storcli64/c1/e8/s1 start locate
7. 定位系统盘
#df –h
查看系统盘盘符,然后使用上面的命令点亮系统盘指示灯。
热插拔硬盘时,不能拔系统盘,否则插回去系统也可能会崩溃。