RepairDegradedRAIDArray
03 Dec 2008 04:23 UTC 2008338+0423 UTC

Repairing a degraded RAID1 array

First make sure that the array is really degraded. You can do this by typing cat /proc/mdstat at your command prompt. You should see lines that look like the following:

 
Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
      104320 blocks [2/2] [UU]

This shows a normal, working RAID1 array. The device /dev/md0 consists of two partitions /dev/sda1 and /dev/sdb1. If the device was "degraded" (i.e., not all of the partitions that are supposed to participate in the array actually function, the lines would look something like this:

 
Personalities : [raid1]
md0 : active raid1 sdb1[1] 
      104320 blocks [2/1] [_U]

Which shows tha there should be 2 devices participating the RAID array, but only 1 devices is active.

In order to add the missing device back to the RAID array, use the mdadm command:

 
$ sudo mdadm /dev/md0 -a /dev/sda1

This line says add the device /dev/sda1 to the RAID array device /dev/md0.

Questions

  • How do you know which devices are part of a given RAID array?

< DNR Mirror | System Administration | Windows PC Setup Checklist >

Page last modified on July 02, 2008, at 12:32 PM