Use the block device file to include each disk in your volume group. You can assign all the physical
volumes to the volume group with one command, or create the volume group with a single physical
volume. No physical volume can already be part of an existing volume group.
You can set volume group attributes using the following options:
-V 1.0
Version 1.0 volume group (default)
-s pe_size
Size of a physical extent in MB (default 4)
-e max_pe
Maximum number of physical extents per physical volume (default 1016)
-l max_lv
Maximum number of logical volumes (default 255)
-p max_pv
Maximum number of physical volumes (default 255)
The size of a physical volume is limited by
pe_size
times
max_pe
. If you plan to assign a disk
larger than approximately 4 GB (1016 * 4 MB) to this volume group, use a larger value of
pe_size
or
max_pe
.
The size of the LVM metadata on each disk depends on
max_lv
,
max_pv
, and
max_pe
. If the
vgcreate
options would cause the metadata to exceed its available space,
vgcreate
does not
create the volume group. You must select new values of
max_lv
,
max_pv
, and
max_pe
. For
example, if you plan to use disks larger than 100 GB, consider reducing
max_pv
. For
recommendations on choosing an optimal extent size, see
Appendix C (page 155)
.
Creating a Version 2.x Volume Group
For Version 2.x volume groups, the
vgcreate
command does not require maximum values for
the number of physical volumes (
-p
), number of logical volumes (
-l
), or extents per physical
volume (
-e
). Instead you must specify only the extent size (
-s
) and the maximum size to which the
volume group can grow (
-S
). For example:
# vgcreate -V 2.0 -s pe_size -S vg_size /dev/vgname /dev/disk/disk3
Use the block device file to include each disk in your volume group. You can assign all the physical
volumes to the volume group with one command, or create the volume group with a single physical
volume. No physical volume can already be part of an existing volume group.
You must use the following options:
-V 2.x
Version 2.x (such as 2.0, 2.1, or 2.2) volume group
-s pe_size
Size of a physical extent in MB
-S vg_size
Maximum future size of the volume group
The size of a volume group is the sum of the user data space on all physical
volumes assigned to the volume group.
vg_size
is not the size of the volume
group at creation; it is the size to which the volume group can grow in the future.
This value can be specified in megabytes, gigabytes, terabytes, or petabytes, by
adding the character
m
,
g
,
t
, or
p
, respectively. For example, to specify a
maximum size of two terabytes, use
-S 2t
.
In a Version 2.x volume group, the number of physical extents in a volume group has an architectural
limit, so your choice of physical extent size affects the maximum size of the volume group. To
display the maximum volume group size for a given physical extent size, use the
-E
option to
vgcreate
with the
-s
option. For example:
# vgcreate -V 2.0 -E -s 256
Max_VG_size=2p:extent_size=256m
Conversely, to display the minimum physical extent size for a given volume group size, use the
-E
option to
vgcreate
with
-S
. For example:
# vgcreate -V 2.0 -E -S 2t
Max_VG_size=2t:extent_size=1m
For volume group Version 2.2 or higher, a new
vgcreate-U
option is introduced to configure
the size of the unshare unit for snapshots in the volume group. Once the unshare unit size is
Common LVM Tasks
45