Zach Burlingame
Programming, Computers, and Other Notes on Technology

HOWTO: Rebuild a Software RAID 5 Array After Replacing a Disk

How to rebuild a software RAID 5 array after replacing a failed hard disk on CentOS linux.

# File: rebuild_RAID5.notes
# Auth: burly
# Date: 2005/08/09
# Ref: 
# Desc: Rebuild a degraded RAID 5 array w/ a new HDD

# Assumptions: 
	Failed drive is /dev/sda
	Good drives are /dev/sdb, /dev/sdc
	RAID array(s) are /dev/md3
	
# Copy the partition table from one of the existing
# drives over to the new drive
sfdisk -d /dev/sdb | sfdisk /dev/sda

# Rebuild the array
mdadm --manage --add /dev/md3 /dev/sda1

# Check mdstat for progress
watch -n 60 cat /proc/mdstat

	md3 : active raid5 sda[3] sdc1[1] sdb1[0]
	      490223104 blocks level 5, 128k chunk, algorithm 2 [3/2] [UU_]
	      [>....................]  recovery =  0.1% (380160/245111552) finish=64.3min speed=63360K/sec

# That's it!

One Response to “HOWTO: Rebuild a Software RAID 5 Array After Replacing a Disk”

  • Fabulous, what a web site it is! This weblog presents valuable information to us, keep it up.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    *