MegaCli命令建立raid10操作细节记录

1.对于命令操作情况不熟悉的情况下,最好使用没有数据的机器操作。
2.需要系统里面安装MegaCli
3. MegaCli可以在http://dl.kvm.la/lsi 里面下载
4. 如果可以的话建议把/opt/MegaRAID/MegaCli/MegaCli64复制到/usr/bin下
5.用U盘安装个系统再装MegaCli比较方便,如果有条件封装系统和PXE的话更直接。

先查硬盘的Enclosure Device ID和Slot Number位置找出来

/opt/MegaRAID/MegaCli/MegaCli64  -PDList -aAll | egrep "Enclosure Device ID:|Slot Number:|Inquiry Data:|Error Count:|state"

-a后面的参数类似0 1 2 3则代表阵列卡的排序,如机器上只有一张阵列卡序号就是0,如有多个阵列卡时候用ALL则全部同步操作。

查看磁盘rebuild进度

/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv [252:0] -a0

返回两种结果类似如下:

-P Physical
D Disk
Rbld  Rebuild
-Prog Progress
Dsply Display
-PhysDrv  Physical Diskdirve
[252:4] Enclosure Device ID:Disk Slot
-a0 visual disk array0

====================我是分割线====================

Device(Encl-252 Slot-0) is not in rebuild process

创建RAID10阵列实例

/opt/MegaRAID/MegaCli/MegaCli64 -CfgSpanAdd -r10 -Array0[252:0,252:1] -Array1[252:2,252:3] WB Direct -a0

命令解释:

CfgSpanAdd:创建RAID命令

-r10 :RAID10,如果创建RAID5,则为-r5

-Array0[252:0,252:1] : RAID10相当于RAID1+RAID0,本例中为磁盘编号为4的物理磁盘和编号为5的物理磁盘组成一个RAID1,磁盘编号为6的物理磁盘和编号为7的物理磁盘组成一个RAID1,然后两个RAID1组成一个RAID0。(其中252是Enclosure Device ID的值)
-Array1[252:2,252:3]同上解释
如有更多盘做阵列则类推-Array2和-Array3排序下去。

  查看RAID初始化情况:

/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL

返回结果如下:

Background Initialization on VD #0 is not in Progress.
Background Initialization on VD #1 (target id #1) Complete 9% in 18 Minutes.

(以下部分是危险操作,最好在没数据的机器上操作弄清楚)

删除RAID所有配置

/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -Lall -aAll
/opt/MegaRAID/MegaCli/MegaCli64 -CfgClr -aAll

删除单个盘,实例为删除Slot Number为1的盘。

/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -a0

添加新评论 »