This is an old revision of the document!
Table of Contents
MegaRAID MegaCli
MegaCli is a command line tool provided by MegaRAID to configure/monitor their hardware RAID controllers. Currently all hard drives on Oak are controlled by a MegaRAID SAS 8708EM2 w/ 256Mb RAM.
Installation
MegaCli is available as a RPM for RedHat Linux. For installation on Ubuntu
masker is working on this part
Usage
A quick reference sheet can be found at http://tools.rapidsoft.de/perc/perc-cheat-sheet.html
Some commonly used commands:
Get Info
To see all adapter info:
sudo /opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL
To see RAID configuration info of adapter 0:
sudo /opt/MegaRAID/MegaCli/MegaCli64 -CfgDsply -a0
To see enclosure info of adapter 0:
sudo /opt/MegaRAID/MegaCli/MegaCli64 -EncInfo -a0
To see virtual drives info of adapter 0:
sudo /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -a0
To see a list of physical drives of adapter 0:
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDList -a0
To Replace a Hard Drive
The example here assumes that the one of the physical hard drive (Enclosure 252, Slot 6, Adapter 0; marked as Physical Disk 2 in Span Reference 0x00) has failed and needs to be replaced.
1. Set the drive offline if it is still online
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDOffline -PhysDrv [252:6] -a0
2. Mark the drive as missing
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDMarkMissing -PhysDrv [252:6] -a0
3. Prepare drive for removal
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDPrpRmv -PhysDrv [252:6] -a0
4. Replace the failed hard drive
5. Add the physical drive back to the virtual drive
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PdReplaceMissing -PhysDrv [252:6] -Array0 -row2 -a0
6. Start the rebuid
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -Start -PhysDrv [252:6] -a0
7. To check the rebuild progress
sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -PhysDrv [252:6] -a0