[lug] LVM and disk failure

Dan Ferris dan at usrsbin.com
Sat Jan 7 22:19:42 MST 2006


Let me give you some examples....

First is with 2 disks.  You can run with 2 seperate disks (assume
/dev/hda and /dev/hdb) you can build some LVM volumes that combine those
disks in some way.  If one disk crashes you loose your data.  LVM does
not provide fault tolerance.

Second is also with 2 disks.  You can make a RAID 0 (stripe set) that
combines both disks into a RAID array (/dev/md0).  You can then use LVM
on top of that RAID array to create several logical volumes that can be
resized up to the size of the stripe set.  I don't remember enough about
Linux RAID offhand to know if you can add disks to a RAID 0 array
without having to redo everything.  But if you wanted to add another
disk, you could add it as a standalone disk and combine it into the
LVM.  You now have a RAID 0 stripe set and a seperate drive in your LVM
setup.  If you loose a disk, your data goes bye bye.  RAID 0 is not
fault tolerant and LVM has no fault tolerance.

Third is 4 disks.  Assume you had 4 SATA drives.  You want fault
tolerance, so you make 2 RAID 1 sets (this is an example so bear with
me), RAID 1 is mirroring.  You can then combine both mirrors (/dev/md0
and /dev/md1) with LVM.  If you loose a drive your data was mirrored,
you can replace the drive and rebuild the mirror.   If I add 2 more
drives, I can mirror them and then extend my LVM volume onto the mirror.

Fourth is with 4 disks.  Assume again 4 SATA drives.  You can combine
these drives into a RAID 5 array.  You can then make an LVM volume on
top of that RAID 5 array.  You can size the volumes to your hearts
content up to the size of the RAID array.  You can add extra disks to
the LVM, but they might not be RAID (they can be anything you want).  If
a disk in the RAID 5 array crashes you replace it and keep going.  If
you had a non fault tolerant disk in your LVM that died, then you loose
your data.

Lastly is what I do at work.  I have 2 1.0 TB external SCSI RAID 5
arrays with 7 disks and 1 1.5 TB external SCSI RAID 5 array.  All three
of these arrays are combined via LVM to give me a 3.0 TB logical
volume.  If I loose a disk, I can replace it and keep right on going.  I
cannot easily increase the size of the RAID units, but I CAN add more
RAID units to my LVM.

The point is that LVM doesn't care what kind of device you are using or
about fault tolerance, it just gives you a way of putting all your
storage together in one place.  It's a higher level view of your storage
than just RAID.

Hope that helps.

Dan

Daniel Webb wrote:

>I've been Googling for the answer to this and failing, so:
>
>What happens when you have a 2-disk LVM volume group and disk 1 fails?
>Obviously this will depend on the filesystem you put on top of the volume,
>right?  So which filesystems will recover gracefully if you chop them in half
>like that?
>
>It's a little disturbing that in all the documentation I've read on LVM this
>is never mentioned, and yet it seems to destroy the main purpose of lvm: to be
>able to add and remove disks to a volume easily.  Each physical volume you add
>makes it that much more likely that you'll lose the whole thing.  Sure, you
>can put it on top of RAID, but now you lost your size flexibility because RAID
>isn't so easy to resize (or is it?).  The snapshots feature is nice, that's
>all I'll use it for until I find a satisfactory answer to this question.
>
>I also was checking out evms and it looks very interesting.  Any impressions
>from those who have used it?  Is it stable/reliable?  I didn't see anything in
>their docs either about recovering when one disk in a volume fails.
>
>_______________________________________________
>Web Page:  http://lug.boulder.co.us
>Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>
>
>  
>



More information about the LUG mailing list