LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Advice on LVM planning. Disadvantage to more Volume Groups? (https://www.linuxquestions.org/questions/linux-server-73/advice-on-lvm-planning-disadvantage-to-more-volume-groups-722276/)

Vanyel 04-28-2009 11:42 AM

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

MensaWater 04-28-2009 03:01 PM

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.

raskin 04-28-2009 03:04 PM

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

Vanyel 04-28-2009 03:09 PM

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.

raskin 04-28-2009 03:11 PM

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.

chrism01 04-28-2009 07:46 PM

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


All times are GMT -5. The time now is 02:16 AM.