LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-28-2009, 11:42 AM   #1
Vanyel
Member
 
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, FC, Ubuntu
Posts: 113

Rep: Reputation: 17
Advice on LVM planning. Disadvantage to more Volume Groups?


I've been using LVMs on some of my Linux servers for years without fully "getting" them. Doing a lot of things by rote. As I setup a new RAID though, I realize I don't have to be so rigid.

I inherited a mission critical server with five independent disks
Code:
/dev/sdb1    /usr1            
/dev/sdc1    /usr2
/dev/sdd1    /usr3
/dev/sde1    /usr4
/dev/sdf1    /usr5
I've bought an external RAID5 box that I plan to migrate the data to and was planning on this layout
Code:
Method 1
 				VG	LogVol
/dev/sdb1	/usr1 -> 	usr1	disk1	           
/dev/sdc1	/usr2 ->	usr2	disk1
/dev/sdd1	/usr3 ->	usr3	disk1
/dev/sde1	/usr4 ->	usr4	disk1
/dev/sdf1	/usr5 ->	usr5	disk1
mainly because the 1 to 1 correspondence is easy for me to understand, and what I'm used to.

But I realize it doesn't have to be that way, and I could have one VG with all the LVMs as parts of it, i.e.
Code:
Method 2
				VG	LogVol
/dev/sdb1	/usr1 -> 	array	usr1	           
/dev/sdc1	/usr2 ->	array	usr2
/dev/sdd1	/usr3 ->	array	usr3
/dev/sde1	/usr4 ->	array	usr4
/dev/sdf1	/usr5 ->	array	usr5
MY QUESTION IS: is there any advantage to one way over the other?

Would using one VG with multiple LVs be kind of like "putting all my eggs in one basket"?

Do more VGs and LVs introduce unwanted overhead into the LV Mgr that should be frowned upon?

If both methods are equal, I go with the method1. Just more clear to me. But now that I understand the second, I could go that way, if there's a compelling reason.

Any thoughts?

- Van

Last edited by Vanyel; 04-28-2009 at 11:43 AM. Reason: typo
 
Old 04-28-2009, 03:01 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,995
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
Method 2 is the way most folks would do it because it gives you the main benefit of LVM.

That is with LVM you can put all the disks into a single Volume Group (VG - think of it as a logical disk) that you can then split up into multiple Logical Volumes (LVs - think of them as logical partitions).

The benefits to this method are:
1) You aren't limited to 8 partitions as you are on a physical disk - you can have many many LVs.
2) You can more easily adjust space. If you have an LV that needs more space you can just add it from what is in the VG or add another disk to the VG if you've used all space then allocate that to the LV. If you had hard partitions on a physical disk this would be a much more difficult thing to deal with - usually requiring you to create a brand new partition and manually migrating things over.

The only real benefit to method 1 over method 2 is that you can be sure that only the filesystem you want is on a specific disk and the only reason you would want that is to isolate its performance from the other disks. For most purposes this is unnecessary. In fact if you're going to do method 1 you might as well not do LVM at all and just partition the disks to use the entire disk for the filesystems.
 
Old 04-28-2009, 03:04 PM   #3
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Well, In the first case you may be better off without LVM. One-to-one correspondence between disks visible to OS and partitions means you do not have, for example, easy resizing. Maybe mdadm for software raid would be a better choice than LVM. As for eggs and baskets, LVM has non-ideal reputation when we speak about recoverability after hardware failure (including repeated power failuires). I use dmsetup table > /etc/lvm-layout (and backup lvm-layout) to have any chance of recovering non-trivial LVM failure
 
Old 04-28-2009, 03:09 PM   #4
Vanyel
Member
 
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, FC, Ubuntu
Posts: 113

Original Poster
Rep: Reputation: 17
Hmmmm ... sorry. To simplify the model, I didn't mention that there's about a TB of unused space outside of these that I can allocate freely as needed. So either method can gain the space flexibility of LVM.
 
Old 04-28-2009, 03:11 PM   #5
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

Rep: Reputation: 68
Vanyel - these are seemingly partitions on distinct disks. If the free space is on each of the disks, you cannot redistribute between disks unless they are in a single VG.
 
Old 04-28-2009, 07:46 PM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
There's a good LVM guide here:http://www.linuxtopia.org/online_boo...m-intro-whatis but basically LVs (logical vols) are carved out of a VG (vol group). I don't believe method 1 as you describe it is possible, unless you mean to have multiple VGs all with the same named LV, which is possible, but it doesn't constitute one huge LV. Think dirs/sub-dirs
 
  


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
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM
shutting down LVM volume groups aztek Debian 2 06-02-2006 09:58 PM
Can I delete LVM Volume Groups? second_existence Linux - Newbie 1 01-24-2006 10:20 PM
Planning on getting Verizon DSL - Looking for advice. IamI Slackware 6 10-16-2005 01:46 PM
Activating LVM Volume Groups at startup TomF Linux - Newbie 0 05-05-2004 05:05 PM


All times are GMT -5. The time now is 03:36 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