Re: [Hampshire] RAID advice please

Top Page
Author: Andy Smith
Date:  
To: hampshire
Subject: Re: [Hampshire] RAID advice please

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x57c22100.hantslug.org.uk.10089': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Tue Feb 13 18:26:47 2007 GMT
gpg: using DSA key 2099B64CBF15490B
gpg: Can't check signature: No public key
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.

/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.

> 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.

You have backups anyway, right?

Cheers,
Andy

--
http://bitfolk.com/ -- No-nonsense VPS hosting
Encrypted mail welcome - keyid 0x604DE5DB

My words are my own and do not represent Jacqui Caren.