lvm: what's the purpose of a Volume Group?

10,485

Solution 1

Volume Groups have their uses; they keep PV separate, so things don't mix where they shouldn't be mixed. For example adding an external disk to your internal VG may be a bad idea since LVM does not particularly like missing disks.

You could just as well argue that a single partition or single filesystem was enough. Why use several LV when one is enough to store all the files? People just like to divide, group, manage things, and Volume Groups are useful for that. In terms of performance, it makes no difference either way.

I use two volume groups on my machine, one for SSD and another for HDD. I could do this with one VG, but then I'd have to tell LVM where to allocate new space for every lvcreate/lvresize operation. It would make those commands more cumbersome to use.

Nobody forces you to use more than one VG, if one is all you need.

Solution 2

Since physical and logical volumes can't span different volume groups, the volume group becomes important when you want to take if offline or move it between different systems. The volume group is another way of subdividing and managing resources.

Share:
10,485

Related videos on Youtube

piotrek
Author by

piotrek

Updated on September 18, 2022

Comments

  • piotrek
    piotrek over 1 year

    Each Volume Group can have many resizeable Logical Volumes. each of Logical Volume can have different filesystem, encryption options etc. that means having a single Volume Groups is enough. so why LVM introduced the concept of Volume Groups? isn't it just an unnecessary abstraction layer? aren't Logical Volumes enough?

  • SIslam
    SIslam about 8 years
    yeah! may this idea is borrowed from oop's encapsulation?
  • Sridhar Sarnobat
    Sridhar Sarnobat about 2 years
    I like the last line. I'm having trouble learning how to use LVM with my brain showing signs of aging so I'm glad you confirming it's a valid situation (for beginners especially I would assume).
  • Admin
    Admin almost 2 years
    It's also worth noting that if the sys admin is careful to create different volume groups with the same physical extent size (-s parameter to vgcreate), then they are easy to merge and split as necessary via vgmerge and vgsplit.