Rebuild RAID 1 on ServeRAID M5210 using StorCLI on Ubuntu 24

This guide shows how to rebuild a degraded RAID 1 array after replacing a failed disk on a Lenovo server with a ServeRAID M5210 controller. The procedure was performed on an Ubuntu 24.04 KVM hypervisor using StorCLI.

In this case, the replacement SSD appeared as UBad (Unconfigured Bad), and the rebuild did not start automatically. After changing the replacement drive to UGood and assigning it as a dedicated hot spare for the existing drive group, the controller started rebuilding the mirror.

The final checks confirmed that both SSDs were online and the RAID 1 array had returned to Optimal.

Download and Install StorCLI

The version used for this procedure was 007.2705.0000.0000. Download the archive from Broadcom:

wget https://docs.broadcom.com/docs-and-downloads/007.2705.0000.0000_storcli_rel.zip

Extract the main archive and the nested package archive:

unzip 007.2705.0000.0000_storcli_rel.zip
unzip storcli_rel/Unified_storcli_all_os.zip

Install the Ubuntu package:

sudo dpkg -i Unified_storcli_all_os/Ubuntu/storcli_007.2705.0000.0000_all.deb

The installation places the StorCLI executable at:

/opt/MegaRAID/storcli/storcli64

All commands below are run from a root shell. If you use a regular account, prefix StorCLI commands with sudo.

Check the RAID Controller

Display the controller overview:

/opt/MegaRAID/storcli/storcli64 show

Relevant output from this server:

Number of Controllers = 1
Host Name = thyp
Operating System = Linux 6.8.0-90-generic

---------------------------------------------------------------------------
Ctl Model Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS EHS ASOs Hlth
---------------------------------------------------------------------------
0 ServeRAIDM5210 8 4 1 1 1 1 Opt On - Y 2 NdAtn
---------------------------------------------------------------------------

The controller index is 0. The overview shows one drive group and one virtual drive, both not optimal at this stage. The overall controller health is NdAtn (Need Attention).

Display the configuration and topology of controller 0:

/opt/MegaRAID/storcli/storcli64 /c0 show

Use this output to confirm the existing RAID level and the drive group number before assigning a replacement disk. The RAID 1 array in this example belongs to Drive Group 0.

Check the Physical Disks

List every physical disk attached to controller 0:

/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show
-----------------------------------------------------------------------------------
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
-----------------------------------------------------------------------------------
252:0 13 Onln 0 475.905 GB SATA SSD N N 512B SPCC Solid State Disk U -
252:2 14 UBad - 475.905 GB SATA SSD N N 512B Patriot P220 512GB U -
252:4 16 UGood - 1.817 TB SATA HDD N N 512B ST2000LM015-2E8174 U -
252:5 15 UGood - 1.817 TB SATA HDD N N 512B ST2000LM015-2E8174 U -
-----------------------------------------------------------------------------------

The surviving RAID member is the SSD in 252:0. The replacement SSD is the Patriot P220 512GB in 252:2, which is currently marked UBad. The two 1.817 TB HDDs are unconfigured and are not part of this mirror.

  1. EID:Slt - enclosure ID and slot number
  2. DID - controller-assigned device ID
  3. DG - drive group; a dash means the disk is not assigned to a group
  4. Onln - Online
  5. UBad - Unconfigured Bad
  6. UGood - Unconfigured Good
  7. Rbld - Rebuild

The replacement drive is addressed as /c0/e252/s2: controller 0, enclosure 252, slot 2. These identifiers are specific to this server; use the values reported by your own controller.

Confirm the Replacement Disk

Before changing the drive state, inspect the replacement disk details:

/opt/MegaRAID/storcli/storcli64 /c0/e252/s2 show all

Confirm its model, serial number, capacity and sector size against the disk that was installed. In this example, both SSDs report 475.905 GB and 512B sectors.

Important: The following changes target the confirmed replacement disk. Rebuilding writes mirror data onto that disk. Changing a drive to UGood does not repair a hardware fault or prove that the disk is healthy.

Change the Replacement Disk from UBad to UGood

Change the replacement drive state to Unconfigured Good:

root@thyp:~# /opt/MegaRAID/storcli/storcli64 /c0/e252/s2 set good
Controller = 0
Status = Success
Description = Set Drive Good Succeeded.

Check the physical disks again:

/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show

The replacement SSD now appears as UGood:

EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
252:0 13 Onln 0 475.905 GB SATA SSD N N 512B SPCC Solid State Disk U -
252:2 14 UGood - 475.905 GB SATA SSD N N 512B Patriot P220 512GB U -

At this point, the disk is available for configuration, but it has not yet joined the RAID 1 mirror.

Assign the Disk as a Dedicated Hot Spare

Assign the replacement disk as a dedicated hot spare for Drive Group 0:

root@thyp:~# /opt/MegaRAID/storcli/storcli64 /c0/e252/s2 add hotsparedrive dgs=0
Controller = 0
Status = Success
Description = Add Hot Spare Succeeded.

The dgs=0 option dedicates the spare to Drive Group 0. In this degraded RAID 1 configuration, the controller used the replacement SSD and automatically started the rebuild after this command.

The successful hot spare command alone does not confirm that rebuilding has started. Check the rebuild status next.

Monitor the Rebuild Progress

Display the rebuild progress for the replacement disk:

/opt/MegaRAID/storcli/storcli64 /c0/e252/s2 show rebuild

Output captured during the rebuild:

Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.

------------------------------------------------------
Drive-ID Progress% Status Estimated Time Left
------------------------------------------------------
/c0/e252/s2 6 In progress 26 Minutes
------------------------------------------------------

Refresh the output every 10 seconds:

watch -n 10 /opt/MegaRAID/storcli/storcli64 /c0/e252/s2 show rebuild

Press Ctrl+C to exit watch. This stops the display refresh; the RAID controller continues rebuilding. The remaining time is an estimate and can change while the server is handling other disk activity.

Verify That Both RAID Members Are Online

After the rebuild finishes, check all physical disks again:

/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show

Both SSDs should report Onln and belong to Drive Group 0. The final SSD check on this server was:

root@thyp:~# /opt/MegaRAID/storcli/storcli64 /c0 show | grep SSD
252:0 13 Onln 0 475.905 GB SATA SSD N N 512B SPCC Solid State Disk U -
252:2 14 Onln 0 475.905 GB SATA SSD N N 512B Patriot P220 512GB U -

The replacement SSD is now an active mirror member. It is no longer an unused standby spare.

Verify the RAID 1 Array Is Optimal

Display the controller topology:

/opt/MegaRAID/storcli/storcli64 /c0 show

The final topology contained the following RAID 1 and member-drive entries:

DG Arr Row EID:Slot DID Type State BT Size
0 - - - - RAID1 Optl N 475.905 GB
0 0 - - - RAID1 Optl N 475.905 GB
0 0 0 252:0 13 DRIVE Onln N 475.905 GB
0 0 1 252:2 14 DRIVE Onln N 475.905 GB

This is an excerpt of the relevant topology columns. Optl means Optimal. Together with both disks reporting Onln, it confirms that the controller has restored the RAID 1 mirror.

Check the virtual drive state directly:

/opt/MegaRAID/storcli/storcli64 /c0/vall show

The RAID 1 virtual drive should also report Optl.

Confirm the Status in Lenovo IMM

The result can also be checked in the Lenovo Integrated Management Module II web interface:

  1. Open Server Management and select Local Storage.
  2. Select Storage RAID Configuration.
  3. Click Refresh and inspect the volume under the ServeRAID M5210 controller.

The supplied IMM screenshot showed Storage Pool 0 as RAID 1 and the GenericR1_0 volume as Optimal, with a capacity of 475.905 GB. This agreed with the final StorCLI output.

Why the Rebuild Did Not Start Immediately

Installing the replacement disk did not make it an active RAID member. The initial output showed it as UBad. After the state was changed to UGood, it was still unassigned, with a dash in the DG column.

In this case, the rebuild began only after the replacement disk was assigned as a dedicated hot spare for the degraded drive group. The supplied output does not establish why the new disk was initially marked UBad. This procedure documents the recovery that worked on this controller.

Quick Command Reference

For this specific controller and replacement slot, the procedure was:

# Check the controller and existing RAID topology
/opt/MegaRAID/storcli/storcli64 show
/opt/MegaRAID/storcli/storcli64 /c0 show

# Identify the replacement disk
/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show
/opt/MegaRAID/storcli/storcli64 /c0/e252/s2 show all

# Change only the confirmed replacement disk to UGood
/opt/MegaRAID/storcli/storcli64 /c0/e252/s2 set good

# Assign it to Drive Group 0 and check that rebuild starts
/opt/MegaRAID/storcli/storcli64 /c0/e252/s2 add hotsparedrive dgs=0
/opt/MegaRAID/storcli/storcli64 /c0/e252/s2 show rebuild

# Monitor the rebuild
watch -n 10 /opt/MegaRAID/storcli/storcli64 /c0/e252/s2 show rebuild

# After rebuilding, confirm both members and the virtual drive
/opt/MegaRAID/storcli/storcli64 /c0/eall/sall show
/opt/MegaRAID/storcli/storcli64 /c0/vall show
/opt/MegaRAID/storcli/storcli64 /c0 show

References

Broadcom StorCLI Reference Manual - drive state, hot spare and rebuild commands.