Written by
arstercz
-
MegaCli常用参数介绍
常用命令参数:
MegaCli -adpCount [显示适配器个数]
MegaCli -AdpGetTime –aALL [显示适配器时间]
MegaCli -AdpAllInfo -aAll [显示所有适配器信息]
MegaCli -LDInfo -LALL -aAll [显示所有逻辑磁盘组信息,RAID Level]
MegaCli -PDList -aAll [显示所有的物理信息]
MegaCli -cfgdsply -aALL [显示Raid卡型号,Raid设置,Disk相关信息]
MegaCli -LDBI -ProgDsply -LALL -aALL [raid building进度]
MegaCli64 -LDInit -ShowProg -LALL -aALL [查看初始化同步块的过程的进度]
MegaCli -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ [查看充电状态]
MegaCli -AdpBbuCmd -GetBbuStatus -aALL[显示BBU状态信息]
MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aALL[显示BBU容量信息]
MegaCli -AdpBbuCmd -GetBbuDesignInfo -aALL [显示BBU设计参数]
MegaCli -AdpBbuCmd -GetBbuProperties -aALL [显示当前BBU属性]
MegaCli -ShowSummary -aALL [显示所有 adaptor 的逻辑盘信息]
MegaCli -LDGetProp -Cache -LAll -aAll [显示 RAID 卡的缓存策略]
MegaCli -LDSetProp WT -L0 -a0 [修改 adaptor 0 中第 1 块逻辑盘的缓存策略为 writethrough]
MegaCli -pdrbld -showprog -physdrv[E:S] -aALL [查询磁盘 rebuild 进度, E 为磁盘的 Enclosure Device ID, S 为 slot 编号]
MegaCli -PDOffline -PhysDrv [E:S] -a0 [手动 offline 一块磁盘, E 为磁盘的 Enclosure Device ID, S 为 slot 编号, -a0 表示 adaptor 0]
MegaCli -PDHSP -set -PhysDrv [E:S] -a0 [手动将一块磁盘设置为 Hotspare 状态]
MegaCli -AdpAllinfo -aALL | grep -i rebuild [查看 RAID 卡 Rebuild 参数]
磁带状态的变化,从拔盘,到插盘的过程中。
Device |Normal|Damage|Rebuild|Normal
Virtual Drive |Optimal|Degraded|Degraded|Optimal
Physical Drive |Online|Failed –> Unconfigured|Rebuild|Online
处于 ‘Unconfigured(good)’ 状态的盘, 需要手动设置为 Hotspare
状态才能起到热备的作用.
增加磁盘创建新的虚拟设备
如果不想对现有的根盘(比如 RAID 1) 做改动, 可以增加一些磁盘单独做一个数据盘(比如 RAID5), 这种方式简单方便, 也不需要重启机器. 如下步骤所示:
查看插入的磁盘状态
如下所示, 假如我们新插入 3 块 600G
的磁盘:
# MegaCli -PDList -aALL | egrep 'Adapter|Enclosure|Slot'
Adapter #0
.....
Slot Number: 3
Enclosure position: 1
Enclosure Device ID: 32
Slot Number: 4
Enclosure position: 1
Enclosure Device ID: 32
Slot Number: 5
Enclosure position: 1
Enclosure Device ID: 32
创建新的 RAID 5 虚拟设备
有些时候, 磁盘可能是从其它机器拿过来的, 这种情况下需要清理下 Foreign
状态, 如下所示:
# MegaCli64 -CfgForeign -Scan -aALL
There are 1 foreign configuration(s) on controller 0.
Exit Code: 0x00
# MegaCli64 -CfgForeign -Clear -a0
Foreign configuration 0 is cleared on controller 0.
Exit Code: 0x00
将 adaptor 0
适配器中的三块磁盘 (slot 3, slot 4, slot 5
) 做成 RAID 5:
# MegaCli64 -CfgLdAdd r5[32:3,32:4,32:5] -a0
Adapter 0: Created VD 1
Adapter 0: Configured the Adapter!!
Exit Code: 0x00
再来查看设备信息, 如下:
# MegaCli64 -ShowSummary -a0
Storage
Virtual Drives
Virtual drive : Target Id 0 ,VD name zonheng
Size : 278.875 GB
State : Optimal
RAID Level : 1
Virtual drive : Target Id 1 ,VD name
Size : 1.089 TB
State : Optimal
RAID Level : 5
通过 fdisk -l
即可看到新的设备信息, 格式话设备后, 即可挂载使用:
# mkfs.xfs -f /dev/sdb
# mount -t xfs /dev/sdb /data