5.3. Volume Group Administration
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
vgcreate command. The
vgcreate 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
normal allocation policy. You can use the
--alloc argument of the
vgcreate command to specify an allocation policy of
cling. In general, allocation policies other than
normal 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:
/dev/myvg1/lv01 /dev/myvg1/lv02 /dev/myvg1/lv03 /dev/myvg2/lv01 /dev/myvg2/lv02 /dev/myvg2/lv03
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.