Hardware RAID is a form of a RAID where processings are done by a hardware called RAID card.

Here we are dealing with a MegaRAID RAID controller and I am showing you how to replace faulty disk from the RAID controller without data loss.

The utility MegaCLI need to be installed on the server first.

First of all, we need to find out which disk has failed, for that, we need to check the status of the disk using the command.

MegaCli -PDList -aALL | grep Firmware state

Output

Firmware state: Online
Firmware state: Offline

From the output, we can understand that one of the disks is faulty and we need to replace the same. For replacing the disk, before removing the disk from the RAID controller we need to do some steps on the RAID controller using the MegaCLI utility.

  • Make the disk offline
  • Make the disk missing
  • Make the disk removal

For performing these three steps we need to know some details of the faulty disk, like Enclosure ID and slot number, the combination of these two value represents the correct disk.

We can get these values using the following command

MegaCli -PDList -aALL

Output

Adapter #0
Enclosure Device ID: 252
Slot Number: 0
Device Id: 4
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 238475MB [0x1d1c5970 Sectors]
Non Coerced Size: 237963MB [0x1d0c5970 Sectors]
Coerced Size: 237464MB [0x1cfcc000 Sectors]
Firmware state: Online
SAS Address(0): 0xb221c046788723f
Connected Port Number: 0(path0)
Inquiry Data: ATA ST3250620AS K 6QE1DRKL
 
Adapter #0
Enclosure Device ID: 252
Slot Number: 1
Device Id: 5
Sequence Number: 2
Media Error Count: 0
Other Error Count: 1
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 238475MB [0x1d1c5970 Sectors]
Non Coerced Size: 237963MB [0x1d0c5970 Sectors]
Coerced Size: 237464MB [0x1cfcc000 Sectors]
Firmware state: Offline
SAS Address(0): 0xb221c046788723f
Connected Port Number: 0(path0)
Inquiry Data: ATA ST3250620AS K 6QE1DRKL

The above output contains the details of all disk connected to the RAID controller (Details of all disks are grouped separately) and we need to find the faulty disk by checking the value of Firmware state as Offline.

Once you find the faulty disk, find out the Enclosure ID and slot number of the faulty disk. Once we have the values for Enclosure ID and slot number perform the following step.

Mark ofline
MegaCli -PDOffline -PhysDrv [252:1] -aALL
 
mark missing
MegaCli-PDMarkMissing -PhysDrv [252:1] -aALL
 
mark removal
MegaCli -PdPrpRmv -PhysDrv [252:1] -aALL

Now we can remove the disk from RAID controller.

Before replacing drives, make sure that the replacement disk is of the same type as the degraded drive and the capacity equal to or larger than the capacity of the degraded drive.

Nowadays all the hardware RAID controllers support hot-pluggable drives so we don’t need to power down the server for replacing the disk, you can remove the faulty drive while the server is running and attach the new one. The entire array activity will pause for 1 to 2 seconds while the new drive is initializing, once it is completed the rebuilding will start automatically.

[tagline_box backgroundcolor=”description=” shadow=”no” shadowopacity=”0.7″ border=”1px” bordercolor=”” highlightposition=”top” content_alignment=”left” link=”” linktarget=”_self” modal=”” button_size=”” button_shape=”” button_type=”” buttoncolor=”” button=”” title=”” description=”If you have any queries regarding how to replace failed drive in hardware RAID disk array using MegaCLI feel free to leave us a message and our representative will get back to you.

” margin_top=”50px” margin_bottom=”” animation_type=”slide” animation_direction=”left” animation_speed=”0.3″ class=”” id=””]

    [/tagline_box]