This section describes the commands that perform the various aspects of volume group administration.
5.3.1. Creating Volume Groups
To create a volume group from one or more physical volumes, use the
command creates a new volume group by name and adds at least one physical volume to it.
The following command creates a volume group named
vg1 that contains physical volumes
vgcreate vg1 /dev/sdd1 /dev/sde1
When physical volumes are used to create a volume group, its disk space is divided into 4MB extents, by default. This extent is the minimum amount by which the logical volume may be increased or decreased in size. Large numbers of extents will have no impact on I/O performance of the logical volume.
You can specify the extent size with the
-s option to the
vgcreate command if the default extent size is not suitable. You can put limits on the number of physical or logical volumes the volume group can have by using the
-l arguments of the
By default, a volume group allocates physical extents according to common-sense rules such as not placing parallel stripes on the same physical volume. This is the
allocation policy. You can use the
argument of the
command to specify an allocation policy of
. In general, allocation policies other than
are required only in special cases where you need to specify unusual or nonstandard extent allocation. For further information on how LVM allocates physical extents, see Section 5.3.2, “LVM Allocation”
LVM volume groups and underlying logical volumes are included in the device special file directory tree in the
/dev directory with the following layout:
For example, if you create two volume groups
myvg2, each with three logical volumes named
lv03, six device special files are created:
The device special files are not present if the corresponding logical volume is not currently active.
The maximum device size with LVM is 8 Exabytes on 64-bit CPUs.