Linux – lvm: what’s the purpose of a Volume Group

hard-disklinuxlvmpartition

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?

Best Answer

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.

Related Question