MegaCLI is a management tool provided by LSI to configure and monitor you RAID-Controller. LSI provides a RPM for Linux including a 64 bit version.
Now lets start to install MegaCli:
Download and extract the latest MegaCLI:
#wget http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.02.21_Linux_MegaCLI.zip
#unzip 8.02.21_Linux_MegaCLI.zip
With alien you can transform RPMs to DEBs and vica verse:
# sudo alien 8.02.21_Linux_MegaCLI/MegaCli-8.02.21-1.noarch.rpm
# sudo alien 8.02.21_Linux_MegaCLI/Lib_Utils-1.00-09.noarch.rpm
Insall required packages for MegaCLI:
# sudo apt-get install lib32gcc1 lib32ncurses5 libc6-i386 lib32stdc++6 lib32tinfo5
After that install converted DEBs:
# sudo dpkg -i lib-utils_1.00-10_all.deb megacli_8.02.21-2_all.deb
Ubuntu 12.04 is running a 3.2 Kernel, but megacli just knows 2.6.x Kernels, so best way to run megacli is to use setarch
Now we can query our LSI RAID-Controller:
# sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -adpCount
Controller Count: 1.
Exit Code: 0x01
To use MegaCLI in a smooth way, we create the following bash script – a good place is /usr/bin/:
#!/bin/bash
sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 $@
On my machine I created /usr/bin/megacli and now I can run megacli via
# megacli -adpCount