Re: [Hampshire] RAID advice please

Top Page

Reply to this message
Author: Chris Dennis
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] RAID advice please
Andy Smith wrote:
> On Tue, Feb 13, 2007 at 05:41:01PM +0000, Chris Dennis wrote:
>> 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).
>
> For future consideration what I normally do is have a /boot as /dev/md0
> RAID-1, a / as /dev/md1 RAID-1 or -10, swap /dev/md2 RAID-1 or -10
> and then everything else is /dev/md3 LVM physical volume with
> logical volumes for whatever other filesystems I need.


Why have swap on RAID1? Doesn't that just double the amount of disk
access needed to do the swapping?
>
> /boot needs to be RAID-1 so that grub can cope with it.
>
> I don't like having / inside LVM because it means I need an
> initrd/initramfs and I don't like 'em. In any case with everything
> else inside LVM, /boot and / are very small. Typically 200M and
> 500M respectively.


LVM is something I still haven't explored.

>
>> 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?
>
> It will work, as md will have updated the event counters on the
> devices that remained in active use, and so will know that the other
> devices are older.


I thought it must work something like that, but I wanted a bit of
reassurance.
>
> You have backups anyway, right?


Of course. :)
>
> Cheers,
> Andy
>
>


Thanks Andy. I'll give that a go. And if it all goes horribly wrong...

cheers

Chris
-- 
Chris Dennis                                  cgdennis@???
Fordingbridge, Hampshire, UK