MegaRAID SAS CLI rebuild

*Sigh* So clearly is the season to be shelling out drives like they are going out of fashion.

I have gone into some details previously on installing megaraidsas cli on Ubuntu, and turning the alarm off on MegaRAID SAS from the CLI (as the damned thing will turn it back on again as it initialises – even if you have gone into their “web bios” (oh how I hate this horrid HORRID interface) and turned it off).

So lets assume a few things to start with:

  • megacli and megaclisas-status are installed and working;
  • You have a poorly drive that is offline;
  • You want to rebuild that drive;
  • megaclisas-status is showing you this and you have the number in the [nn:nn] for it.

So – what are the chances, we are both here. Alarm off. Tools at the ready.

DO NOT BE TEMPTED TO PUT THE DRIVE ONLINE

This is a bad idea as it puts it slap back in the array – irrespective of data being valid or otherwise. “Thanks” – but no thanks.

So here are some commands you are going to find useful. It assumes you have one enclosure – so I am using -aALL here. I have one enclosure (number 13 for a reason I am yet to fathom) – if you have more than one – enumerate them and -a then the number.

Rebuild an Offline Drive

root@bob:~# megacli -PDRbld -Start -PhysDrv [13:11] -aAll

Started rebuild progress on device(Encl-13 Slot-11)

Exit Code: 0x00

Take a Drive Offline

root@bob:~# megacli -PDOffline -PhysDrv [13:11] -aAll

Drive Offline (Encl-13 Slot-11)

Exit Code: 0x00

Make a Bad Drive Good

root@bob:~# megacli -PDMakeGood -PhysDrv [13:11] -aAll

Drive Goes Back in and Thinks it is Foreign

root@bob:~# megacli -PDMakeGood -PhysDrv [13:11] -aAll

root@bob:~# megacli -CfgForeign -Clear -aAll

root@bob:~# megacli -PDHSP -Set -PhysDrv [13:11] -aAll

Show Status

root@bob:~# megaclisas-status
— Controller information —
— ID | H/W Model | RAM | Temp | BBU | Firmware
c0 | LSI MegaRAID SAS 9260-8i | 512MB | N/A | Absent | FW: 12.9.0-0037

— Array information —
— ID | Type | Size | Strpsz | Flags | DskCache | Status | OS Path | CacheCade |InProgress
c0u0 | RAID-1 | 465G | 64 KB | ADRA,WT | Enabled | Optimal | /dev/sda | Type : Read Only |None
c0u1 | RAID-6 | 21826G | 64 KB | ADRA,WB | Enabled | Partially Degraded | /dev/sdb | Type : Read Only |None

— Disk information —
— ID | Type | Drive Model | Size | Status | Speed | Temp | Slot ID | LSI Device ID
c0u0p0 | HDD | WD-WMAYP123456WDC WD23456YX-01WERA0 01.01S01 | 465. Gb | Online, Spun Up | 3.0Gb/s | N/A | [13:0] | 11
c0u0p1 | HDD |WD-WMAYP123456WDC WD23456YX-01WERA0 01.01S01 | 465. Gb | Online, Spun Up | 3.0Gb/s | N/A | [13:1] | 12
c0u1p0 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:2] | 16
c0u1p1 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 3.0Gb/s | N/A | [13:3] | 17
c0u1p2 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:4] | 18
c0u1p3 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:5] | 19
c0u1p4 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:6] | 20
c0u1p5 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:7] | 21
c0u1p6 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:8] | 22
c0u1p7 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 3.0Gb/s | N/A | [13:9] | 23
c0u1p8 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:10] | 24
c0u1p9 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Rebuilding (0%) | 6.0Gb/s | N/A | [13:11] | 25
c0u1p10 | HDD | W111EFW1ST2000DM222-1CH164 CC24| 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:12] | 26
c0u1p11 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:13] | 27
c0u1p12 | HDD | W111EFW1ST2000DM222-1CH164 CC24 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:14] | 14
c0u1p13 | HDD | W111EFW1ST2000DM222-1CH164 CC244 | 1.818 TB | Online, Spun Up | 6.0Gb/s | N/A | [13:15] | 15
There is at least one disk/array in a NOT OPTIMAL state.

Full Manual

https://www.cisco.com/c/dam/en/us/td/docs/unified_computing/ucs/3rd-party/lsi/mrsas/userguide/LSI_MR_SAS_SW_UG.pdf

Handy Cheat Sheet of MegaCLI Commands

Lots out there with CaSe in their megacli commands – you can lose that for the binary – however, looks like the switches are sensitive (bless). This one (also from Cisco) – pretty much nailed on:

https://supportforums.cisco.com/document/62901/megacli-common-commands-and-procedures

LSI Processor used in Dell PERC 7xx

This card – or the smarts therein are used by the DELL PERC730 (this case an R430).

Their guide can be found here:

https://www.dell.com/support/article/uk/en/ukbsdt1/sln292232/extracting-the-raid-controller-logs-via-megacli?lang=en

2 Responses to “MegaRAID SAS CLI rebuild

  • “OMG, there has been a change of status: ALARM! ALARM! ” —
    https://zerosandones.co.uk/lsimegaraid-sas-alarm-off/

    That could really get on a guy’s nerves >_<

  • And there is more…. (as I am fed up of cross referencing)

    What is the current rebuild rate:

    megacli -AdpGetProp RebuildRate -a0

    What would I like the current rebuild rate to be:

    megacli -AdpSetProp RebuildRate 60 -a0

    How long is this likely to take, as this is RAID6 but we don’t need slow for longer than we possibly can have:

    megacli -PDRbld -ShowProg -PhysDrv [32:1] -aALL

Leave a Reply

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

%d bloggers like this:
Skip to toolbar