LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   some unformal LVM and RAID questions -- (https://www.linuxquestions.org/questions/linux-software-2/some-unformal-lvm-and-raid-questions-742450/)

crispyleif 07-24-2009 07:37 AM

some unformal LVM and RAID questions --
 
I am about to do RAID + LVM for learning purposes, and after reading about I have a couple of questions left. I and do have googled.

If I understand correctly, lvm stripes physical volumes together as volume groups. Is this the same as doing a RAID 0 ?
I do understand the wonderful flexibility that lvm gives, I'm referring to the sripe part, ie:
is lvm on top of a raid 0 volume a "double" stripe ?

If doing a fresh install, is there some parts of the OS that I should NOT put on the Logical Volume ? Some say "/boot", some say not the entire "/".. which leaves "/home" for my part..although that's of course under "/".

Say I partition a HDD in 4 different partitions (this is for testing),
is striping those 4 partitions together better (for performance) than just making one big partition of the whole HDD and make that part of a logical volume ?

catkin 07-24-2009 08:26 AM

Hello crispyleif :)
Quote:

Originally Posted by crispyleif (Post 3618788)
[snip]
If doing a fresh install, is there some parts of the OS that I should NOT put on the Logical Volume ? Some say "/boot", some say not the entire "/".. which leaves "/home" for my part..although that's of course under "/".

Say I partition a HDD in 4 different partitions (this is for testing),
is striping those 4 partitions together better (for performance) than just making one big partition of the whole HDD and make that part of a logical volume ?

/boot cannot be on LVM because the bootloader is not LVM-capable and needs to load file(s?) from /boot to mount LVM volumes.

The / file system cannot be re-sized while it is mounted which means you have to boot from something else to re-size it. That pretty much negates all the advantages of having it on LVM (unless you're going to have a big / with /usr, /var /home and others on the same file system).

On balance, there's no benefit in putting swap on an LVM volume unless you are in an uptime-critical situation where you might want to move it from a failing disk without stopping the system.

Performance will be worse, not better, if an LVM volume comprises blocks from 4 different partitions on the same disk -- the heads will have to thrash around over the 4 partitions to find blocks that the file system has helpfully placed contiguously so they can be accessed faster!

If an LVM volume is on, say, 4 physical disks then there is 4 times as much chance of a disk failure impacting the volume. If that matters you need to combat it with redundancy so you can continue working with one disk failed.

One advantage of smaller file systems (be they on LVM volumes or direct partitions) is that, if the boot scripts decide a volume is due for checking, it doesn't take as long as checking a big file system. Boot times are more consistent.

An often-overlooked advantage of LVM is the snapshot facility which can be used to minimise data skew and reduce downtime during backups. For example a database can be quiesced, the snapshot set up and the database activated. The LVM snapshot facility minimises the database down time.

Beware that LVM partitions (that's partitions, not volumes!) cannot be re-sized yet by the likes of gparted; if you need to re-size you have to delete and recreate. LVM provides good tools to move the data to another partition before deletion but that's no good unless you have temporary space for the other partition!

Best

Charles

crispyleif 07-26-2009 12:57 PM

Thanks, this helped.

A question remains :

If I have 4 physical disks that do RAID 1+0 (10) and create a lvm on top of /dev/md0 (the RAID volume),
would I be just as good off by doing RAID 1 + lvm on 2 disks ? Ie. is lvm striping anyway so no need to complicate with RAID 1+0 ?

EricTRA 07-26-2009 01:12 PM

Hi,

This step-by-step guide gives a lot of information about LVM, RAID, etc.

Linux LVM

Kind regards,

Eric

catkin 07-27-2009 02:10 AM

Quote:

Originally Posted by EricTRA (Post 3620916)
Hi,

This step-by-step guide gives a lot of information about LVM, RAID, etc.

Linux LVM

Kind regards,

Eric

That's a lot of detailed information! The way it explains how to change disks in both LVM and "RAID" (software mirroring only?) is very useful for admins of high-availability servers. But wouldn't high-availability servers be using hardware RAID?

Two other good LVM sites: Linux Documentation Project and riseup labs a.k.a. grimoire.

None of those sites say much about using LVM to do striping, probably because it is (almost?) never the best choice. Firstly LVM striping only does striping, no redundancy, so it's a performance-only choice which, by spreading your data across multiple volumes (LVM PVs), increases the risk of data disruption; failure of any of the LVM PVs disrupts the data. Secondly it's not easy to extend striped LVM volumes. See http://tldp.org/HOWTO/LVM-HOWTO/mapmode.htmlfor more information.

It is (almost?) always better to use RAID tools instead of LVM to build RAID volumes for use as LVM PVs, especially to use hardware RAID tools. These perform better that LVM's limited striping functionality and have greater functionality. Conceptually and administratively it is easier to layer LVM on top of a separate storage device (LVM PV) provider.

Best

Charles


All times are GMT -5. The time now is 12:03 PM.