User Tools

Site Tools


support:general:megacli

Quick and dirty way to get MegaCLI running on ubuntu

This works from an Ubuntu LIVECD booted from a thumb drive. Very handy for fixing a new machine that was shipped from a vendor with Hardware RAID.

# mkdir megacli
# cd megacli
# wget http://.../X.XX.XX_MegaCLI.zip
# apt-get install unzip alien
# unzip 8.02.16_MegaCLI.zip 
# unzip LINUX/MegaCliLin.zip
# alien --to-tgz ./Lib_Utils-1.00-09.noarch.rpm
# alien --to-tgz ./MegaCli-8.02.16-1.i386.rpm
# tar xvzf Lib_Utils-1.00.tgz
# tar xvzf MegaCli-8.02.16.tgz
# export LD_LIBRARY_PATH=./opt/lsi/3rdpartylibs/x86_64/
# ./opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0

Turning off caching for all drives

# ./opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp Direct -Lall -aALL
Set Cache Policy to Direct on Adapter 0, VD 0 (target id: 0) success
Set Cache Policy to Direct on Adapter 0, VD 1 (target id: 1) success
Set Cache Policy to Direct on Adapter 0, VD 2 (target id: 2) success
Set Cache Policy to Direct on Adapter 0, VD 3 (target id: 3) success
Set Cache Policy to Direct on Adapter 0, VD 4 (target id: 4) success
Set Cache Policy to Direct on Adapter 0, VD 5 (target id: 5) success
Set Cache Policy to Direct on Adapter 0, VD 6 (target id: 6) success
Set Cache Policy to Direct on Adapter 0, VD 7 (target id: 7) success

UGLY HACK to export all MegaRAID drives for Linux Software RAID

This is necessary on most LSI controllers except for the 9240 if you want to use Linux Software RAID.

You can check for that functionality at MegaRAID functionality table

./opt/MegaRAID/MegaCli/MegaCli64 -CfgEachDskRaid0 WB adra cached -a0

Export all MegaRAID drives for Linux Software RAID

First note the relevant enclosure and slot numbers. Currently only available on the 9240 (and strangely not on the 9260).

./opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall  

Then for all drives you want to export as JBOD to use directly or with Linux Software RAID

./opt/MegaRAID/MegaCli/MegaCli64 -AdpSetProp -EnableJBOD 1 -aALL 
./opt/MegaRAID/MegaCli/MegaCli64 -PDMakeJBOD -PhysDrv[12:0,12:1,12:2,...] -A0 # list [enclosure:slot number]
support/general/megacli.txt · Last modified: 2011/10/14 12:34 by bill