megacli在线磁盘raid

测试机:idrac:10.10.10.199 calvin@Dell 测试机:10.10.10.208

查看下物理磁盘信息(可以查看到物理磁盘及raid适配器的信息,及磁盘容量大小)
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL

查看重要数据
Adapter #0
Enclosure Device ID: 32
Slot Number: 0
PD Type: SAS
查看适配器信息
/opt/MegaRAID/MegaCli/MegaCli64  -AdpAllInfo -aAll
查看Raid初始化情况
/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL
扫描外来盘的个数
/opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0
清除外来盘配置
/opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0
查看JBOD是否启用
/opt/MegaRAID/MegaCli/MegaCli64 -AdpGetProp -enablejbod -aALL
Adapter 0: JBOD: Enabled
禁用JBOD模式
/opt/MegaRAID/MegaCli/MegaCli64 -AdpSetProp -EnableJBOD -0 -a0 
Adapter 0: Set JBOD to Disable success.
val - 0=Disable JBOD mode.
1= Enable JBOD mode
创建Raid
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r1 [32:2,32:3] WB Direct -a0
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [32:2,32:3,32:4] WB Direct -a0

-r1 raid1

[32:2] 磁盘ID
Enclosure Device ID: 32
Slot Number: 2

[32:3] 磁盘ID
Enclosure Device ID: 32
Slot Number: 3
WB :磁盘缓存策略 write back
-a0 :阵列卡序号

-a0:即adpter0,RAID卡0,如果有更多RAID卡,请确认当前要操作的适配器,可用下面命令查看
/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll
查看阵列后台初始化进度
/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL
快速初始化和完全初始化
# 快速初始化
/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -start –L0 -a0

# 完全初始化
/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -start -full –L0 -a0

# 显示初始化的进度
/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -progdsply -L0 -a0

# 结束完全初始化
/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -abort -L0 -a0
0%