- 确认raid卡信息
- 安装MegaCli
下载链接:https://raw.githubusercontent.com/crazy-zhangcong/tools/master/MegaCli8.07.10.tar.gz
解压安装如下两个rpm包
- 查看硬盘信息
/opt/MegaRAID/MegaCli/./MegaCli64 -PDList -aALL \
| egrep ‘Adapter|Enclosure Device ID|Coerced Size|Drive Temperature|PD Type|Slot|Inquiry’
参数解释:
Adapter0:第一块卡的意思
Enclosure Device ID:32 这个参数很重要,设置raid要用到
slot neumber :0,硬盘插入的位置
PD type:接口是SATA接口,不是SAS接口
core size:容量
inquiry data:硬盘产商,可以看出是intel出的ssd
Drive temperature:磁盘温度,SATA盘是有温度,ssd没有
- 配置raid
- 定位要配置的磁盘
- 如果不知道配置盘是哪个盘位或者服务器上没有盘位标号,可以借助脚本进行查询,见截图,即要进行操作配置raid的物理磁盘为32:2 slot为2
- 定位要配置的磁盘
- 点亮磁盘
- /opt/MegaRAID/MegaCli/MegaCli64 -PdLocate -start -physdrv[32:2] -a0,对应磁盘会亮灯,不同品牌,亮灯颜色不一样。
- 修改磁盘状态
opt/MegaRAID/MegaCli/MegaCli64 -PDMakeGood -PhysDrv[32:2]-a0,因为是新盘,这里不需要进行修改,如果是用过的盘,需要修改状态
- 查看状态
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -Nolog|grep ‘^Firm’
扫描并清除foregin信息
/opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0 扫描foreign信息
/opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear –a0 清除foreign信息配置raid0
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[32:2] WT Direct -a0
常用命令:
- 查看有哪些raid:
/opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -LALL -aAll
- 清除raid
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -a0 (L1 为 Target ID 号),如下截图: