How to Create RAID 10 Array Using MegaCLI on OpenFiler: Complete Command Syntax Guide


4 views

When working with LSI MegaRAID controllers through MegaCLI on Linux-based storage systems like OpenFiler, creating a RAID 10 array requires precise syntax. The error you encountered (Invalid input at or near token E) typically indicates formatting issues in the enclosure/slot specification.

The proper MegaCLI syntax for creating a spanned RAID 10 (RAID 1+0) across 20 disks (2-21) would be:

MegaCli -CfgSpanAdd -r10 -Array0[25:2,25:3,25:4,25:5,25:6,25:7,25:8,25:9,25:10,25:11] -Array1[25:12,25:13,25:14,25:15,25:16,25:17,25:18,25:19,25:20,25:21] WB Cached NoCachedBadBBU -a0
  • -r10: Specifies RAID level 10
  • -Array0/Array1: Each array represents one side of the mirror (RAID 1) that will be striped (RAID 0)
  • 25:X: EnclosureID:SlotNumber format (no "E" or "S" prefixes needed)
  • WB: Write Back cache policy
  • Cached: Enables read cache
  • NoCachedBadBBU: Disables cache when BBU fails

After creating the array, verify the configuration with:

MegaCli -LDInfo -Lall -a0
MegaCli -PDList -a0 | grep -iE "Enclosure|Slot|state"

For complex configurations, consider creating a config file:

echo "CfgSpanAdd -r10 -Array0[25:2,25:3] -Array1[25:4,25:5] WB Cached NoCachedBadBBU" > raid10.txt
MegaCli -f raid10.txt -a0

If disks show as "Unconfigured Good", first set them to JBOD:

MegaCli -PDMakeJBOD -PhysDrv[25:2] -a0

Or mark them as ready for RAID:

MegaCli -PDMakeGood -PhysDrv[25:2] -a0

The correct syntax for creating RAID 10 via MegaCLI requires proper enclosure:slot notation and array grouping. The error you encountered suggests incorrect device addressing format. Let's break down the proper structure:

MegaCli -CfgSpanAdd -r10 -Array0[E:S,E:S] 
-Array1[E:S,E:S] WB Cached NoCachedBadBBU -a

For your specific case with disks 2 through 21 on enclosure 25, you'll need to create mirrored pairs first, then stripe them. Here's the actual working command:

MegaCli -CfgSpanAdd -r10 \
-Array0[E25:S02,E25:S03] -Array1[E25:S04,E25:S05] \
-Array2[E25:S06,E25:S07] -Array3[E25:S08,E25:S09] \
-Array4[E25:S10,E25:S11] -Array5[E25:S12,E25:S13] \
-Array6[E25:S14,E25:S15] -Array7[E25:S16,E25:S17] \
-Array8[E25:S18,E25:S19] -Array9[E25:S20,E25:S21] \
WB Cached NoCachedBadBBU -a0

After executing the command, verify the RAID configuration with:

MegaCli -LDInfo -Lall -a0

For detailed physical disk information:

MegaCli -PDList -a0 | egrep "Enclosure Device|Slot|Firmware state"

If you encounter "Invalid input at or near token E" errors:

  • Ensure no spaces between enclosure:slot notation
  • Verify disk slots are available and not part of existing arrays
  • Check enclosure ID with MegaCli -EncInfo -a0

For better RAID 10 performance on your OpenFiler system, consider these parameters:

MegaCli -LDSetProp -Direct -Immediate -LAll -a0
MegaCli -LDSetProp CachedBadBBU -LAll -a0
MegaCli -LDSetProp -EnDskCache -LAll -a0