LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-24-2009, 07:37 AM   #1
crispyleif
Member
 
Registered: Mar 2005
Location: Norway, by the coast
Distribution: Debian and the likes
Posts: 190

Rep: Reputation: 31
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 ?
 
Old 07-24-2009, 08:26 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Hello crispyleif
Quote:
Originally Posted by crispyleif View Post
[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
 
Old 07-26-2009, 12:57 PM   #3
crispyleif
Member
 
Registered: Mar 2005
Location: Norway, by the coast
Distribution: Debian and the likes
Posts: 190

Original Poster
Rep: Reputation: 31
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 ?

Last edited by crispyleif; 07-26-2009 at 01:00 PM.
 
Old 07-26-2009, 01:12 PM   #4
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

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

Linux LVM

Kind regards,

Eric
 
Old 07-27-2009, 02:10 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by EricTRA View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual drive failure in RAID 5 (also, RAID 1, and LVM) ABL Linux - Server 6 05-27-2009 08:01 PM
Using LVM on RAID, some questions [GOD]Anck Slackware 2 03-16-2008 11:07 AM
software raid 5 + LVM and other raid questions slackman Slackware 5 05-09-2007 02:58 PM
Lvm + Raid username17 Linux - Hardware 4 02-21-2007 12:02 PM
raid-1 and lvm together?? Vasili Linux - Enterprise 7 12-04-2006 04:59 AM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration