Featured image of post Troubleshooting RAID Hard Drive Recognition Issues

Troubleshooting RAID Hard Drive Recognition Issues

A detailed record of troubleshooting and resolving server RAID card issues with unrecognized new hard drives using MegaCli tools

Problem Background

During server maintenance, I encountered a challenging issue: after inserting a new 1TB SAS hard drive into the server, the lsblk command couldn’t detect this new drive. After investigation, I found that although the hard drive had been recognized by the RAID card, it was in an Unconfigured(good) state and hadn’t been configured as a virtual disk, making it inaccessible to the operating system.

This article documents the complete process of troubleshooting and resolving this issue using the MegaCli tool.

Installing MegaCli Tool

MegaCli is a command-line tool for managing LSI/Broadcom RAID cards. Here are the installation steps for Ubuntu/Debian systems:

Download MegaCli Package

1
wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

Extract the Package

1
unzip 8-07-14_MegaCLI.zip

Convert RPM Package to DEB Package

Since the downloaded package is in RPM format, use the alien tool to convert it to DEB format:

1
2
cd Linux
sudo alien MegaCli-8.07.14-1.noarch.rpm

Install the DEB Package

1
sudo dpkg -i megacli_8.07.14-2_all.deb

Fix Dependency Issues (If Needed)

If you encounter a missing libncurses.so.5 error, create a symbolic link:

1
sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5

Verify Installation

1
/opt/MegaRAID/MegaCli/MegaCli64 -v

Checking RAID Status

Use the following command to view detailed information about all physical hard drives:

1
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL

Through MegaCli’s output, you can clearly see the current status of all hard drives on the server.

Investigation Conclusion

The server has a total of 7 physical hard drives, and the newly inserted drive is located at Slot 6, with a current status of Unconfigured(good) (unconfigured but in good condition). It hasn’t been configured as a Virtual Drive yet, so the Linux operating system (lsblk) cannot recognize it.

Detailed Hard Drive Distribution

For better understanding, the 7 hard drives are categorized into 4 groups by purpose:

System Drive (corresponds to /dev/sda)

  • Location: Slot 5
  • Model: Intel 120GB SSD
  • Status: Online
  • Configuration: Single-disk RAID 0 (or passthrough mode)
  • Purpose: System boot drive

Data Drive Array (corresponds to /dev/sdb, capacity 2.7TB)

  • Location: Slot 0, 1, 2, 3
  • Model: 4 Seagate 1TB SAS drives
  • Status: Online
  • Configuration: RAID 5 array (3 data blocks + 1 parity = 3TB usable capacity)

Data Drive (corresponds to /dev/sdc, capacity 931GB)

  • Location: Slot 7
  • Model: Seagate 1TB SAS drive
  • Status: Online
  • Configuration: Single-disk RAID 0

πŸ” Key Finding: Newly Inserted Drive (Slot 6)

  • Location: Slot 6
  • Model: Toshiba 1TB SAS drive
  • Status: Unconfigured(good) (unconfigured but in good condition)
  • Foreign State: None (no foreign configuration)
  • Other Error Count: 9 (some historical error counts, not affecting current recognition)
  • Current Situation: The drive is physically connected properly and recognized by the RAID card, but since it hasn’t been added to any RAID group or created as a virtual disk, the RAID card won’t present it to the operating system

Problem Analysis: Why Wasn’t It Auto-Recognized?

Reason One: Foreign State is None

The output shows Foreign State: None, indicating that the RAID card hasn’t detected any recognizable old RAID configuration information on this disk (or it has been cleared).

  • If it was previously Linux software RAID (mdadm): Hardware RAID cards cannot recognize software RAID metadata and will treat it as an empty disk
  • If it was previously hardware RAID: The RAID metadata may be incompatible or has been cleared

Reason Two: Manual Virtual Disk Creation Required

On RAID cards like Dell PERC, physical disks must be configured as Virtual Drives (VD) before the operating system can access them.

Solution: Configure the Drive Online

Since the drive status is Unconfigured(good), it needs to be configured as a single-disk RAID 0 for the operating system to recognize it.

Create Single-Disk RAID 0

Execute the following command to configure the Slot 6 drive as a virtual disk:

1
2
3
4
# Configure Slot 6 drive as single-disk RAID 0
# [32:6] represents Enclosure 32, Slot 6
# -a0 represents adapter 0
sudo /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0 [32:6] -a0

Expected Result

After successful command execution, the terminal will display:

1
Adapter 0: Created VD 3

Run the lsblk command again, and you should see the newly added /dev/sdd device.

⚠️ Data Safety Notice

Important: The -CfgLdAdd command creates RAID structure and rewrites disk header metadata, which may affect access to original data.

Data Recovery Options for Different Scenarios

Original Drive Configuration Foreign State Data Recovery Possibility
Linux Software RAID (mdadm) None After configuration, try using mdadm --assemble --scan to recover data
Hardware RAID None RAID card no longer recognizes old configuration, can only mount as new disk, recovery depends on partition table integrity
Brand New Drive None No data loss risk, can use directly

Refresh System Device List

After configuration, if the system still hasn’t automatically recognized the new device, you can manually refresh the SCSI bus:

1
2
3
4
# Scan all SCSI host controllers to make the system re-recognize drives
for host in /sys/class/scsi_host/host*/scan; do 
    echo "- - -" > "$host"
done

After execution, use lsblk or fdisk -l to verify if the new hard drive is visible.

Summary

Key steps in this troubleshooting process:

  1. βœ… Install MegaCli tool for RAID card management
  2. βœ… Use -PDList command to view all physical drive statuses
  3. βœ… Identify the problem: New drive is in Unconfigured(good) status
  4. βœ… Use -CfgLdAdd command to create single-disk RAID 0
  5. βœ… Refresh system device list and verify drive is online

Through this investigation, I gained a deep understanding of how hardware RAID cards work: physical drives must first be configured as virtual disks before the operating system can access them. In daily operations, when encountering hard drive recognition issues, you should first check the RAID card level configuration status rather than troubleshooting only at the operating system level.

Facing the sea with spring blossoms.
Built with Hugo
Theme Stack designed by Jimmy