megaraid on debian

A while back I was presented with a Dell server of uncertain providence and asked to make it go. Everything went okay until I was looking for RAID management tools. The PERC 5/i RAID controller wants to be used with megaraid; the original company involved with the RAID card in the system had changed hands a couple times, so with a half hour of research that consisted of a quick google search, scouring a few resulting websites, and letting out a small amount of profanity owed to poorly designed downloads pages I turned up an URL.

You can get megaraid from http://docs.avagotech.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip ; then use apt-get to install the alien package to convert the .rpm to .deb like so: alien MegaCli-8.07.14-1.noarch.rpm

Then I took a quick look at the resulting .deb (mostly out of curiosity, I’d never had a reason to use alien until now)…

# dpkg-deb -c megacli_8.07.14-2_all.deb
drwxr-xr-x root/root 0 2015-09-18 03:03 ./
drwxr-xr-x root/root 0 2015-09-18 03:03 ./usr/
drwxr-xr-x root/root 0 2015-09-18 03:03 ./usr/share/
drwxr-xr-x root/root 0 2015-09-18 03:03 ./usr/share/doc/
drwxr-xr-x root/root 0 2015-09-18 03:03 ./usr/share/doc/megacli/
-rw-r--r-- root/root 772 2015-09-18 03:03 ./usr/share/doc/megacli/copyright
-rw-r--r-- root/root 163 2015-09-18 03:03 ./usr/share/doc/megacli/changelog.Debian.gz
drwxr-xr-x root/root 0 2015-09-18 03:03 ./opt/
drwxr-xr-x root/root 0 2015-09-18 03:03 ./opt/MegaRAID/
drwxr-xr-x root/root 0 2015-09-18 03:03 ./opt/MegaRAID/MegaCli/
-rwxr-xr-x root/root 2469692 2013-12-16 05:43 ./opt/MegaRAID/MegaCli/MegaCli
-rwxr-xr-x root/root 2720320 2013-12-16 05:43 ./opt/MegaRAID/MegaCli/MegaCli64
-rwx------ root/root 540512 2013-12-16 05:43 ./opt/MegaRAID/MegaCli/libstorelibir-2.so.14.07-0

… before installing it with dpkg -i.

I then checked to make sure that it was actually there and that any shared libs it might want were present:


# file MegaCli64
MegaCli64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped
# ldd MegaCli64
linux-vdso.so.1 => (0x00007fffdebfe000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f49684a6000)
libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f4968283000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f496807e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4967d7a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4967a74000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f496785d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4967498000)
/lib64/ld-linux-x86-64.so.2 (0x00007f49686cd000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f496726f000)

The last step is to make a quick addition to /root/.profile:

if [ -d "/opt/MegaRAID/MegaCli" ] ; then
PATH="/opt/MegaRAID/MegaCli:$PATH"
fi

One quick source ~/.profile to get it into the running session and everything is ready to rumble!