MegaCli操作1---創建與刪除raid0

今天給服務器DELLR710加硬盤,準備在線做raid,以前不太注意這些事,搞起來花了一些時間,不過還好是搞定了,趕緊記錄下來,免的日後忘記了。


用MegaCli做陣列,最重要是就是這三個係數:
Adapter #0
Enclosure Device ID: 32
Slot Number: 0

分別代表了 -PhysDrv[E0:S0,E1:S1,...] -aN #物理磁盤的enclosure號:slot號  -a是陣列卡號

這些參數可以通過下面的命令得到。

查看所有物理硬盤狀態
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -a0

# /opt/MegaRAID/MegaCli/MegaCli64 help |grep -i pdinfo
MegaCli -pdInfo -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -LdPdInfo -aN|-a0,1,2|-aALL

查看邏輯盤詳細信息
# /opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo-aALL

查看單個盤的詳細信息
# /opt/MegaRAID/MegaCli/MegaCli64 -pdInfo -PhysDrv[32:3] -aALL
Adapter 0: Device at Enclosure - 32, Slot - 3 is notfound.


像我新增加的硬盤就是 [32:2]
MegaCli操作1---創建與刪除raid0

MegaCli操作1---創建與刪除raid0

MegaCli操作1---創建與刪除raid0

這裏我的硬盤被標記爲“Foreign”外來配置,要清除一下,不然會報下面這個錯誤:
The specified physical disk does not have the appropriateattributes to complete
the requested command.

Exit Code: 0x26

掃描外來配置的個數:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0
There are 1 foreign configuration(s) on controller 0.

Exit Code: 0x00
清除外來配置:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0
Foreign configuration 0 is cleared on controller 0.

Exit Code: 0x00

再次掃描外來配置的個數:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan-a0
There is no foreign configuration on controller 0.

Exit Code: 0x00

創建Raid0
# /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[32:2] WBDirect -a0
Adapter 0: Created VD 2

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

MegaCli操作1---創建與刪除raid0

MegaCli操作1---創建與刪除raid0

MegaCli操作1---創建與刪除raid0


刪除陣列:

# /opt/MegaRAID/MegaCli/MegaCli6  -cfgclr -a0   清除所有的raid組的配置

# /opt/MegaRAID/MegaCli/MegaCli6  -cfglddel -L0 -a0  刪除指定的raid組(Target Id:0)的raid組,可以通過上面的“查看邏輯盤詳細信息”得到。


查看硬盤的重建情況:
# /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv[12:7] -aALL
Device(Encl-12 Slot-7) is not in rebuild process

參考資料:
http://blog.csdn.net/heart_2011/article/details/7254404
http://zh.community.dell.com/techcenter/b/weblog/archive/2013/03/07/megacli-command-share.aspx


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章