How to install MegaCli command on physical Ubuntu and Debian Linux servers

Written by - 0 comments

Published on - Listed in Hardware Linux


To manage MegaRaid hardware RAID (storage) controllers from LSI (now acquired by Broadcom), the MegaCli command can be used (in most cases). This also applies to PERC (DELL's Power Edge RAID Controller), at least until ~2022 when PERC v8 was released (use PercCli for these).

There are two ways to install the megacli command on a physical Ubuntu or Debian server: Manually and through the HWraid repositories.

Manual MegaCli installation

MegaCli itself can be downloaded from the Broadcom website and installed on your physical Ubuntu server. The ZIP file (8-07-14_MegaCli.zip) contains a Linux directory in which resides a RPM package:

MegaCli RPM

Hold on! RPM on Ubuntu/Debian? Are you kidding me?! 

Well, unfortunately Broadcom itself only offers a RPM for the MegaCli installation on Linux. However Broadcom mentions in their documentation to use the alien command to "translate" the RPM package into a DEB package.

ck@mint /tmp $ unzip 8-07-14_MegaCLI.zip
Archive:  8-07-14_MegaCLI.zip
  inflating: 8.07.14_MegaCLI.txt     
  inflating: DOS/MegaCLI.exe         
 extracting: FreeBSD/MegaCLI.zip     
 extracting: FreeBSD/MegaCli64.zip   
  inflating: Linux/MegaCli-8.07.14-1.noarch.rpm  
  inflating: Solaris/MegaCli.pkg     
  inflating: Windows/MegaCli.exe     
  inflating: Windows/MegaCli64.exe 

Now we can use alien to create a deb package (install the alien command using sudo apt install alien):

ck@mint /tmp $ cd Linux/
ck@mint /tmp/Linux $ sudo alien -k --scripts MegaCli-8.07.14-1.noarch.rpm
megacli_8.07.14-1_all.deb generated

And the resulting deb package can be installed with dpkg:

ck@mint /tmp/Linux $ sudo dpkg -i megacli_8.07.14-1_all.deb
Selecting previously unselected package megacli.
(Reading database ... 544504 files and directories currently installed.)
Preparing to unpack megacli_8.07.14-1_all.deb ...
Unpacking megacli (8.07.14-1) ...
Setting up megacli (8.07.14-1) ...

The megacli command can now be found under /opt/MegaRAID/MegaCli/MegaCli64:

ck@mint ~ $ /opt/MegaRAID/MegaCli/MegaCli64 -h

      MegaCLI SAS RAID Management Tool  Ver 8.07.14 Dec 16, 2013

    (c)Copyright 2013, LSI Corporation, All Rights Reserved.

[...]

But there's a much easier method to install MegaCli: Using an existing APT repository built for this purpose (see below)!

MegaCli installation through HWraid repository

The HWraid repository contains all kinds of programs and commands for physical servers (and also a very helpful Wiki).

HWraid repositories from le-vert

megacli is just one of these packages, many more commands for other storage controllers are also packaged and available to install with apt.

Even better, the repository still supports meanwhile EOL versions, such as Ubuntu 16.04 (Xenial) or Debian 9 (Stretch).

Ubuntu Linux

For Ubuntu machines, add the APT key and add the repository:

ck@ubuntu ~ $ DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}')
wget -O - https://hwraid.le-vert.net/ubuntu/hwraid.le-vert.net.gpg.key | sudo apt-key add -
echo "deb http://hwraid.le-vert.net/ubuntu $DIST main " | sudo tee /etc/apt/sources.list.d/hwraid.list

Then update APT and install the megacli package:

ck@ubuntu ~ $ apt-get update
ck@ubuntu ~ $ apt-get install megacli

Debian Linux

The exact same steps are needed for a Debian Linux, however the URL path points to /debian instead of /ubuntu:

ck@debian ~ $ DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}')
wget -O - https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -
echo "deb http://hwraid.le-vert.net/debian $DIST main " | sudo tee /etc/apt/sources.list.d/hwraid.list

Then update APT and install the megacli package:

ck@debian ~ $ apt-get update
ck@debian ~ $ apt-get install megacli

The megacli command can now be executed:

root@ubuntu:~# megacli -h

      MegaCLI SAS RAID Management Tool  Ver 8.07.14 Dec 16, 2013

    (c)Copyright 2013, LSI Corporation, All Rights Reserved.

[...]



Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder