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:

Ubuntu/Debian

Install necessary tools

apt-get install unzip
apt-get install alien

Install necessary lib

apt install libncurses5

Download MegaCLI

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

Redhat/Centos/OracleLinux/AlmaLinux

unzip 8-07-14_MegaCLI.zip
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