Chris Dennis wrote (a long time ago):
> Hello folks
>
> I'm after some advice about managing a RAID array.
>
> It's a simple system: Debian running on a server with two 120GB drives
> in a RAID1 array. There are two RAIDed partitions: /dev/sda1 and
> /dev/sdb1 form /dev/md0 (where / lives), /dev/sda3 and /dev/sdb3 form
> /dev/md2 (where /data lives). (There's a swap partition on each drive too).
>
> The server suffered a hiccup, so one drive was removed to allow the data
> to be copied off it while I sorted out the problem, which has included
> updating Debian in various ways. Now I want to replace the second
> drive, and resynchronise the disks.
>
> I've found lots of instructions for replacing a *failed* drive, but I
> want to be sure the following will work in this situation:
>
> 0) (the second drive has already been physically removed)
> 1) mdadm /dev/md0 -r /dev/sdb1 # remove the absent drive from the array
> 2) reinstall the second drive
> 3) mdadm /dev/md0 -a /dev/sdb1 # replace it
> 4) watch as mdadm magically turns the second partition into a mirror
> of the first.
> 5) repeat for the other partition
>
> Will this work? Will mdadm know that the second drive is out of date,
> and make it match the first one? Or do I have to completely blank the
> second drive to make mdadm think it's a brand-new one?
>
> cheers
>
> Chris
>
Just to confirm, it did all work as expected. Except that I didn't need
step 1): 'mdadm --detail /dev/md0' already shows the second drive as
'removed'. Apparently the physical removal of the drive is enough for
mdadm to conclude that it has indeed been '--remove'd from the array.
Just as well really.
And 'watch cat /proc/mdstat' is a convenient way to watch the array
being rebuilt (if there's nothing better on TV).
cheers
Chris
--
Chris Dennis cgdennis@???
Fordingbridge, Hampshire, UK