Optimal RAID0 Configuration for MegaRAID JBOD Passthrough Workaround


5 views

Many MegaRAID controllers (particularly LSI-based models like 9260/9361 series) lack native JBOD support, forcing administrators to implement creative solutions when direct disk access is required for ZFS, Ceph, or software-defined storage scenarios.

To simulate JBOD functionality:

# MegaCLI command example for single-disk RAID0
./MegaCli -CfgLdAdd -r0 [Enclosure:Slot] WB Direct -a0

# Alternative using storcli (newer controllers)
./storcli /c0 add vd r0 drives=32:0 pdcache=off wb ra

For proper passthrough behavior:

  • Write Policy: Disable cache (Direct IO) to prevent data corruption
  • Read Policy: No Read Ahead (RA) for predictable latency
  • Stripe Size: 64KB (matches most modern filesystem blocks)
  • PD Cache: Disabled for direct disk access

Bash script to configure all drives as individual RAID0 volumes:

#!/bin/bash
CONTROLLER=0
DRIVES=($(./storcli /c$CONTROLLER show all | grep -A100 "Drive Information" | grep "Online" | awk '{print $1}'))

for drive in "${DRIVES[@]}"; do
    ./storcli /c$CONTROLLER add vd r0 drives=${drive} pdcache=off wb ra direct
done

Validate your configuration with:

# Check virtual drive properties
./storcli /c0/vall show all | grep -E "Name|State|Strip|Cache"

When RAID0 workaround isn't optimal:

  • IT Mode firmware flashing (permanent HBA conversion)
  • Hardware HBA alternatives (LSI 9207-8i, 9300-8i)
  • Software-defined solutions (Linux mdadm passthrough)

Problem: SMART data not visible through RAID0
Solution: Add -NoCachedBadBBU flag during creation

Problem: High CPU utilization
Solution: Verify driver version and consider kernel module parameters like msix=1


Many LSI MegaRAID controllers (particularly older models like SAS 9260-8i or 9280-4i4e) lack native JBOD support in their firmware. This becomes problematic when you need direct disk access for:

  • ZFS implementations
  • Software-defined storage solutions
  • Non-RAID disk monitoring utilities

Creating single-disk RAID0 arrays effectively bypasses the controller's caching and parity calculations while maintaining disk visibility to the OS. Here's the technical rationale:

# Sample MegaCLI command to create RAID0 for passthrough
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0 [32:2] WB Direct -a0
# Where:
# -r0 specifies RAID0
# [32:2] is EnclosureID:SlotID
# WB = WriteBack (use WT for WriteThrough if needed)
# Direct = No read ahead

For optimal JBOD-like behavior:

Parameter Recommended Setting Rationale
Strip Size 64KB Balances performance and alignment
Read Policy No Read Ahead Minimizes controller interference
Write Policy Write Through Avoids cache-related data risk
IO Policy Direct IO Bypasses controller caching

For bulk configuration across multiple disks, consider this bash script:

#!/bin/bash
CONTROLLER=0
for SLOT in {0..11}; do
  /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0 [$CONTROLLER:$SLOT] WT Direct -a$CONTROLLER
  /opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -DskCache -L$SLOT -a$CONTROLLER
done

After configuration, verify with:

# Check logical drive properties
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -a0

# Monitor disk SMART data through controller
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -a0 | grep -E "Slot|S.M.A.R.T"

While this method provides JBOD-like functionality, there are subtle differences:

  • Disk identification changes after reboots
  • Slight overhead from RAID metadata (typically <1% capacity)
  • Some advanced S.M.A.R.T. attributes may be unavailable

For mission-critical implementations where RAID0 isn't acceptable:

  1. Flash controller to IT mode (cross-flashing required)
  2. Use HBA controllers instead of RAID controllers
  3. Consider newer MegaRAID controllers with native JBOD (e.g., 9440-8i)