MegaCli命令使用整理


1. 軟件安裝
rpm -ivh Lib_Utils-1.00-09.noarch.rpm
rpm -ivh MegaCli-8.02.21-1.noarch.rpm
2. 常用命令
/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL  	//查看raid卡詳細信息
/opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aALL  		//查看raid和組成raid的磁盤
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL 	//查看raid
### //查看磁盤信息,精篩選
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL|grep -Ei "(Enclosure Device|Slot Number|PD Type|Raw Size|Inquiry Data|Firmware state|ForeignState)"   
  • Adapter#0 -----raid卡控制器編號
  • Enclosure Device ID: 64 -----外殼設備ID,也就是raid卡的ID號
  • Slot Number: 6 ------磁盤槽位號
  • PD Type: SAS ------磁盤類型
  • Raw Size: 3.638 TB [0x1d1c0beb0 Sectors] ------大小
  • Firmware state: Online, Spun Up ------磁盤狀態
查看磁盤狀態
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall|grep -E 'Slot\ Number|Firmware\ state'
查看磁盤是否有fail報錯
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall|grep -E 'Slot\ Number|Predictive\ Failure\ Count'
查看磁盤是否有error報錯
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall|grep -E 'Slot\ Number|Error\ Count'
定位故障盤VD
/opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -a0|grep -Ei "(Target Id:|VirtualDrive:|RAID Level|^Size|Enclosure Device|Slot Number)"
定位故障盤盤符
ls -l /dev/disk/by-path
查看磁盤是否有外來配置
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall|grep -E 'Slot\ Number|Foreign\ State'
掃描RAID卡是否有外來配置
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Scan a0
清除外來配置
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Clear a0
報錯處理
Adapter 0: Configure Adapter Failed

FW error description: 
 The current operation is not allowed because the controller has data in cache for offline or missing virtual drives.  
Exit Code: 0x54
處理: (6為硬盤ID數)
/opt/MegaRAID/MegaCli/MegaCli64 -DiscardPreservedCache -L6 a0
刪除陣列
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -a0 (1 為RIAD組Target Id號)


免責聲明!

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



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