Question: How can I setup MegaCli on my 64-bit Ubuntu 11.04 or 12.04?

A lot of Dell servers PERC raid cards are really LSI MegaRaid controllers, thus to gain insight into your Dell raid array, the LSI MegaCLI tool is usually the tool of choice. We've tested this procedure on Ubuntu 11.04 and Ubuntu 12.04.

First you need to sudo to root and change to the /tmp directory:

# sudo -i
# cd /tmp

Then you can download and extract the latest MegaCLI. As of this writing, the latest is 8.02.21. If this link is broken, you may have to navigate the site to find the download. (path: support -> support downloads by product -> megaraid sas -> management software and tools)

# wget http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.21_MegaCLI.zip
# unzip  8.02.21_MegaCLI.zip

Note: The above is the correct wget url, but I ended up having to fall back to a local browser download followed by scp'ing the file to the server. I suspect their license acceptance page is breaking wget somehow.

Then you cd into the Linux directory:

# cd 8.02.21_Linux_MegaCLI

Then you can use alien to convert the RPM's to DEB packages. (apt-get install alien if you do not have it)

# alien *.rpm

Install some required packages:

# apt-get install lib32gcc1 lib32ncurses5 libc6-i386 lib32stdc++6 lib32tinfo5

Then install the MegaCLI packages:

# dpkg -i *.deb

Test it out...

# /opt/MegaRAID/MegaCli/MegaCli64 -adpCount

If you get Controller Count: 1 (or larger) GREAT! You're good to go. (Google MegaCli for how to use it.)

If you get Controller Count: 0, try doing a "uname -a". If your kernel is not a 2.6.x kernel, then you may need to use setarch to get it to work:

# setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -adpCount

Since you probably don't want to have to run all that every time, you can setup a wrapper script. Use your favorite editor (vi, nano, etc) to create a new file, /usr/sbin/megacli, with the following content:

setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 $@

Save the file, then chmod it to mode 0755:

# chmod 0755 /usr/sbin/megacli

Now you should be able to run it like so:

# megacli -adpCount                                     

Controller Count: 1.

Exit Code: 0x01

Excellent! Now you can do some googling to figure out how to use MegaCli. Quick start...

# megacli -AdpAllInfo -aALL


CategoryDedicatedServers

DedicatedServers/how-can-i-setup-megacli-on-my-64-bit-ubuntu-11-04-or-12-04 (last edited 2015-07-28 09:51:42 by wilhelms)