[Nottingham] LVM and load balancing and ReiserFS

Duncan John Fyfe djf at star.le.ac.uk
Sat Oct 27 22:31:02 BST 2007


On Sat, 2007-10-27 at 12:19 -0700, Charles Samuels wrote:
Out of curiosity, why is LVM so popular? Software RAID on linux (md) is really 
> easy to use and incredibly reliable as well, and it also can do striping and 
> mirroring.
> 

Historically (I haven't looked at recent updates) you could not
partition a software RAID device.  Putting LVM2 on top of the RAID
device allows you to do just that.  It also makes expanding any of those
partitions easier just like when adding a disk to a single disk desktop.

Given something like this (where hda could be a udev renamed RAID
device :) :
	/dev/hda
	/dev/hda1	/root
	/dev/hda2	/home
	/dev/hda3	swap

How do you expand /home ? 
If hda2 is an LVM2 logical volume we can pop a shiny new disk into the
machine, configure it into LVM2 as appropriate and expand the logical
volume (and resize the filesystem) onto it.

In other words it is not LVM2 vs RAID but LVM2 with RAID which makes
RAID more future proof for some setups (particularly desktops).

PS.  If you do (hard or soft) RAID + LVM2 make sure your blocks are
aligned ! Having an LVM2 block span underlying RAID blocks is a recipe
for poor performance (to read 1 LVM2 block you need to read 2 RAID
blocks).  Sometimes it is better to offset partitions slightly to avoid
mismatched blocks.

PPS.  Stacking Software RAID + LVM2 + XFS is notorious for going belly
up on kernels configured with 4K stacks (Redhat definitely, maybe
others).

Have fun,
Duncan
> Charles
> _______________________________________________
> Nottingham mailing list
> Nottingham at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/nottingham




More information about the Nottingham mailing list