I have a LSI MegaRAID controller. I pulled out a failed drive and replaced it with a good one. I didn't run any special storcli
commands before this, I just swapped the drives. Unsure if that was a mistake.
It shows up as UGood
:
32:8 26 UGood F 1.818 TB SATA HDD N N 512B ST32000645NS U -
I want to add it as a hotspare, but the command fails:
# ./storcli64 /c0/e32/s8 add hotsparedrive
Controller = 0
Status = Failure
Description = Add Hot Spare Failed.
Detailed Status :
===============
------------------------------------------------
Drive Status ErrCd ErrMsg
------------------------------------------------
/c0/e32/s8 Failure 255 Device state invalid.
------------------------------------------------
What should I set the drive state to first? Should I also initialize the drive?
The problem is that the drive was labeled foreign, probably because it had once belonged to another RAID system. I don't know the history of the drive, so that's plausible.
The letter F in the status indicates that it's foreign.
You can clear the foreign config with: storcli /c0/fall delete
I have no idea how it works with storcli64, but I just had to replace a raid1 failed drive (slot 0) with megacli64 :