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