How to Detect Hardware RAID Configuration from Linux Command Line


1 views

When working with hardware RAID controllers, Linux typically sees the virtual disk presented by the RAID controller rather than individual physical disks. This explains why your lsblk output shows fewer and differently-sized devices compared to the actual physical drives.

$ lsblk
NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda     8:0    0   298G  0 disk 
sdb     8:16   0   2.7T  0 disk

Several command-line utilities can help uncover RAID configuration details:

1. Using lshw for Controller Information

$ sudo lshw -class disk -class storage
*-disk
   description: ATA Disk
   product: MegaRAID Virtual Disk
   physical id: 0.0.0
   ...
*-storage
   description: RAID bus controller
   product: MegaRAID SAS 2208
   vendor: LSI Logic / Symbios Logic

2. Checking dmesg for Boot-time RAID Detection

$ dmesg | grep -i raid
[    2.320475] megaraid_sas 0000:03:00.0: FW now in Ready state
[    2.345210] megaraid_sas 0000:03:00.0: firmware supports 255 drives

3. Vendor-Specific CLI Tools

For common RAID controllers:

  • LSI MegaRAID: storcli or MegaCLI
  • HP Smart Array: hpssacli
  • Adaptec: arcconf
# Example with MegaCLI
$ sudo /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aAll
Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name                :
RAID Level          : Primary-1, Secondary-0, RAID Level Qualifier-0
Size                : 298.875 GB
State               : Optimal
Strip Size          : 256 KB
Number Of Drives    : 2

When you see discrepancies like:

  • Physical: 4x1TB drives
  • Visible: 1x2.7TB volume

This typically indicates RAID 5 (3 drives + 1 parity) or RAID 10 (2 mirrored pairs striped). The exact configuration requires controller-specific tools.

When vendor tools aren't available:

$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: DELL     Model: PERC H730P Mini  Rev: 4.27
  Type:   Direct-Access                    ANSI SCSI revision: 05

For NVMe RAID:

$ nvme list
Node          SN                  Model               Version
/dev/nvme0n1  S3T9NX0M123456      Dell Express Flash PM1725b
/dev/nvme1n1  S3T9NX0M123457      Dell Express Flash PM1725b

Remember that hardware RAID intentionally abstracts physical disks. Some details (like individual disk health) may only be available through the controller's BIOS configuration utility during boot.


When working with enterprise servers, hardware RAID configurations often abstract physical disk details from the operating system. This creates an interesting diagnostic challenge when we need to:

  • Verify RAID configuration without downtime
  • Identify failed disks in the array
  • Check RAID level (0,1,5,6,10 etc.)
  • Monitor array health status

Here's your Linux RAID detective toolkit:

# Check for RAID controller presence
lspci | grep -i raid
# Sample output for LSI MegaRAID:
# 03:00.0 RAID bus controller: Broadcom / LSI MegaRAID SAS-3 3108 [Invader]

For common RAID controllers:

MegaRAID (Broadcom/LSI)

# Install MegaCLI (package names vary by distro)
sudo apt-get install megacli

# Get array information
sudo megacli -LDInfo -Lall -aALL

# Physical disk enumeration
sudo megacli -PDList -aALL | egrep "Adapter|Enclosure|Slot|WWN|State"

# Check rebuild status
sudo megacli -PDRbld -ShowProg -PhysDrv [Enc:Slot] -aALL

HP Smart Array

sudo hpacucli ctrl all show config detail

Adaptec RAID

sudo arcconf getconfig 1 pd

When vendor tools aren't available:

# Check for hidden RAID metadata
sudo hdparm -I /dev/sdX | grep -i raid

# Examine block devices in detail
lsblk -o NAME,ROTA,RM,SIZE,RO,TYPE,TRAN,VENDOR,MODEL,SERIAL

# Smartmontools with RAID passthrough
sudo smartctl -d megaraid,N -a /dev/sdX
# Where N is the disk index in the array

Let's analyze the original scenario mathematically:

Physical drives:
2x 320GB + 4x 1TB = 2.64TB raw

Visible in OS:
298GB + 2.7TB = ~3TB

This suggests:
- 2x 320GB in RAID 1 (298GB usable)
- 4x 1TB in RAID 5 (2.7TB usable)

Regular checks you should automate:

# Create a health check script
#!/bin/bash
RAID_STATUS=$(sudo megacli -LDInfo -Lall -aALL | grep "State")
if [[ $RAID_STATUS != *"Optimal"* ]]; then
    echo "RAID DEGRADED: $RAID_STATUS" | mail -s "RAID Alert" admin@example.com
fi

If all else fails, these low-level techniques might help:

  • Check dmesg for controller initialization messages
  • Examine BIOS/UEFI settings (requires reboot)
  • Consult server hardware documentation