Skip to content

Instantly share code, notes, and snippets.

@tomislacker
Created March 12, 2014 16:16
Show Gist options
  • Save tomislacker/9510295 to your computer and use it in GitHub Desktop.
Save tomislacker/9510295 to your computer and use it in GitHub Desktop.
MegaRAID Failed Drive Replacement
###
# Marking the drive at enclosure 32, slot 0, on adapter 0 as bad and preparing for removal
###
# 1) Tell the controller that we'd like to take this disk offline
MegaCli64 -PDOffline -PhysDrv [32:0] -a0
# 2) Tell the controller that this disk will be missing and we're ok with that.
MegaCli64 -PDMarkMissing -PhysDrv [32:0] -a0
# 3) Tell the controller to sping down the disk for removal
MegaCli64 -PDPrpRmv -PhysDrv [32:0] -a0
# Drive was removed
# New drive inserted (still at slot 0)
# Since auto rebuilding is enabled, the process has started already.
MegaCli64 -PDRbld -ShowProg PhysDrv [32:0] -a0
# Command Documentation:
# - http://www.watters.ws/mediawiki/index.php/RAID_controller_commands
# - https://calomel.org/megacli_lsi_commands.html
# - http://thatlinuxbox.com/blog/article.php/lsi-megaraid-megacli
# - http://erikimh.com/megacli-cheatsheet/
# - http://hwraid.le-vert.net/wiki/LSIMegaRAIDSAS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment