LVM and RAID

Mike Reinehr cmr
Thu Jun 16 11:30:46 PDT 2005


On Thursday 16 June 2005 10:55 am, Roger Oberholtzer wrote:
> On Thu, 2005-06-16 at 16:16, Mike Reinehr wrote:
> > On Thursday 16 June 2005 02:10 am, Roger Oberholtzer wrote:
> > > I have just been playing with Linux LVM and am quite impressed. It
> > > seems too simple. At least when set up from SUSE 9.2. I have a few
> > > questions for anyone who has worked with this:
> > >
> > > 1. Are there any gotchas when using a LVM on different distros? Aside
> > > from the fact that the config may be different? Anything in the LVM
> > > itself? If I set up a LVM on, say, SUSE, and later move to something
> > > else (I am not considering this - but I want to know), could I expect
> > > difficulties?
> > >
> > > 2. Can I set up a LVM that is also RAID? That is, having a file system
> > > with oodles of storage is fine, but what about failure protection?
> >
> > Roger,
> >
> > ??????LVM on top of RAID works like a charm. What I have gotten from
> > other lists, and agree with, is to define three md RAID partitions:
> >
> > ??????/dev/md0????????RAID1???/boot???ext2????(using /dev/sda1 &
> > /dev/sdb1) /dev/md1????????RAID1???/???????????????ext3????(using
> > /dev/sda2 & /dev/sdb2) /dev/md2????????RAID1???LVM
> > PV??---?????????????(using /dev/sda3 & /dev/sdb3)
> >
> > uses sizes you feel adequate for / & /boot & then use all the rest for
> > md2, with one VG on the single PV. Then divide up your VG with any all
> > remaining file systems (swap, /home, /var, /usr, etc.), as you please.
> > Remember to set the partition (/dev/sda... ) types as Linux RAID, so they
> > will be auto-detected at boot and don't forget to include md support &
> > device mapper support in your kernel.
>
> Wow.
>
> When I make the partition for use with LVM, I set the partition to Linux
> LVM, and tools look for these partition types when I make the VG. But if
> I build this on top of RAID, the partition will be Linux RAID instead?
>
> I need to draw a map of the layers so I can see what each one expects.
>
> But I see that I (obviously) need to get RAID working first.

Here's a copy of one of my fstab's. I do not have a separate boot partition as described above,
but do have an spare root partition (/dev/md1):

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc                    /proc            proc      defaults        0       0
/dev/md0            /                   ext3     defaults,errors=remount-ro 0       1
/dev/vg0/swaplv  none             swap    sw              0       0
/dev/vg0/homelv /home           ext3     defaults        0       2
/dev/vg0/tmplv   /tmp             ext2      defaults        0       2
/dev/vg0/usrlv    /usr               ext3      defaults        0       2
/dev/vg0/varlv    /var               ext3      defaults        0       2
/dev/md1          /mnt/md1       ext3     defaults,noauto 0       0
/dev/vg0/swlv    /southware     ext3     defaults        0       0
/dev/hda           /media/cdrom iso9660 ro,user,noauto  0       0
/dev/fd0           /media/floppy   auto      rw,user,noauto  0       0

On boot, my i2o drivers register my hard drivers, followed immediately by the
md drivers, followed immediately by device-mapper.

Not only do you have the redundancy of RAID, but you gain the ability to resize
your partitions, add new ones, drop old ones, etc. easily.

Cheers!

cmr

PS	And, I'm proof that it's very easy to set up!
-- 
Debian 'Sarge': Registered Linux User #241964

"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC


More information about the Linux-users mailing list