5.3. 卷组管理
这部分论述用于管理卷组各个方面的命令。
5.3.1. 创建卷组 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
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 /dev/sdd1 and /dev/sde1.
vgcreate vg1 /dev/sdd1 /dev/sde1
# vgcreate vg1 /dev/sdd1 /dev/sde1
当使用物理卷创建卷组时,默认情况下,它的磁盘空间被分成大小为 4MB 的扩展。这个扩展是增大或者减小逻辑卷容量的最小单位。大量的扩展不会影响逻辑卷的 I/O 性能。
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 -p and -l arguments of the vgcreate command.
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 contiguous, anywhere, or 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 第 5.3.2 节 “LVM Allocation”.
LVM 卷组和基本逻辑卷是包含在
/dev 目录的设备专用文件目录树中的,布局如下:
/dev/vg/lv/
/dev/vg/lv/
For example, if you create two volume groups
myvg1 and myvg2, each with three logical volumes named lv01, lv02, and lv03, six device special files are created:
The device special files are not present if the corresponding logical volume is not currently active.
64 位 CPU 中 LVM 的最大设备大小为 8EB。