Skip to content

Instantly share code, notes, and snippets.

@fxkraus
Last active April 30, 2024 04:09
Show Gist options
  • Star 75 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save fxkraus/595ab82e07cd6f8e057d31bc0bc5e779 to your computer and use it in GitHub Desktop.
Save fxkraus/595ab82e07cd6f8e057d31bc0bc5e779 to your computer and use it in GitHub Desktop.
Install LSI MegaCli .deb package on Debian/Ubuntu

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip

create debian package

cd Linux
sudo alien MegaCli-8.07.14-1.noarch.rpm

install debian package

sudo dpkg -imegacli_8.07.14-2_all.deb

run MegaCli

/opt/MegaRAID/MegaCli/MegaCli64 -h
@AysadKozanoglu
Copy link

Repo Source for megaRaid and other different Raid Controller
see: https://hwraid.le-vert.net/wiki/DebianPackages

for debian distributions

DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}')  # jessie wheezy or stratch  whatelse
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 " > /etc/apt/sources.list.d/raidtoolRepo.list
apt-get update
apt-get install megactl megacli megamgr

@linushstge
Copy link

Thanks @AysadKozanoglu :)

@ZekunYin
Copy link

thx

@krtschmr
Copy link

no megacli for debian on 64 bit system?

MegaCli: error while loading shared libraries: libncurses.so.5: cannot open shared object file
Then you're probably on a 64-bit (or mixed) system and want to use MegaCli64 instead (or install lib32ncurses5(verify))

can't find MegaCli64 . smh

@M4GNV5
Copy link

M4GNV5 commented Nov 10, 2019

@krtschmr you have to run apt install libncurses5

@thanratty
Copy link

Worked perfectly. Many thanks.

@TW1920
Copy link

TW1920 commented Feb 17, 2020

Works well on Proxmox (based on Debian):

  1. Install necessary tools
    apt-get install unzip
    apt-get install alien
  2. Install necessary lib
    apt install libncurses5
  3. Download
    wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip
  4. Unzip
    unzip 8-07-14_MegaCLI.zip
  5. Create debian package
    cd Linux
    sudo alien MegaCli-8.07.14-1.noarch.rpm
  6. Install debian package
    sudo dpkg -i megacli_8.07.14-2_all.deb
  7. run MegaCli
    /opt/MegaRAID/MegaCli/MegaCli64 -h

@kaizimmer1
Copy link

kaizimmer1 commented Jan 22, 2021

Works well on Proxmox (based on Debian):

Not for me...

pve-manager/6.3-2/22f57405 (running kernel: 5.4.73-1-pve) (Debian 10.6/Buster)

lspci | grep LSI

3b:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068E PCI-Express Fusion-MPT SAS (rev 08)

/opt/MegaRAID/MegaCli/MegaCli64 -adpCount

Controller Count: 0.

Exit Code: 0x00

/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll

Exit Code: 0x00

Any hints?

@thanratty
Copy link

thanratty commented Jan 22, 2021

All I can tell you is it works for me. Here's my various config options and some sample MegaCli output.
When I first got this server I spent a good while making sure all it's various firmwares were as recent as possible, including the RAID cards.
I've two controllers installed currently and they both work fine.

Note that the 'Error Code' for some MegaCli commands returns the parameter queried as opposed to an actuall error code. (eg AdpCount)

I do have modules loaded to allow passthrough of the cards into a VM, but I'm NOT actually doing that at the moment so Proxmox can use them. Not sure if that would make a difference though.

Loaded in /etc/modules

vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

Additional GRUB kernel parameter in /etc/default/grub

intel_iommu=on

My OS, Firmware & Driver versions...

# pveversion
pve-manager/6.3-3/eee5f901 (running kernel: 5.4.78-2-pve)


# megacli -h

      MegaCLI SAS RAID Management Tool  Ver 8.07.14 Dec 16, 2013


# lspci -k -s 0e:00
0e:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)
        Subsystem: IBM ServeRAID M5025 SAS/SATA Controller
        Kernel driver in use: megaraid_sas
        Kernel modules: megaraid_sas


# lspci -k -s 09:00
09:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 03)
        Subsystem: IBM ServeRAID M5015 SAS/SATA Controller
        Kernel driver in use: megaraid_sas
        Kernel modules: megaraid_sas


# modinfo megaraid_sas | head -n 4
filename:       /lib/modules/5.4.78-2-pve/kernel/drivers/scsi/megaraid/megaraid_sas.ko
description:    Broadcom MegaRAID SAS Driver
author:         megaraidlinux.pdl@broadcom.com
version:        07.713.01.00-rc1



#  megacli -adpallinfo -aall | grep -i ver
Product Name       : ServeRAID M5015 SAS/SATA Controller
                Image Versions in Flash:
FW Version         : 2.130.403-6221
BIOS Version       : 3.30.02.2_4.16.08.00_0x06060A05
Preboot CLI Version: 04.04-020:#%00009
WebBIOS Version    : 6.0-54-e_50-Rel
NVDATA Version     : 2.09.03-0058
Boot Block Version : 2.02.00.00-0000
BOOT Version       : 09.250.01.219

Product Name       : ServeRAID M5025 SAS/SATA Controller
                Image Versions in Flash:
FW Version         : 2.130.403-6221
BIOS Version       : 3.30.02.2_4.16.08.00_0x06060A05
Preboot CLI Version: 04.04-020:#%00009
WebBIOS Version    : 6.0-54-e_50-Rel
NVDATA Version     : 2.09.03-0058
Boot Block Version : 2.02.00.00-0000
BOOT Version       : 09.250.01.219

A few sample MegaCli commands:

# megacli -adpcount
Controller Count: 2.

Exit Code: 0x02


# megacli -pdgetnum -aall
 Number of Physical Drives on Adapter 0: 8
 Number of Physical Drives on Adapter 1: 48

Exit Code: 0x30


# megacli -ldpdinfo -aall | grep VD_
Name                :VD_New_1
Name                :VD_Old_1
Name                :VD_Old_2
Name                :VD_New_2

I hope there's something here that might give you an idea.
Good luck!

@REMINJOSE
Copy link

DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}') # jessie wheezy or stratch whatelse
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 " > /etc/apt/sources.list.d/raidtoolRepo.list
apt-get update
apt-get install megactl megacli megamgr

Thanks

@jiangsanyin
Copy link

Repo Source for megaRaid and other different Raid Controller
see: https://hwraid.le-vert.net/wiki/DebianPackages

for debian distributions

DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}')  # jessie wheezy or stratch  whatelse
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 " > /etc/apt/sources.list.d/raidtoolRepo.list
apt-get update
apt-get install megactl megacli megamgr

it works on x86_64 ubuntu,but not arm64 ubuntu.any idea?

@AysadKozanoglu
Copy link

AysadKozanoglu commented Aug 30, 2021

Repo Source for megaRaid and other different Raid Controller
see: https://hwraid.le-vert.net/wiki/DebianPackages
for debian distributions

DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}')  # jessie wheezy or stratch  whatelse
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 " > /etc/apt/sources.list.d/raidtoolRepo.list
apt-get update
apt-get install megactl megacli megamgr

it works on x86_64 ubuntu,but not arm64 ubuntu.any idea?

The repo is only for x86_amd64 binary packages.

For arm64 you have to compile from source Code by yourself for megacli or storecli. You can get the source code from github and compile the source code on your arm64 environment.

Maybe you can find preCompiled binaries for arm64 from other users

@jiangsanyin
Copy link

Repo Source for megaRaid and other different Raid Controller
see: https://hwraid.le-vert.net/wiki/DebianPackages
for debian distributions

DIST=$(lsb_release -c | grep "Codename:" | awk '{print $2}')  # jessie wheezy or stratch  whatelse
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 " > /etc/apt/sources.list.d/raidtoolRepo.list
apt-get update
apt-get install megactl megacli megamgr

it works on x86_64 ubuntu,but not arm64 ubuntu.any idea?

The repo is only for x86_amd64 binary packages.

For arm64 you have to compile from source Code by yourself for megacli or storecli. You can get the source code from github and compile the source code on your arm64 environment.

Maybe you can find preCompiled binaries for arm64 from other users

Thanks to your reply.
Yes,i noticed this point( get the source code from github and compile the source code on my arm64 environment) when post my question yestoday,but i don't find the source code in github.Do you know where it is?

@andyjbm
Copy link

andyjbm commented Jan 30, 2022

Hi @kaizimmer1,

Appreciate this is a year on and you've probably way done with this now but I came up against the same thing.

So for others like me that might stumble upon this thread...

Your card is not a megaraid card so megacli won't see it:
3b:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068E PCI-Express Fusion-MPT SAS (rev 08)

It's a Fusion-MPT SAS. You need lsiutils which works for me.
Or sas2ircu which is of limited use tbh.

Regards,

Andy.

@matveynator
Copy link

new megaraid:

curl -L "https://github.com/matveynator/sysadminscripts/raw/main/debian/megacli_8.07.14-2_all.deb" > /tmp/megacli_8.07.14-2_all.deb; dpkg -i /tmp/megacli_8.07.14-2_all.deb;

new arcconf:

curl -L "https://github.com/matveynator/sysadminscripts/raw/main/debian/arcconf_3.07-23972_amd64.deb" > /tmp/arcconf_3.07-23972_amd64.deb; dpkg -i /tmp/arcconf_3.07-23972_amd64.deb;

@iammeken
Copy link

wget -O - https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | sudo apt-key add -

wget -O - https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key |gpg --dearmor -o /etc/apt/trusted.gpg/hwraid.le-vert.net.gpg

For Ubuntu 22.04 x64:
curl -fsSL https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/hwraid.le-vert.net.gpg

@Napsty
Copy link

Napsty commented Jan 9, 2024

For Ubuntu (as of writing this, for precise, trusty, xenial, focal, bionic):

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 - # Old APT Key method
curl -fsSL https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/hwraid.le-vert.net.gpg # New APT Key method
echo "deb http://hwraid.le-vert.net/ubuntu $DIST main " > /etc/apt/sources.list.d/hwraid.list
apt-get update
apt-get install megacli

@0n1cOn3
Copy link

0n1cOn3 commented Feb 7, 2024

@fxkraus

Theres a small typo :-)

sudo dpkg -imegacli_8.07.14-2_all.deb

instead it should be

sudo dpkg -i megacli_8.07.14-2_all.deb

@jesussuarz
Copy link

jesussuarz commented Apr 30, 2024

I made the following guide for greater reference and ease.

https://gist.github.com/jesussuarz/78a00eaa5925a444fb12b31646e773e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment