Using MegaCli set disk to HotSpare mode in linux

When one of the disks failed in Dell MD1000, the hotspare disk will change its role into online mode, and you need to replace  the bad disk with a good one. So a question comes, how can I set the new disk into hotspare mode.

With the help of MegaCli, it’s quite easy, just a single command like this:

# MegaCli -PDHSP -set -PhysDrv[A:B] -aC

A:¬† it’s Enclosure Number

B: It’s Slot NUmber

C: It’s Array ID

Here is an example:

Find out the issued disk by this command:

# /usr/sbin/MegaCli -PDList -a1|grep "Firmware state: Unconfigured(good)" -B12

Enclosure Number: 1
Slot Number: 255
Device Id: 32
Sequence Number: 1
Media Error Count: 0
Other Error Count: 1
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 0MB [0x0 Sectors] Non Coerced Size: 9007199254740480MB [0xfffffffffff00000 Sectors] Coerced Size: 0MB [0x0 Sectors] Firmware state: Unconfigured(good)

Enclosure Number: 2
Slot Number: 8
Device Id: 33
Sequence Number: 1
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 381469MB [0x2e90edd0 Sectors] Non Coerced Size: 380957MB [0x2e80edd0 Sectors] Coerced Size: 380928MB [0x2e800000 Sectors] Firmware state: Unconfigured(good)

Here, “Slot Number: 255” meas the entire disk cube, just simply pass it. so your command is something like this:

# /usr/sbin/MegaCli -PDHSP -set -PhysDrv[2:8] -a1

Set Physical Drive at EnclId-2 SlotId-4 as Hot Spare Success.

Share Button

2 thoughts on “Using MegaCli set disk to HotSpare mode in linux

Leave a comment

Your email address will not be published. Required fields are marked *