Re: [Hampshire] setting up software raid and LVM

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] setting up software raid and LVM

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x5734d100.hantslug.org.uk.24966': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Fri Jul 17 12:58:50 2009 BST
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Fri, Jul 17, 2009 at 11:49:12AM +0000, Philip Stubbs wrote:
> Ok, I need to get my head round RAID and LVM as I want to upgrade my
> home server. At the moment, my disks are configured as per the top
> part of this picture:-
> http://stuphi.co.uk/disk_layout.jpg
> I hope that makes sense. :-)
>
> md0 is used for / and md1 for /home
>
> As can be seen, if hdc dies, it should still work. If hda dies, it
> will not boot.
>
> What I want, from how I understand things, is represented by the
> bottom part of that image. So all of hda and hdc become part of a
> single RAID, and then LVM works on the resulting md0. Then I can
> create partitions as required in the resulting vg. Does this sound
> right?


Nearly. If you want to do it precisely that way, you will need to
use GRUB2 to boot, as GRUB1 doesn't understand RAID or LVM.

I would instead suggest having a small (512M or so) RAID-1 volume
at the start of both disks, containing /boot, from which you can
configure GRUB to load from one or other of the volumes. Then make the
rest of each disk as a separate RAID-1 volume used for LVM.

Note also that you'll have to use an initramfs/initrd for booting
your kernel. If you're using a kernel package provided by your
distribution, this won't be a problem, but if you build your own
kernels, you need to know this.

> I need to do this in a way that keeps my data. So I was going to
> remove hdc from the original array, set that up as hda in the new
> machine in a degraded array, with LVM etc. Once that is working, I was
> going to then move the old hda to be the new hdc in the new machine,
> boot with a rescue CD, and mount it as is so I can copy the data
> across. Then I create the single partition, and add it to the array.
>
> If I have gone way off track here, please let me know :-)


No, sounds more or less reasonable, given the caveats above about
booting.

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
      --- Great oxymorons of the world, no. 7: The Simple Truth ---