How to recover failed RAID device?

General support questions including new installations
Posts: 27
Joined: 2009/11/05 14:01:14
Location: Toronto, ON

How to recover failed RAID device?

Postby amlife » 2009/11/10 21:32:31

If you are happen to have a failed hard drive on your software RAID array, follow the following steps to successfully reconstruct the data on new drive.

in my case I had RAID 1 Array, and one of the drives ^&*( up, I had to buy new HDD.

# cat /proc/mdstat

Letter F will show next to the failed device.

Personalities : [raid1]
md0 : active raid1 sdc[1] sdb[2](F)
8388544 blocks [2/1] [_U]


1. use -r option to remove the device from the RAID Array.

# mdadm /dev/md0 -r /dev/sdb

mdadm: hot removed /dev/sdb

2. Insert your new HDD to the system, then use -a option to add your new drive to the RAID Array.

# mdadm /dev/md0 -a /dev/sdb

mdadm: re-added /dev/sdb

3. Watch your progress using watch cat /proc/mdstat

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb[0] sdc[1]
8388544 blocks [2/1] [_U]
[>....................] recovery = 4.3% (366592/8388544) finish=5.8min speed=22912K/sec

Good Luck!