Hdisk removal for MegaCli

  • June 14, 2022
  • 0 Comments

In the event that you need to replace a hdisk (be in in failed/degraded/online state) in MegaRaid configuration, this is the steps:

1. Find out the drive layout 

# MegaCli -pdlist -a0 

the command will informed the "Enclosure Device ID" and  "Slot Number" , to be used on subsequent command


2. Set alarm to silence and turn off any locate  (im having 6 drive as example below)

# MegaCli -AdpSetProp -AlarmSilence -aALL

# MegaCli -PdLocate -stop -physdrv[252:0] -aALL

# MegaCli -PdLocate -stop -physdrv[252:1] -aALL

# MegaCli -PdLocate -stop -physdrv[252:2] -aALL

# MegaCli -PdLocate -stop -physdrv[252:3] -aALL

# MegaCli -PdLocate -stop -physdrv[252:4] -aALL

# MegaCli -PdLocate -stop -physdrv[252:5] -aALL


3. Turn on locate for the drive that you want to replace (sometimes this does not turn on light physically)

# MegaCli -PdLocate -start -PhysDrv [252:3] -aALL

4. Set it offline

# MegaCli -PDOffline -PhysDrv [252:3] -a0

At this stage, it's safe to ask the onsite engineer to remove the drive.


At this point, if you need to "rebuild" using the same disk, run the following. The command will trigger rebuild process immediately as the disk become "discovered"

# MegaCli -PDMarkMissing -PhysDrv [252:3] -a0 


5. Monitor the progress 

# MegaCli -pdrbld -showprog -physdrv [252:3] -a0

How helpful was this article to you?

Posting has been disabled.