0
0

MegaCli基本操作

suchasplus 发表于 2016年04月05日 17:56 | Hits: 1365
Tag: Linux | megacli | raid

1. 常用命令:
#/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL 查raid级别
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL 查raid卡信息
#/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL 查看硬盘信息
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll 查看电池信息
#/opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog -Dsply -aALL 查看raid卡日志
#/opt/MegaRAID/MegaCli/MegaCli64 -adpCount 【显示适配器个数】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpGetTime -aALL 【显示适配器时间】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll 【显示所有适配器信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll 【显示所有逻辑磁盘组信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll 【显示所有的物理信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL |grep 'Charger Status' 【查看充电状态】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL【显示BBU状态信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuCapacityInfo -aALL【显示BBU容量信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuDesignInfo -aALL 【显示BBU设计参数】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuProperties -aALL 【显示当前BBU属性】
#/opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL 【显示Raid卡型号,Raid设置,Disk相关信息】

2. 磁带状态的变化,从拔盘,到插盘的过程中

Device |Normal|Damage|Rebuild|Normal
Virtual Drive |Optimal|Degraded|Degraded|Optimal
Physical Drive |Online|Failed -> Unconfigured|Rebuild|Online

3. 查看磁盘缓存策略
#/opt/MegaCli -LDGetProp -Cache -L0 -a0
or
#/opt/MegaCli -LDGetProp -Cache -L1 -a0
or
#/opt/MegaCli -LDGetProp -Cache -LALL -a0
or
#/opt/MegaCli -LDGetProp -Cache -LALL -aALL
or
#/opt/MegaCli -LDGetProp -DskCache -LALL -aALL

4.设置磁盘缓存策略
缓存策略解释:
WT (Write through
WB (Write back)
NORA (No read ahead)
RA (Read ahead)
ADRA (Adaptive read ahead)
Cached
Direct
例子:
#/opt/MegaCli -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
or
#/opt/MegaCli -LDSetProp -Cached|-Direct -L0 -a0
or
enable / disable disk cache
#/opt/MegaCli -LDSetProp -EnDskCache|-DisDskCache -L0 -a0

/opt/MegaRAID/MegaCli/MegaCli64 -DiscardPreservedCache -Lall -a0 -NoLOG 【清空缓存】

5. 创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5
#/opt/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0
6. 创建阵列,不指定热备
#/opt/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0
7. 删除阵列
#/opt/MegaCli -CfgLdDel -L1 -a0
8. 在线添加磁盘
#/opt/MegaCli -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0
9. 阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。
#/opt/MegaCli -LDInit -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
#/opt/MegaCli -LDInit -ProgDsply -LALL -aALL
10. 查看阵列后台初始化进度
#/opt/MegaCli -LDBI -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
#/opt/MegaCli -LDBI -ProgDsply -LALL -aALL
11. 指定第 5 块盘作为全局热备
#/opt/MegaCli -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
12. 指定为某个阵列的专用热备
#/opt/MegaCli -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
13. 删除全局热备
#/opt/MegaCli -PDHSP -Rmv -PhysDrv[1:5] -a0
14. 将某块物理盘下线/上线
#/opt/MegaCli -PDOffline -PhysDrv [1:4] -a0

15. 查看物理磁盘重建进度
#/opt/MegaCli -PDRbld -ShowProg -PhysDrv [1:5] -a0
或者以动态可视化文字界面显示
#/opt/MegaCli -PDRbld -ProgDsply -PhysDrv [1:5] -a0

原文链接: http://blog.suchasplus.com/2016/04/megacli-shortcut.html

0     0

评价列表(0)