[mythtv-users] LVM RAID 5 partition schemes

David myth at dgreaves.com
Thu Apr 7 08:58:45 UTC 2005


Milan Andric wrote:

>Newbie is getting a fuzzy signal here.  Can someone please confirm that
>using RAID 5 and LVM one cannot grow a filesystem by adding
>a new disk/partition?  
>  
>
It's never that easy I'm afraid.

Some terms:
A hard disk has lots of data blocks so it's called a block device.

LVM creates 'volumes' (cf partitions) on top of multiple block devices.
It doesn't do raid5 so, on it's own it doesn't offer raid5 redundancy.
It's easy to 'grow' lvm volumes.


md provides a virtual block device by RAIDing other block devices.
It's hard to grow a raid5 md device.
It can be done in only 3 ways (AFAIK):
1 backup, destroy, rebuild bigger and restore
2 use raidreconf (not 100% succesful - gulp)
3 use EVMS (not 100% succesful - but supposedly much better than raidreconf)

You can grow an lvm on top of a raid5 by creating another raid5 device 
and growing the lvm onto it.

If you just grow the lvm onto another disk as Jim Turpin suggested then 
if that single disk fails you lose the entire lvm - thus removing the 
benefit of doing raid5 anyway.


Finally, there is a complex idea suggested by Dan Christensen:

Create multiple partitions on each device:
sda1,sda2,sda3,sda4
sdb1,sdb2,sdb3,sdb4
etc

create 1 raid5 device for each partition
md0=sda1+sdb1+sdc1
md1=sda2+sdb2+sdc2

finally lvm all these together.

now to add a drive you must:
* add a backup device to the lvm
for each md device
 * lvm move the blocks of 1 md device to a backup device
 * remove md device from lvm
 * destroy + rebuild the md device
 * add back to lvm
 * lvm move the blocks of the backup device
* remove backup device from lvm


So, in summary, you *can* grow a RAID5 device - but it's hard.
If you think you will want to grow it I'd suggest starting with EVMS - 
it's not that hard to use if you spend some time reading their docs. 
Dan's solution (proper credit!) is probably the safest but is time 
consuming and possibly human-error prone.

David




More information about the mythtv-users mailing list