Skip to end of metadata
Go to start of metadata

Introduction

MegaCLI is included in our Recovery Tool (System Rescue CD). If necessary you can download the MegaCli util for Linux here: MegaCli - Version 8.07.10.1

The following table lists different common megacli commands:

Description
Command
Details
Get adapter info
megacli -AdpAllInfo -aAll
 
Get logical device info
megacli -LDInfo -LAll -aAll
 
Get physical device infomegacli -PDList -aAll 
Get enclosure info
megacli -EncInfo -aALL
 
Delete all logical volumesmegacli -CfgLdDel -LAll -aALL 
Delete all settings and logical volumesmegacli -CfgLdDel -LAll -aAll 
Create logical RAID0 volume,
using single disk
megacli -CfgLdAdd -r0 [252:4] -a0

Where r0 specifies RAID type, 252 is enclosure ID and 4 is disk ID

Clear all foreign configuration data
megacli -CfgForeign -Clear -aAll
 
Disable battery warning
megacli -AdpSetProp BatWarnDsbl 1 -a1
Disable battery warning on secondary controller, where battery is absent
Enable locator LED for physical device
megacli -PdLocate -start -physdrv[252:4] -a0 
Where a0 specifies adaptor #0, 252 is enclosure ID and 4 is disk ID
Disable locator LED for physical device
megacli -PdLocate -stop -physdrv[252:4] -a0 
Where a0 specifies adaptor #0, 252 is enclosure ID and 4 is disk ID

Examples

This section contains example configuration commands. You may need to clear the current configuration first:

megacli -CacheCade -remove -LALL -aALL
megacli -CfgCacheCadeDel -LALL -aALL
megacli -CfgLdDel -LAll -aAll
megacli -CfgClr -force -aAll

Each disk as RAID 0

You can choose to configure each disk as its own RAID 0 logical device, this will enable you to use e.g. Linux Software RAID.

megacli -CfgEachDskRaid0 -a0
megacli -LDInfo -LAll -a0

RAID 1

In this example we will create a RAID 1 (mirror) logical device, consisting of two disks. From slot 0 through 1.

megacli -CfgLdAdd -r1 [252:0,252:1] -a0
megacli -LDInfo -LAll -a0

RAID 5

The following example will configure a RAID 5 logical device consisting of 8 disks from slot 0 through 7.

megacli -CfgLdAdd -r5 [252:0,252:1,252:2,252:3,252:4,252:5,252:6,252:7] -a0
megacli -LDInfo -LAll -a0

RAID 10

The following example will configure a RAID 10 logical device consisting of 8 disks from slot 0 through 7.

megacli -CfgSpanAdd -r10 -Array0[252:0,252:1] -Array1[252:2,252:3] -Array2[252:4,252:5] -Array2[252:6,252:7] -a0
megacli -LDInfo -LAll -a0

RAID 5 with CacheCade

This example will configure RAID 5 on the first 6 HDDs and CacheCade in RAID 1 on two SSDs.

First we create the RAID 5 logical device, with HDDs in slot 0, 1, 2, 3, 4 and 5

megacli -CfgLdAdd -r5 [252:0,252:1,252:2,252:3,252:4,252:5] -a0

Now we create and assign the CacheCade configuration using SSDs in slot 6 and 7.

megacli -CfgCacheCadeAdd -r1 -Physdrv[252:6,252:7] WB -assign -L0 -a0

Check that everything is in order:

megacli -CfgCacheCadeDsply -a0
megacli -LDInfo -LAll -a0

RAID 10 with CacheCade

This example will configure RAID 10 on the first 6 HDDs and CacheCade in RAID 1 on two SSDs.

First we create the RAID 10 logical device, with HDDs in slot 0, 1, 2, 3, 4 and 5

megacli -CfgSpanAdd -r10 -Array0[252:0,252:1] -Array1[252:2,252:3] -Array2[252:4,252:5] -a0

Now we create and assign the CacheCade configuration using SSDs in Slot 6 and 7.

megacli -CfgCacheCadeAdd -r1 -Physdrv[252:6,252:7] WB -assign -L0 -a0

Check that everything is in order:

megacli -CfgCacheCadeDsply -a0
megacli -LDInfo -LAll -a0
  • No labels