Why can't we directly create a volume group over a disk without creating a physical volume from it?
What is a physical extent? Do we even have physical extents in a partition?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The physical volume (PV) is simply the partition with LVM metadata added. You can't create the volume group (VG) without referring to the metadata, thus you have to first create the PV(s) that will be members of the VG. A physical extent (PE) is just that - the actual section of the disk that you're writing to, very similar to an old-style disk CHS (cylinder-head-sector) address. You will always have PEs in an LVM world.
A “physical volume” is LVM terminology for the underlying storage on which it puts data. Some typical examples of physical volumes include
A volume group is an intermediate abstraction layer between physical volumes (corresponding to the underlying storage) and logical volumes (each containing a filesystem (usually)). To “create volume group over a disk”, you need, by definition, to declare the disk as a physical volume for use by LVM.
A “physical extent” is just a consecutive chunk of 4MB (by default) on an LVM physical volume. It's an LVM concept, not a disk concept.
You can make a disk an LVM physical volume, but it tends to facilitate maintenance to first create a partition (a single partition if you want to use the whole disk) and make that partition an LVM physical volume. See The merits of a partitionless filesystem
So to use LVM on a single disk, say
parted, etc.) to create a partition
pvcreate /dev/sda1to make the partition a physical volume.
vgcreate mystorage /dev/sda1to a volume group called
mystorageusing the partition as storage space.
lvcreate … mystoragefor each of the logical volumes you want to create.