Rebuild Degraded Megaraid Disk

Rebuilding a Degraded Megaraid disk.

 

What we can do if we get below nagios alert and rebuild did not start automatically?

CRITICAL – Smart or status problems, or something else screwed up.

 

You can check the status of disk rebuild by below command.

#/opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -showprog -physdrv [252:0] -a0

 

We can follow below steps to rebuild the disk in MegaRaid if it did not start automatically.

 

Check with Enclosure/slot drive is degraded. List all drive info to identify slot:

#MegaCli  -pdlist -a0

 

You will see something like this

On slot 0 in enclosure 252 disk has been identified, you can list single drive

 

# MegaCli -pdinfo -PhysDrv [252:0] -a0

                                 

Adapter #0

 

Enclosure Device ID: 252

Slot Number: 0

Enclosure position: N/A

Device Id: 11

 

Raw Size: 419.186 GB [0x3465f870 Sectors]

Non Coerced Size: 418.686 GB [0x3455f870 Sectors]

Coerced Size: 418.163 GB [0x34453800 Sectors]

Sector Size:  0

Logical Sector Size:  0

Physical Sector Size:  0

Firmware state: Unconfigured(bad)

Device Firmware Level: 0006

 

Make the drive ‘Unconfigured(good)’:

# MegaCli -PDMakeGood -Physdrv [252:0] -a0

#MegaCli -pdinfo -PhysDrv [252:0] -a0

 

Enclosure Device ID: 252

Slot Number: 0

Enclosure position: N/A

Device Id: 11

 

Raw Size: 419.186 GB [0x3465f870 Sectors]

Non Coerced Size: 418.686 GB [0x3455f870 Sectors]

Coerced Size: 418.163 GB [0x34453800 Sectors]

Sector Size:  0

Logical Sector Size:  0

Physical Sector Size:  0

Firmware state: Unconfigured(good)

Device Firmware Level: 0006

This Drive is Foreign

 

We will need to Clear the ‘foreign Config’;

#MegaCli -cfgforeign -clear -a0

 

Once ‘Foreign’ configuration is cleared set drive to hotspare.

#Megacli -pdhsp -set -physdrv [252:0] -a0

Adapter: 0: Set Physical Drive at EnclId 252 SlotId 0 as Hot Spare Success

 

We will Notice below by listing the info of the drive, it is automatically start to rebuild

a this point.

#MegaCli -pdinfo -PhysDrv [252:0] -a0

 

# MegaCli -showsummary -a0

Connector          : Port 0 – 3<Internal>: Slot 0

               Vendor Id          : SEAGATE

               Product Id         : ST3450856SS    

               State              : Rebuild

               Disk Type          : SAS,Hard Disk Device

               Capacity           : 418.163 GB

               Power State        : Active

               Operation In Progress : Rebuild

 

The status of the rebuild  can be checked

 

#/opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -showprog -physdrv [252:0] -a0

 

If the drive  fails to start rebuilding after being set as a hotspare, the

rebuild process can be manually started.

 

#Megacli -pdrbld -start -physdrv [252:0] -a0

 

Please note that this procedure will not recover a drive that are truly failed, If the drive can’t be

added back to the array with the procedure the drive will need to be replaced.

 

After rebuild completes you will see  disk in Active state.

 

Connector          : Port 0 – 3<Internal>: Slot 0

               Vendor Id          : SEAGATE

               Product Id         : ST3450856SS    

               State              : Online

               Disk Type          : SAS,Hard Disk Device

               Capacity           : 418.163 GB

               Power State        : Active

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s