Fix Raid on LSI controllers when a disk is shown as ubad

This can be done with both megacli and storcli.

Since the way forward is storcli this how to will be based on that.

 

storcli /c0 show all

 

Drive Information :
=================
 
-------------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model                  Sp 
-------------------------------------------------------------------------------
8:1       7 Onln   0  465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U  
8:2       6 Onln   0  465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U  
8:3       5 Onln   0  465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U
.
.
8:14      4 UBad   - 223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3    U  
-------------------------------------------------------------------------------

 

Say 8:14 is marked a Ubad. (Unconfigured bad)

storcli /c0 /e8 /s14 set good

storcli /c0 show all

It should now have the disk marked as Ugood ( Unconfigured Good)

-------------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model                  Sp 
-------------------------------------------------------------------------------
8:1       7 Onln   0  465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U  
8:2       6 Onln   0  465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U  
8:3       5 Onln   0  465.25 GB SATA HDD N   N  512B WDC WD5003ABYX-01WERA1 U
.
.
8:14      4 uGood  F 223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3    U  
-------------------------------------------------------------------------------

storcli /c0 -/fall show

 

Controller = 0
Status = Success
Description = Operation on foreign configuration Succeeded
 
 
FOREIGN CONFIGURATION :
=====================
 
----------------------------------------
DG EID:Slot Type State       Size NoVDs 
----------------------------------------
 F -        Cac0 Frgn  223.062 GB     1 
----------------------------------------
 
NoVDs - Number of VDs in disk group|DG - Diskgroup
Total foreign drive groups = 1

 

This would show an external configuration which needs clearing.

Now we need to clear the config data from the previous RAID conf cached on the disk.

 

storcli /cx /fall import

 

This will clear the foreign config and start the rebuild.

 

To follow the rebuild :

 

storcli /c0 /e8 /sall show rebuild 
Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.
———————————————————
Drive-ID Progress% Status Estimated Time Left
———————————————————
/c0/e8/s0 – Not in progress –
/c0/e8/s1 – Not in progress –
/c0/e8/s2 – Not in progress –
/c0/e8/s3 – Not in progress –
/c0/e8/s4 – Not in progress –
/c0/e8/s5 – Not in progress –
/c0/e8/s6 – Not in progress –
/c0/e8/s7 – Not in progress –
/c0/e8/s8 – Not in progress –
/c0/e8/s9 – Not in progress –
/c0/e8/s10 – Not in progress –
/c0/e8/s11 – Not in progress –
/c0/e8/s12 – Not in progress –
/c0/e8/s13 – Not in progress –
/c0/e8/s14 93 In progress –
/c0/e8/s15 – Not in progress –
———————————————————

 

Or for one drive in particular:

 

storcli /c0 /e8 /s14 show rebuild

Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.
———————————————————————————————————-
Drive-ID          Progress% Status            Estimated Time Left
———————————————————————————————————-
/c0/e8/s14       93               In progress –
———————————————————————————————————-

 

That’s it.

 

[ NOTE : ]   Rebuild might take more than 1 day in default mode…. Just saying be patient.

 

nJoy 😉

MegaCLI Megaraid useful instructions

Recently I installed a server with a Supermicro SMC2108 RAID adapter, which is actually a LSI MegaRAID SAS 9260. LSI created a command line utility called MegaCLI for Linux to manage this adapter. You can download it from their support pages. The downloaded archive contains an RPM file. I installed mc and rpm on Debian with apt-get, and then extracted the MegaCli64 binary (for x86_64) to /usr/local/sbin, and the libsysfs.so.2.0.2 from the Lib_utils RPM to /opt/lsi/3rdpartylibs/x86_64/ (that’s the location where MegaCli64 looks for this library).

Here are some useful commands:

View information about the RAID adapter

For checking the firmware version, battery back-up unit presence, installed cache memory and the capabilities of the adapter:

# MegaCli64 -AdpAllInfo -aAll

View information about the battery backup-up unit state

# MegaCli64 -AdpBbuCmd -aAll

View information about virtual disks

Useful for checking RAID level, stripe size, cache policy and RAID state:

# MegaCli64 -LDInfo -Lall -aALL

View information about physical drives

# MegaCli64 -PDList -aALL

Patrol read

Patrol read is a feature which tries to discover disk error before it is too late and data is lost. By default it is done automatically (with a delay of 168 hours between different patrol reads) and will take up to 30% of IO resources.

To see information about the patrol read state and the delay between patrol read runs:
# MegaCli64 -AdpPR -Info -aALL

To find out the current patrol read rate, execute
# MegaCli64 -AdpGetProp PatrolReadRate -aALL

To reduce patrol read resource usage to 2% in order to minimize the performance impact:
# MegaCli64 -AdpSetProp PatrolReadRate 2 -aALL

To disable automatic patrol read:
# MegaCli64 -AdpPR -Dsbl -aALL

To start a manual patrol read scan:
# MegaCli64 -AdpPR -Start -aALL

To stop a patrol read scan:
# MegaCli64 -AdpPR -Stop -aALL

You could use the above commands to run patrol read in off-peak times.

Migrate from one RAID level to another

In this example, I migrate the virtual disk 0 from RAID level 6 to RAID 5, so that the disk space of one additional disk becomes available. The second command is used to make Linux detect the new size of the RAID disk.

# /usr/local/sbin/MegaCli64 -LDRecon -Start -r5 -L0 -a0
# echo 1 > /sys/block/sda/device/rescan

Create a new RAID 5 virtual disk from a set of new hard drives

First we need to now the enclosure and slot number of the hard drives we want to use for the new RAID disk. You can find them out by the first command. Then I add a virtual disk using RAID level 5, followed by the list of drives I want to use, specified by enclosure:slot syntax.

# MegaCli64 -PDList -aALL | egrep 'Adapter|Enclosure|Slot|Inquiry'
# MegaCli64 -CfgLdAdd -r5'[252:5,252:6,252:7]' -a0

View reconstruction progress

When reconstructing a RAID array, you can check its progress with this command.
# MegaCli64 -LDRecon ShowProg L0 -a0

(replace L0 by L1 for the second virtual disk, and so on)

Configure write-cache to be disabled when battery is broken

# MegaCli64 -LDSetProp NoCachedBadBBU -LALL -aALL

Change physical disk cache policy

If your system is not connected to a UPS, you should disable the physical disk cache in order to prevent data loss.

# MegaCli -LDGetProp -DskCache -LAll -aALL

To enable it (only do this if you have a UPS and redundant power supplies):

# MegaCli -LDGetProp -DskCache -LAll -aALL

More information

http://ftzdomino.blogspot.com/2009/03/some-useful-megacli-commands.html
https://twiki.cern.ch/twiki/bin/view/FIOgroup/DiskRefPerc
http://hwraid.le-vert.net/wiki/LSIMegaRAIDSAS
http://kb.lsi.com/KnowledgebaseArticle16516.aspx

 

attr: Frederick’s Blog

 

nJoy 😉