Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jesussuarz/78a00eaa5925a444fb12b31646e773e1 to your computer and use it in GitHub Desktop.
Save jesussuarz/78a00eaa5925a444fb12b31646e773e1 to your computer and use it in GitHub Desktop.
Install LSI MegaCli package on Debian/Ubuntu/RedHat and Create 2 groups RAID5 for OVH Servers to use maximum disk space

Send your server to rescue mode, If you use rescue custom mode then you probably need to install megacli

Then you can, When your server reboots, log in to it via SSH using the rescue mode credentials that were emailed to you.

Install LSI MegaCli package on Linux - All distributions based on RedHat/Debian:


Install necessary tools

apt-get install unzip
apt-get install alien

Install necessary lib

apt install libncurses5

Troubleshooting MegaCli on 64-bit Debian/Ubuntu 24.04 Systems


When trying to run MegaCli on a 64-bit Debian/Ubuntu 24.04 system, you may encounter the following error:

MegaCli: error while loading shared libraries: cannot open shared object file

This error occurs because the 64-bit system is missing the required 32-bit libraries.


To resolve this issue, you need to create a symlink for the missing library. Follow these steps:

  1. Check if the library exists: Before creating the symlink, make sure that the library is installed on your system. You can check this by locating the library in /usr/lib/x86_64-linux-gnu/ or /lib/x86_64-linux-gnu/.

  2. Create the symlink: If the library exists but the error persists, the issue might be due to the system looking for the library in a different path. Create a symbolic link to resolve this:

ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/
ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/
  1. Verify the solution: After creating the symlink, try running MegaCli again to check if the error is resolved. You should see something similar to the following if it works:
/opt/MegaRAID/MegaCli/MegaCli64 -v
MegaCLI SAS RAID Management Tool  Ver 8.07.14 Dec 16, 2013
(c)Copyright 2013, LSI Corporation, All Rights Reserved.

Exit Code: 0x00

Additional Notes:

  • If you are consistently working with legacy software requiring 32-bit libraries, consider installing the full set of 32-bit compatibility libraries with:
sudo apt-get install ia32-libs

Now Download MegaCLI




Create debian package

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

Install debian package

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

Run MegaCli

/opt/MegaRAID/MegaCli/MegaCli64 -h

Create an Alias

alias MegaCli='/opt/MegaRAID/MegaCli/MegaCli64'

Now the command to use

MegaCli -h


cd Linux
yum localinstall MegaCli-8.07.14-1.noarch.rpm

Create RAID5

From the command line, type the following commands to delete the existing RAID settings. All data in the RAID will be deleted

MegaCli -CfgLdDel -L0 -a0
MegaCli -CfgLdDel -Lall -aAll

Type the following command to retrieve the slot device IDs of your disks

MegaCli -PdList -aALL | egrep "Slot|Device ID"

Type the following commands to configure RAID level 0

MegaCli -CfgLDAdd -R0[252:0,252:1] -a0

In this example, 252 is the ID of the drive enclosure.

if you want to create 2 groups in raid5 use

MegaCli -CfgLdAdd -r5 [252:0,252:1,252:2,252:3,252:4,252:5] -a0
MegaCli -CfgLdAdd -r5 [252:6,252:7,252:8,252:9,252:10,252:11] -a0

After setting the new RAID level you can check the settings with the following command:

MegaCli -LDInfo -Lall -a0 | grep -i size

Now just start your server in normal mode and you will be able to see your disk groups.

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