7

I have just a short question about LVM.

A physical volume is a Partition or a whole Disk. A volume group is a container for a least one physical volume.

So I know that a volume group can have more than one physical volume for example 3 partitions on two disks in one volume group.

But "for a least one physical" means that you can't create two or more volume groups on the same physical volume? So a volume group always uses the whole physical volume, is this correct?

So if I like to have more volume groups on a disk I need to create more partitions on the disk (physical volume) first?

Thanks

7

Yes, your understanding is correct.

A Volume Group (VG) comprises Physical Volumes (PV). If the PVs are in one VG, they can't then be placed in another Volume Group.

So if you want to create multiple volume groups, you need separate PVs for them. As you have noted, you can share a physical disk among VGs, but it would need to be partitioned, and PVs created from the partitions, and put into separate volume groups.

| improve this answer | |
3

Two or more VGs can be created on a single drive, provided you partition it. However, you cannot create two VGs on the same disk partition or on a whole disk, as you noted.

Increasing number of PVs in a VG is usually done either by:

  • adding physical disk (it might require halting the OS).
  • creating LUN on a SAN. LUN stands for Logical Unit Number, and are reserved space on SAN seen as disk by the OS.

Unused partitions of a disk can be used to add more PVs; this can happen of you have not allocated all space to VG/PV, or in case of a LUN if you grow it. Note that, for Red Hat at least, if PV is a whole disk, the pvresize command can be used to change size of PV.

| improve this answer | |
  • Can't you stack the LVM layers? Creating two intermediate LV from one PV, and use those as PV for two distinct VG. – Celelibi Dec 12 '16 at 8:02
  • I don't see the point, but maybe you can. – Archemar Dec 12 '16 at 9:21
  • Well, that way you can have one disk that's part of several VG, and the portion of the disk used for each VG could be easily changed. So you'd rely on the LV instead of native partitions to split a single disk for several VG. – Celelibi Dec 13 '16 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.