[Nottingham] LVM - some more questions, please

Peter Chang Peter.Chang at nottingham.ac.uk
Mon Nov 26 02:02:24 GMT 2007


Edward,

Read up on LVM in the how-to: http://tldp.org/HOWTO/LVM-HOWTO/
The main caveat is that it seems that you can't have /boot on a LVM 
logical volume because grub can't read it.

It sounds like you want to mirror a pair of drives using the md driver but 
in a split manner. That is, you setup both drives into a total of four 
partitions (sd[ab][12]), configure two md RAID-1 devices. Then mark the 
second new partition as a LVM container and create a physical volume (PV) 
on it. Put an ext3 filesystem (FS) on to the first (small) md partition 
for use as /boot.

Now you want one volume group (VG) containing that single PV which you 
then divide up into at least three logical volumes (LV) for your OS 
partition, swap and data. Stick on the filesystem of your choice onto the 
LVs for OS (as /) and data.

If you want to add more storage, you can add more PVs to the VG. Note the 
storage can be any block device (not necessarily a mirrored partition). 
The steps are prepare the extra partition (after any md configuration) as 
a PV, add to the VG, extend the existing data LV and, finally, resize the 
FS.

> I think I can install LVM as the filesystem on my data partition and any 
> changes, additions of partitions/folders or even moving to larger drives in 
> the future would be handled there with boot remaining mostly unchanged and 
> using GRUB to handle booting when swapping drives into and out of the mirror 
> (the swapped drive becoming a stored backup? I never anticipate failures!).

GRUB handles the RAID1 /boot partition.

> Wadda ya think?
>
> My questions come from:
>
>  1. What is the best way to handle the swap and the other OS
>     partitions like var, usr, home and, of course, data in this scenario?

Stick them all on one VG. You can decide how to split that VG into LVs for 
as many FS as you want.

>  2. And am I right in thinking this is a viable setup?

Yep.

>  3. As a start I set up a boot partition on one drive and everything
>     else into an LVM partition and installed Lenny, it all works
>     great, only a test on one drive so... so far so good!

This isn't a question!

hth
  Peter


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the Nottingham mailing list