Expand your knowledge of hardware, software and supercomputing

Create a raid array with MegaCli64

Note: The following is assuming that you have attached new drives to a newly installed LSI raid controller.

The first thing to do is to get a list of all the drives attached to the raid controller. The way the LSI raid controllers identify/label their attached disks is by an ‘Enclosure ID’ and the drive ‘Slot Number’. The following command is an easy way to get a list of all the attached drives:

$ MegaCli64 -pdlist -a0 | grep ^Enclosure\ Device -A1
 Enclosure Device ID: 252
 Slot Number: 0
 —
 Enclosure Device ID: 252
 Slot Number: 1
 —
 Enclosure Device ID: 252
 Slot Number: 2
 —
 Enclosure Device ID: 252
 Slot Number: 3

Now that we have the list of all the attached drives we can use the following command to create a raid 5 from them.

$ MegaCli64 -cfgldadd r5[252:0,252:1,252:2,252:3] -a0

Let’s breakdown the above command.

  • -cfgldadd
    • This stands for “Configure Logic Device – Add”
  • r5
    • This declares which raid level to use. In this example we are using raid 5, but it can be r6, etc…
  • [252:0,252:1,252:2,252:3]
    • This is the ‘Enclosure ID:Slot #’ of each drive attached to the raid card
  • -a0
    • This stands for ‘Adapter 0′ which represents the first LSI raid card in your system. Unless you have multiple raid cards in your system this value will always be ‘a0′ for all of your MegaCli64 commands.

Initially creating a raid is quite fast, but you can expect days worth of reconfiguring on larger raids if they are altered in any way. After the raid is created we can now see it with the following command:

$ MegaCli64 -ldinfo -l0 -a0

Adapter 0 — Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name :
RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3
Size : 1.361 TB
Sector Size : 512
Is VD emulated : No
Parity Size : 464.729 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 4
Span Depth : 1
Default Cache Policy: WriteBack, ReadAheadNone, Cached, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAheadNone, Cached, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy : Disk’s Default
Encryption Type : None
Is VD Cached: No
Use our Breakin stress test and diagnostics tool to pinpoint hardware issues and component failures.
Check out our product catalog and use our Configurator to plan your next system and get a price estimate.

Request a Consultation from our team of HPC and AI Experts

Would you like to speak to one of our HPC or AI experts? We are here to help you. Submit your details, and we'll be in touch shortly.

  • This field is for validation purposes and should be left unchanged.