手动创建 raid
##删除raid
root@scaler:~# /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L2 -A0
##创建raid
root@scaler:~# /opt/MegaRAID/MegaCli/MegaCli64 CfgLDAdd -r5 [41:5,41:6,41:7,41:8,41:9,41:10,41:11,41:12,41:13,41:14] -strpsz128 -A0
raid 卡日志,保存到文件
/opt/MegaRAID/MegaCli/MegaCli64 -AdpEventLog -GetEvents -f raid.envent.log -a0
新加入硬盘,重新插拔硬盘
清除foreign key
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Scan -aALL
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Clear -aALL
如何查看和清除 raid的 cache ##删除,重建raid时可能需要
/opt/MegaRAID/MegaCli/MegaCli64 -GetPreservedCacheList -aALL
/opt/MegaRAID/MegaCli/MegaCli64 -DiscardPreservedCache -L7 -aall
/opt/MegaRAID/MegaCli/MegaCli64 -PDMakeGood -PhysDrv[8:1] -a0
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -import -a0
常用检查 磁盘erro
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0|grep -Ei “enc|Slot Number|Firmware stat|media error |other error”
raid一致性检查
禁用一直性 检查
/opt/MegaRAID/MegaCli/MegaCli64 -AdpCcSched -Dsbl -Aall
启用一致性检查,
/opt/MegaRAID/MegaCli/MegaCli64 -AdpCcSched -ModeConc -Aall
查看一直性检查 信息
/opt/MegaRAID/MegaCli/MegaCli64 -AdpCcSched -info -Aall
在pdlist 中可以看到 硬盘类型
Media Type: Hard Disk Device,,如果是固态盘,会显示 solid state device
PD Type: SAS,,这个应该可以判断是 sata盘 还是sas盘。。
flush raid cache
/opt/MegaRAID/MegaCli/MegaCli64 -AdpCacheFlush -Aall
闪烁硬盘
MegaCli -PdLocate -start -physdrv [E:S] -aALL
write back 只对写有用。
BBu状态 会影响到 write back 模式 是否开启。
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -Aall
对某一个具体的 logic disk 查看 all 改成 对应0,1,
物理盘,逻辑盘一起看
megacli -LdPdInfo -aALL
关闭raid组的告警
-AdpSetProp AlarmDsbl -aALL
/opt/MegaRAID/MegaCli/MegaCli64 ldpdinfo -aall |egrep “Slot |Firmware”
/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll
检查BBBU 状态,期望 optima
root@host185:~# /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll |grep -Ei battery
检查cache policy
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -Aall
Current Cache Policy 期望Current Cache Policy No Write Cache if Bad BBU
Disk Cache Policy 期望 disable
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aAll
设置cache
./MegaCli -LDSetProp NOCachedBadBBU -Lall -aALL
./MegaCli -LDSetProp CachedBadBBU -Lall -aALL
检查RAId 初始化进度
/opt/MegaRAID/MegaCli/MegaCli64 -ldinfo -lall -a0
raid 跟换硬盘后,判断状态
1417 /opt/MegaRAID/MegaCli/MegaCli64 -ldinfo -lall -a0|less
1418 /opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -a0|less
查看每个物理硬盘状态
1419 /opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0|egrep "Slot Number|Firmware stat"
write through 改成 write back
/opt/MegaRAID/MegaCli/MegaCli64 LDSetProp WB -Lall -Aall
##更改1个logic disk
/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp WB -L3 -A0
/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp WB -L4 -A0
查看电池状态
/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL
-AdpBbuCmd -GetBbuCapacityInfo -A0
换硬盘 ,查看rebuild进度
/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -showprog -physDrv [40:7] -a0
关闭 读的cache
/opt/MegaRAID/MegaCli/MegaCli64 LDSetProp Direct -Lall -Aall
关闭 disk cache
/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -DisDskCache -Lall -Aall