MegaCliを使用して外れてしまったRAID5のディスクを再復帰させる

HDDに使用している電源ケーブルの不良で稼働中にHDDの電源が落ちてしまい、
自動では復旧してくれなかったので手動修正することにします。

先ずは下記コマンドで全体の状況を確認してみます。(長いので一部のみ記載します)

[sourcecode][root@nas GomenneGomenne-]# storcli /c0 show all
Drive Groups = 1

TOPOLOGY :
========

————————————————————————-
DG Arr Row EID:Slot DID Type State BT Size PDC PI SED DS3 FSpace
————————————————————————-
0 – – – – RAID5 Dgrd N 12.731 TB enbl N N dflt N
0 0 – – – RAID5 Dgrd N 12.731 TB enbl N N dflt N
0 0 0 252:0 2 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 1 252:1 3 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 2 252:2 1 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 3 252:4 11 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 4 252:5 10 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 5 252:3 0 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 6 252:6 12 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 7 – – DRIVE Msng – 1.818 TB – – – – –
————————————————————————-

DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present

Virtual Drives = 1

VD LIST :
=======

———————————————————–
DG/VD TYPE State Access Consist Cache sCC Size Name
———————————————————–
0/0 RAID5 Dgrd RW Yes NRAWBC – 12.731 TB
———————————————————–

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|B=Blocked|Consist=Consistent|
R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency

Physical Drives = 8

PD LIST :
=======

—————————————————————————
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
—————————————————————————
252:0 2 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:1 3 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68AX9N0 U
252:2 1 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:3 0 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:4 11 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68AX9N0 U
252:5 10 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:6 12 Onln 0 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
252:7 13 UBad F 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
—————————————————————————

EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down|T-Transition|F-Foreign
UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded
CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded[/sourcecode]

この段階で確認出来るのが、
DG0、Arr0、Row7のDiskがFailed
RAID5構成のVirtual DrivesがDegraded
Enclosure Device ID 252番、Slotが7番がUnconfigured Bad

このDiskが完全にお亡くなり(というか途中でRAIDから外れてしまっただけ)ということですね。
私の方では、SNで搭載HDDを管理しているのでDiskSerialを確認します。

[sourcecode][root@nas GomenneGomenne-]# storcli /c0/e252/s7 show all
Drive /c0/e252/s7 Device attributes :
===================================
SN = ******** ←ここにSNが出ます
Manufacturer Id = ATA
Model Number = TOSHIBA DT01ACA200
NAND Vendor = NA
WWN = ********
Firmware Revision = MX4OABB0
Raw size = 1.819 TB [0xe8e088b0 Sectors]
Coerced size = 1.818 TB [0xe8d00000 Sectors]
Non Coerced size = 1.818 TB [0xe8d088b0 Sectors]
Device Speed = 6.0Gb/s
Link Speed = 6.0Gb/s
NCQ setting = N/A
Write cache = N/A
Sector Size = 512B[/sourcecode]

元に戻したいHDDである事を再確認しました。(それ以外には無いんですけどね。複数アレイ作業時には重要に・・・)
では早速戻していきます。

まず、UBad となっているHDDをUGoodへ変更し、異常が無いDiskとしてフラグを立てます。
[sourcecode][root@nas GomenneGomenne-]# storcli /c0/e252/s7 set good
Controller = 0
Status = Success
Description = Set Drive Good Succeeded.

[root@nas GomenneGomenne-]# storcli /c0/e252/s7 show all
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.

Drive /c0/e252/s7 :
=================

————————————————————————-
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
————————————————————————-
252:7 13 UGood F 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
————————————————————————-

EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down|T-Transition|F-Foreign
UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded
CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded[/sourcecode]

次はRAIDから外れてしまったこのHDDをRAIDアレイへぶち込みます。
/c0/e252/s7 で対象のDiskを名指しします。
そして、DG0、Arr0、Row7のDiskがFailedになってる(何もアサインされてない)状態なので、この場所へDiskをInsertします。
ヘルプを見ると、storcli /cx[/ex]/sx insert dg=A array=B row=C のように指定してほちぃと言われているので、
下記のようにコマンドを投げます。

[sourcecode][root@nas GomenneGomenne-]# storcli /c0/e252/s7 insert dg=0 array=0 row=7
Controller = 0
Status = Success
Description = Insert Drive Succeeded.

[root@nas GomenneGomenne-]# storcli /c0 show all
Generating detailed summary of the adapter, it may take a while to complete.

Controller = 0
Status = Failure
Description = None

Drive Groups = 1

TOPOLOGY :
========

————————————————————————-
DG Arr Row EID:Slot DID Type State BT Size PDC PI SED DS3 FSpace
————————————————————————-
0 – – – – RAID5 Dgrd N 12.731 TB enbl N N dflt N
0 0 – – – RAID5 Dgrd N 12.731 TB enbl N N dflt N
0 0 0 252:0 2 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 1 252:1 3 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 2 252:2 1 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 3 252:4 11 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 4 252:5 10 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 5 252:3 0 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 6 252:6 12 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 7 252:7 13 DRIVE Offln N 1.818 TB enbl N N dflt –
————————————————————————-

DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present

Virtual Drives = 1

VD LIST :
=======

———————————————————–
DG/VD TYPE State Access Consist Cache sCC Size Name
———————————————————–
0/0 RAID5 Dgrd RW Yes NRAWBC – 12.731 TB
———————————————————–

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|B=Blocked|Consist=Consistent|
R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency

Physical Drives = 8

PD LIST :
=======

—————————————————————————
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
—————————————————————————
252:0 2 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:1 3 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68AX9N0 U
252:2 1 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:3 0 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:4 11 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68AX9N0 U
252:5 10 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:6 12 Onln 0 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
252:7 13 Offln 0 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
—————————————————————————[/sourcecode]

UGoodからOfflineにステータスが変わりましたが、RAIDアレイ自体はDgrdのままです。
まだ対象のDisk自体にデータの書き戻し(この1本だけ最新の状態に)更新されていない状態なので・・・

早速Rebuildを掛けます!
RAIDに参加させたHDDに対してReBuildを掛けたいので、下記のように指定します。

[sourcecode][root@nas GomenneGomenne-]# storcli /c0/e252/s7 start rebuild
Controller = 0
Status = Success
Description = Start Drive Rebuild Succeeded.

[root@nas GomenneGomenne-]# storcli /c0 show all
Generating detailed summary of the adapter, it may take a while to complete.

Controller = 0
Status = Failure
Description = None

Drive Groups = 1

TOPOLOGY :
========

————————————————————————-
DG Arr Row EID:Slot DID Type State BT Size PDC PI SED DS3 FSpace
————————————————————————-
0 – – – – RAID5 Dgrd N 12.731 TB enbl N N dflt N
0 0 – – – RAID5 Dgrd N 12.731 TB enbl N N dflt N
0 0 0 252:0 2 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 1 252:1 3 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 2 252:2 1 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 3 252:4 11 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 4 252:5 10 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 5 252:3 0 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 6 252:6 12 DRIVE Onln N 1.818 TB enbl N N dflt –
0 0 7 252:7 13 DRIVE Rbld Y 1.818 TB enbl N N dflt –
————————————————————————-

DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present

Virtual Drives = 1

VD LIST :
=======

———————————————————–
DG/VD TYPE State Access Consist Cache sCC Size Name
———————————————————–
0/0 RAID5 Dgrd RW Yes NRAWBC – 12.731 TB
———————————————————–

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|B=Blocked|Consist=Consistent|
R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency

Physical Drives = 8

PD LIST :
=======

—————————————————————————
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
—————————————————————————
252:0 2 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:1 3 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68AX9N0 U
252:2 1 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:3 0 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:4 11 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68AX9N0 U
252:5 10 Onln 0 1.818 TB SATA HDD N N 512B WDC WD20EFRX-68EUZN0 U
252:6 12 Onln 0 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
252:7 13 Rbld 0 1.818 TB SATA HDD N N 512B TOSHIBA DT01ACA200 U
—————————————————————————[/sourcecode]

これで対象のHDDに対してデータの書き戻し処理が開始されました。
あとは終わるまで待つだけですね。