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
|
|
Extract the Package
|
|
Convert RPM Package to DEB Package
Since the downloaded package is in RPM format, use the alien tool to convert it to DEB format:
|
|
Install the DEB Package
|
|
Fix Dependency Issues (If Needed)
If you encounter a missing libncurses.so.5 error, create a symbolic link:
|
|
Verify Installation
|
|
Checking RAID Status
Use the following command to view detailed information about all physical hard drives:
|
|
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:
|
|
Expected Result
After successful command execution, the terminal will display:
|
|
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:
|
|
After execution, use lsblk or fdisk -l to verify if the new hard drive is visible.
Summary
Key steps in this troubleshooting process:
- β Install MegaCli tool for RAID card management
- β
Use
-PDListcommand to view all physical drive statuses - β
Identify the problem: New drive is in
Unconfigured(good)status - β
Use
-CfgLdAddcommand to create single-disk RAID 0 - β 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.