Skip to content

Instantly share code, notes, and snippets.

@metajiji
Forked from fxkraus/debian-install-megacli.md
Last active April 24, 2024 02:04
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save metajiji/cf859a7fc65a63690ecb208d11ea8407 to your computer and use it in GitHub Desktop.
Save metajiji/cf859a7fc65a63690ecb208d11ea8407 to your computer and use it in GitHub Desktop.
Install LSI MegaCli

download

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

or

curl -LO 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

install package

For Debian

cd Linux
sudo alien MegaCli-8.07.14-1.noarch.rpm  # convert from rpm to deb first
sudo dpkg -imegacli_8.07.14-2_all.deb

For CentOS

sudo yum install MegaCli-8.07.14-1.noarch.rpm

Create alternatives

For CentOS

sudo alternatives --install '/usr/bin/MegaCli64' 'MegaCli64' '/opt/MegaRAID/MegaCli/MegaCli64' 1
sudo alternatives --install '/usr/bin/MegaCli' 'MegaCli' '/opt/MegaRAID/MegaCli/MegaCli64' 1
sudo alternatives --install '/usr/bin/megacli' 'megacli' '/opt/MegaRAID/MegaCli/MegaCli64' 1

For Debian

sudo update-alternatives --install '/usr/bin/MegaCli64' 'MegaCli64' '/opt/MegaRAID/MegaCli/MegaCli64' 1
sudo update-alternatives --install '/usr/bin/MegaCli' 'MegaCli' '/opt/MegaRAID/MegaCli/MegaCli64' 1
sudo update-alternatives --install '/usr/bin/megacli' 'megacli' '/opt/MegaRAID/MegaCli/MegaCli64' 1

run MegaCli

/opt/MegaRAID/MegaCli/MegaCli64 -h
MegaCli64 -h
MegaCli -h
megacli -h
@edelwi
Copy link

edelwi commented May 20, 2021

Thanks! It was helpful.

@Barlog1
Copy link

Barlog1 commented Aug 30, 2022

Thanks!!!
And install: yum -y install ncurses-compat-libs-6.1-7.20180224.el8.x86_64

@HQJaTu
Copy link

HQJaTu commented Jan 1, 2023

Thanks!!! And install: yum -y install ncurses-compat-libs-6.1-7.20180224.el8.x86_64

Thanks for this. I was wonder how to get rid of libncurses.so.5: cannot open shared object file.

@scottn26
Copy link

If you are running a RedHat based distro that is 9 or above, ncurses 5 won't install. However, there is backward compatibility between 6.2 and 5 so you can create a symlink:

ln -s /usr/lib64/libncurses.so.6.2 /usr/lib64/libncurses.so.5

@metajiji
Copy link
Author

Also you can try to use storcli instead old megacli
https://docs.broadcom.com/docs/Unified_storcli_all_os_7.2309.0000.0000.zip

@cbugk
Copy link

cbugk commented Feb 13, 2023

To resolve /opt/MegaRAID/MegaCli/MegaCli64: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory running following install command worked on Ubuntu 20.04 sudo apt-get install libncurses5

Source: error-while-loading-shared-libraries-libncurses-so-5

@HQJaTu probably a bit late, yet future reference for others.

@HQJaTu
Copy link

HQJaTu commented Feb 13, 2023

@HQJaTu probably a bit late, yet future reference for others.

Sir, I'd rather leave a mark for googlebot to harvest than do nothing.

@eugenefvdm
Copy link

Thanks guys for the GIST. Things have changed a lot, at least on my AlmaLinux system:

  • On AlmaLinux Ncurses is version 6 not 5. Try rpm -qi ncurses
  • yum -y install ncurses-compat-libs-6.1-7.20180224.el8.x86_64 doesn't work, just says no match for argument.
  • ln -s /usr/lib64/libncurses.so.6.2 /usr/lib64/libncurses.so.5 doesn't work either. MegaCli64 still spits out ncurses 5 issue

Then I saw the comment:

Also you can try to use storcli instead old megacli

And so gave ChatGPT a spin on the statement:

image

Looks like I'm going to be wasting a lot of time getting MegaCLI working on a newer AlmaLinux system..

@DarkSky7
Copy link

No one cares about Fedora anymore? What's your recommendation for Fedora-38?

@HQJaTu
Copy link

HQJaTu commented Jun 28, 2023

Information in this discussion is adequate for Fedora 38.

# cat /etc/fedora-release 
Fedora release 38 (Thirty Eight)

# /opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -a0 | head
                                     
Adapter #0

==============================================================================
                    Versions
                ================
Product Name    : LSI MegaRAID SAS 9260-4i
Serial No       : SV21319016
FW Package Build: 12.12.0-0102

@DarkSky7
Copy link

Right, ...
$ /opt/MegaRAID/MegaCli/MegaCli64: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
AND ...
$ ls -als /usr/lib/curs
4 lrwxrwxrwx. 1 root root 19 Jan 18 16:00 /usr/lib/libncurses++.so.5 -> libncurses++.so.5.9
4 lrwxrwxrwx. 1 root root 17 Jan 18 16:00 /usr/lib/libncurses.so.5 -> libncurses.so.5.9
76 -rwxr-xr-x. 1 root root 74620 Jan 18 16:00 /usr/lib/libncurses++.so.5.9
176 -rwxr-xr-x. 1 root root 178652 Jan 18 16:00 /usr/lib/libncurses.so.5.9
4 lrwxrwxrwx. 1 root root 20 Jan 18 16:00 /usr/lib/libncurses++w.so.5 -> libncurses++w.so.5.9
4 lrwxrwxrwx. 1 root root 18 Jan 18 16:00 /usr/lib/libncursesw.so.5 -> libncursesw.so.5.9
76 -rwxr-xr-x. 1 root root 74616 Jan 18 16:00 /usr/lib/libncurses++w.so.5.9
228 -rwxr-xr-x. 1 root root 233300 Jan 18 16:00 /usr/lib/libncursesw.so.5.9
AND...
$ lsscsi
[1:0:0:0] cd/dvd ASUS DRW-24B3ST j 1.11 /dev/sr0
[3:0:0:0] disk ATA Micron_5100_MTFD U417 /dev/sda
[10:0:0:0] disk LSI 9750-4i DISK 5.12 /dev/sdb
AND ...
$ lshw -class disk
[omitted the other two drives]
description: SCSI Disk
product: 9750-4i DISK
vendor: LSI
physical id: 0.0.0
bus info: scsi@10:0.0.0
logical name: /dev/sdb
version: 5.12
serial: 7SGZBE4C695E14004EE1
size: 14TiB (15TB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=5 guid=04f6a8fe-dc59-4246-ab88-f683baeabaca logicalsectorsize=512 sectorsize=512
AND...
$ lspci -knn | grep 'RAID bus controller'
0a:00.0 RAID bus controller [0104]: 3ware Inc 9750 SAS2/SATA-II RAID PCIe [13c1:1010] (rev 05)
AND ...
$ rpm -qi ncurses
Name : ncurses
Version : 6.4
Release : 3.20230114.fc38
Architecture: x86_64
Install Date: Thu 13 Apr 2023 02:44:55 PM PDT
Group : Unspecified
Size : 632286
License : MIT
Signature : RSA/SHA256, Thu 19 Jan 2023 10:11:33 PM PST, Key ID 809a8d7ceb10b464
Source RPM : ncurses-6.4-3.20230114.fc38.src.rpm
Build Date : Thu 19 Jan 2023 04:01:38 PM PST
Build Host : buildvm-x86-28.iad2.fedoraproject.org
Packager : Fedora Project
Vendor : Fedora Project
URL : https://invisible-island.net/ncurses/ncurses.html
Bug URL : https://bugz.fedoraproject.org/ncurses
Summary : Ncurses support utilities

I know how it's SUPPOSED to work, but it doesn't. RedHat Bugzilla is impossible to use, due to category choices available (forcing a guessing game) and the need to be a RedHat subscriber (which I'm not). Clearly, ncurses has 'moved on' to v 6.4.3. but MegaCLI needs libncurses.so.5, which it can't 'see' even though they are obviously present in /usr/lib. How do you beat that?

@DarkSky7
Copy link

Problem (hopefully) solved. Not w.r.t. MegaCli, but by downloading storcli64 from https://docs.broadcom.com/docs/Unified_storcli_all_os_7.2309.0000.0000.zip per your earlier post. It installs to /opt/MegaRAID/storcli/ and it runs on Fedora 38. Thanks.

@smradman
Copy link

Incredibly helpful (Dell Precision 7920, AVAGO MR9440-8i, RHEL8.8).
Thanks!

@azizarnold
Copy link

I ran this on Almalinux 8.8 and it works:
ln -s /usr/lib64/libncurses.so.6.1 /usr/lib64/libncurses.so.5

Thanks

@ahmed00medhat
Copy link

Hi All, Can I get help with this error please?

`root@Alpha:~/Linux# megacli XD -VdList

./libstorelibir-2.so: cannot open shared object file: No such file or directory

Internal Error.
ERROR:Could not detect controller.
Failed to get ControllerId List.
Failed to get CpController object.

Exit Code: 0x01`

root@Alpha:~/Linux# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

`root@Alpha:~/Linux# /opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -a0 | head

Adapter #0

==============================================================================
Versions
================
Product Name : LSI MegaRAID SAS 9261-8i
Serial No : SV20503315
FW Package Build: 12.15.0-0239
`

@DarkSky7
Copy link

DarkSky7 commented Feb 29, 2024 via email

@FlorianHeigl
Copy link

FlorianHeigl commented Apr 13, 2024

for the record: There's a lot of BS in the ChatGPT answer; i.e. there's no limitation to SATA drives.
Complex tasks honestly still suck in storcli, most basic ones are easier.

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