| | 414 | |
| | 415 | ==== Rebuilding a disk by hand when it doesn't occur automatically ==== |
| | 416 | |
| | 417 | I noticed that strange behavior on an IBM controller. Unplugging and pluging back a disk from an array doesn't make the controller rebuild the array with that disk.[[BR]] |
| | 418 | Here is what to do: |
| | 419 | |
| | 420 | {{{ |
| | 421 | server:~# megacli -PDlist -a0 |
| | 422 | [...] |
| | 423 | Enclosure Device ID: 252 |
| | 424 | Slot Number: 4 |
| | 425 | Device Id: 3 |
| | 426 | [...] |
| | 427 | Firmware state: Unconfigured(bad) |
| | 428 | [...] |
| | 429 | Secured: Unsecured |
| | 430 | Locked: Unlocked |
| | 431 | Foreign State: Foreign |
| | 432 | Foreign Secure: Drive is not secured by a foreign lock key |
| | 433 | Device Speed: 6.0Gb/s |
| | 434 | Link Speed: 3.0Gb/s |
| | 435 | Media Type: Hard Disk Device |
| | 436 | [...] |
| | 437 | }}} |
| | 438 | The disk drive identified as ![252:4] ([enclosureid:slotnumber]) is currently 'Unconfigured(bad)'. |
| | 439 | |
| | 440 | Make the drive online again: |
| | 441 | {{{ |
| | 442 | server:~# megacli -PDMakeGood -PhysDrv[252:4] -a0 |
| | 443 | Adapter: 0: EnclId-252 SlotId-4 state changed to Unconfigured-Good. |
| | 444 | }}} |
| | 445 | |
| | 446 | The controller will now recognise the disk as being a "foreign" one. It means it has detected some RAID informations on it, and thus, considers it as a disk being part of an array that may be imported into current controller configuration.[[BR]] |
| | 447 | |
| | 448 | We will now ask the controller to scan for foreign configuration and drop it: |
| | 449 | {{{ |
| | 450 | server:~# megacli -CfgForeign -Scan -a0 |
| | 451 | There are 1 foreign configuration(s) on controller 0. |
| | 452 | |
| | 453 | server:~# megacli -CfgForeign -Clear -a0 |
| | 454 | Foreign configuration 0 is cleared on controller 0. |
| | 455 | }}} |
| | 456 | |
| | 457 | The disk should now be available for getting back into the array.[[BR]] |
| | 458 | Let's check it: |
| | 459 | {{{ |
| | 460 | server:~# megacli -PDList -a0 |
| | 461 | [...] |
| | 462 | Enclosure Device ID: 252 |
| | 463 | Slot Number: 4 |
| | 464 | [...] |
| | 465 | Firmware state: Unconfigured(good), Spun Up |
| | 466 | Foreign State: None |
| | 467 | [...] |
| | 468 | }}} |
| | 469 | |
| | 470 | We now need to figure out how that disk was identified inside the RAID array: |
| | 471 | {{{ |
| | 472 | server:~# megacli -CfgDsply -a0 |
| | 473 | [...] |
| | 474 | DISK GROUPS: 1 |
| | 475 | Number of Spans: 1 |
| | 476 | SPAN: 0 |
| | 477 | Span Reference: 0x01 |
| | 478 | Number of PDs: 4 |
| | 479 | Number of VDs: 1 |
| | 480 | Number of dedicated Hotspares: 0 |
| | 481 | Virtual Disk Information: |
| | 482 | Virtual Disk: 0 (Target Id: 1) |
| | 483 | [...] |
| | 484 | |
| | 485 | Physical Disk: 2 |
| | 486 | |
| | 487 | Physical Disk: 3 |
| | 488 | Enclosure Device ID: 252 |
| | 489 | Slot Number: 5 |
| | 490 | Device Id: 4 |
| | 491 | [...] |
| | 492 | }}} |
| | 493 | |
| | 494 | Here is what's important here: |
| | 495 | |
| | 496 | ''Span Reference: 0x01'' is the number of the array (strip the 0x0 part).[[BR]] |
| | 497 | We can see that ''Physical Disk: 2'' has no information, which means the drive is missing.[[BR]] |
| | 498 | |
| | 499 | Now we have all we need to add the disk back into the array. |
| | 500 | |
| | 501 | Get the disk [252:4] back into array 1, as disk 2: |
| | 502 | {{{ |
| | 503 | server:~# megacli -PdReplaceMissing -PhysDrv[252:4] -array1 -row2 -a0 |
| | 504 | Adapter: 0: Missing PD at Array 1, Row 2 is replaced |
| | 505 | }}} |
| | 506 | |
| | 507 | And finally start rebuilding: |
| | 508 | {{{ |
| | 509 | server:~# megacli -PDRbld -Start -PhysDrv[252:4] -a0 |
| | 510 | Started rebuild progress on device(Encl-252 Slot-4) |
| | 511 | }}} |