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


http://blog.sina.com.cn/s/blog_57c70e190101ebl9.html

今天給服務器DELL R710加硬盤,准備在線做raid,以前不太注意這些事,搞起來花了一些時間,不過還好是搞定了,趕緊記錄下來,免的日后忘記了。
 
用MegaCli做陣列,最重要是就是這三個系數:
Adapter #0
Enclosure Device ID: 32
Slot Number: 0
 
分別代表了 -PhysDrv[E0:S0,E1:S1,...] -aN       #物理磁盤的 enclosure號:slot號  -a是陣列卡號
 
這些參數可以通過下面的命令得到。
 
查看陣列卡信息
lspci -v
/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL

查看所有物理硬盤狀態
/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 not found.
 
 
像我新增加的硬盤就是 [32:2] 
MegaCli操作1---創建與刪除raid0

MegaCli操作1---創建與刪除raid0
 
MegaCli操作1---創建與刪除raid0
 
這里我的硬盤被標記為“Foreign”外來配置,要清除一下,不然會報下面這個錯誤:
The specified physical disk does not have the appropriate attributes 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] WB Direct -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
 
 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM