Full Version: Installing LSI megaCLI in Ubuntu 12.04 Precise
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In order to setup the LSI megaraid megacli command line utility for managing hardware raid arrays under
Ubuntu requires a few steps

First you will need to modify your sources.list to include another repo whereby the tools can be downloaded
using apt-get

Modify /etc/apt/sources.list

and then add

"deb precise main"

then do

apt-get update

apt-get install megacli megactl megaraid-status

If you get a GPG error, you will need to grab the keys

wget -O - | sudo apt-key add -

Then try again

apt-get install megacli megactl megaraid-status

Some basic megacli commands:

View information about virtual drive
megacli -LDInfo -Lall -aALL

View information about physical disks
megacli -PDList -aALL

Dump all event logs to a file
megacli -AdpEventLog -GetEvents -f logfile -aALL

Using smartmontools behind the raid controller:

You can test individual drives behind the raid controller with a bit of trickery. Smartmontools is great for diagnosing individual hard disk drives if you are concerned about the health of your raid array.

First you need to get a list of the device ids for each of the individual

[email protected]:~# megacli -pdlist -a0| grep 'Device Id'
Device Id: 9
Device Id: 10
Device Id: 11
Device Id: 8

In my example, I have a raid array with 4 disks, listed here as devices
8 through to 11, and the mounted device is /dev/sdc

We can manipulate the smartmontools commands in order to test these individual devices.

smartctl -d sat+megaraid,8 -t short /dev/sdc

this will perform a 'short test' on /dev/sdc's raid device drive no. 8

in order to view the status of the short test you can use

smartctl -d sat+megaraid,8 -l selftest /dev/sdc

this procedure can then be done for each other individual device id behind the raid array.
Reference URL's