man LVCREATE
LVCREATE(8) LVCREATE(8)
NAME/名称
lvcreate - create a logical volume in an existing volume group
lvcreate-在现有卷组中创建逻辑卷
lvcreate - create a logical volume in an existing volume group
lvcreate-在现有卷组中创建逻辑卷
SYNOPSIS/简介
lvcreate [--addtag Tag] [--alloc AllocationPolicy] [-A|--autobackup y|n]
[-C|--contiguous y|n] [-d|--debug] [-h|-?|--help] [-i|--stripes Stripes
[-I|--stripesize StripeSize]] {-l|--extents LogicalExtentsNum-
ber[%{VG|PVS|FREE}] |
-L|--size LogicalVolumeSize[kKmMgGtT]} [-M|--persistent y|n] [--minor
minor] [-m|--mirrors Mirrors [--nosync] [--mirrorlog {disk|core}]
[--corelog] [-R|--regionsize MirrorLogRegionSize]] [-n|--name LogicalVolume-
Name] [-p|--permission r|rw] [-r|--readahead ReadAheadSectors|auto|none]
[-t|--test] [-v|--verbose] [-Z|--zero y|n] VolumeGroupName [PhysicalVol-
umePath...]
lvcreate [--addtag Tag] [--alloc AllocationPolicy] [-A|--autobackup y|n]
[-C|--contiguous y|n] [-d|--debug] [-h|-?|--help] [-i|--stripes Stripes
[-I|--stripesize StripeSize]] {-l|--extents LogicalExtentsNum-
ber[%{VG|PVS|FREE}] |
-L|--size LogicalVolumeSize[kKmMgGtT]} [-M|--persistent y|n] [--minor
minor] [-m|--mirrors Mirrors [--nosync] [--mirrorlog {disk|core}]
[--corelog] [-R|--regionsize MirrorLogRegionSize]] [-n|--name LogicalVolume-
Name] [-p|--permission r|rw] [-r|--readahead ReadAheadSectors|auto|none]
[-t|--test] [-v|--verbose] [-Z|--zero y|n] VolumeGroupName [PhysicalVol-
umePath...]
lvcreate {-l|--extents LogicalExtentsNumber[%{VG|FREE}] |
-L|--size LogicalVolumeSize[kKmMgGtT]} [-c|--chunksize ChunkSize] -n|--name
SnapshotLogicalVolumeName {{-s|--snapshot} OriginalLogicalVolumePath |
[-s|--snapshot] VolumeGroupName --virtualsize VirtualSize}
-L|--size LogicalVolumeSize[kKmMgGtT]} [-c|--chunksize ChunkSize] -n|--name
SnapshotLogicalVolumeName {{-s|--snapshot} OriginalLogicalVolumePath |
[-s|--snapshot] VolumeGroupName --virtualsize VirtualSize}
DESCRIPTION/描述
lvcreate creates a new logical volume in a volume group ( see vgcreate(8),
vgchange(8) ) by allocating logical extents from the free physical extent
pool of that volume group. If there are not enough free physical extents
then the volume group can be extended ( see vgextend(8) ) with other physi-
cal volumes or by reducing existing logical volumes of this volume group in
size ( see lvreduce(8) ).
The second form supports the creation of snapshot logical volumes which keep
the contents of the original logical volume for backup purposes.
lvcreate通过从卷组的空闲物理扩展池分配逻辑扩展数据块,在卷组中创建新的逻辑卷
(请参阅vgcreate(8)、vgchange(8))。如果没有足够的可用物理区然后,
可以将卷组与其他物理卷一起扩展(请参阅vgextend(8)),
或者通过减小此卷组的现有逻辑卷的大小(请参阅lvreduce(8))。
第二种形式支持创建快照逻辑卷,以保留原始逻辑卷的内容以备备份。
OPTIONS/选项
See lvm for common options./常见选项见LVM。
lvcreate creates a new logical volume in a volume group ( see vgcreate(8),
vgchange(8) ) by allocating logical extents from the free physical extent
pool of that volume group. If there are not enough free physical extents
then the volume group can be extended ( see vgextend(8) ) with other physi-
cal volumes or by reducing existing logical volumes of this volume group in
size ( see lvreduce(8) ).
The second form supports the creation of snapshot logical volumes which keep
the contents of the original logical volume for backup purposes.
lvcreate通过从卷组的空闲物理扩展池分配逻辑扩展数据块,在卷组中创建新的逻辑卷
(请参阅vgcreate(8)、vgchange(8))。如果没有足够的可用物理区然后,
可以将卷组与其他物理卷一起扩展(请参阅vgextend(8)),
或者通过减小此卷组的现有逻辑卷的大小(请参阅lvreduce(8))。
第二种形式支持创建快照逻辑卷,以保留原始逻辑卷的内容以备备份。
OPTIONS/选项
See lvm for common options./常见选项见LVM。
-c, --chunksize ChunkSize
Power of 2 chunk size for the snapshot logical volume between 4k and
512k.
4K和512K之间快照逻辑卷的2块大小的幂。
Power of 2 chunk size for the snapshot logical volume between 4k and
512k.
4K和512K之间快照逻辑卷的2块大小的幂。
-C, --contiguous y|n
Sets or resets the contiguous allocation policy for logical volumes.
Default is no contiguous allocation based on a next free principle.
设置或重置逻辑卷的连续分配策略。默认情况下,没有基于下一个自由原则的连续分配。
Sets or resets the contiguous allocation policy for logical volumes.
Default is no contiguous allocation based on a next free principle.
设置或重置逻辑卷的连续分配策略。默认情况下,没有基于下一个自由原则的连续分配。
-i, --stripes Stripes
Gives the number of stripes. This is equal to the number of physical
volumes to scatter the logical volume.
给出条纹数。这等于要分散逻辑卷的物理卷数。
Gives the number of stripes. This is equal to the number of physical
volumes to scatter the logical volume.
给出条纹数。这等于要分散逻辑卷的物理卷数。
-I, --stripesize StripeSize
Gives the number of kilobytes for the granularity of the stripes.
StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format. For
metadata in LVM2 format, the stripe size may be a larger power of 2
but must not exceed the physical extent size.
给出条带粒度的千字节数。对于LVM1格式的元数据,条带大小必须为2^n(n=2到9)。
对于LVM2格式的元数据,条带大小可以是2的较大幂,但不能超过物理数据块大小。
Gives the number of kilobytes for the granularity of the stripes.
StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format. For
metadata in LVM2 format, the stripe size may be a larger power of 2
but must not exceed the physical extent size.
给出条带粒度的千字节数。对于LVM1格式的元数据,条带大小必须为2^n(n=2到9)。
对于LVM2格式的元数据,条带大小可以是2的较大幂,但不能超过物理数据块大小。
-l, --extents LogicalExtentsNumber[%{VG|PVS|FREE}]
Gives the number of logical extents to allocate for the new logical
volume. This can also be expressed as a percentage of the total
space in the Volume Group with the suffix %VG, of the remaining free
space in the Volume Group with the suffix %FREE, or of the remaining
free space for the specified PhysicalVolume(s) with the suffix %PVS,
提供要为新逻辑卷分配的逻辑扩展数据块数。
这也可以表示为后缀为%vg的卷组中的总空间、
后缀为%free的卷组中的剩余可用空间或后缀为%pvs的指定物理卷的剩余可用空间的百分比,
Gives the number of logical extents to allocate for the new logical
volume. This can also be expressed as a percentage of the total
space in the Volume Group with the suffix %VG, of the remaining free
space in the Volume Group with the suffix %FREE, or of the remaining
free space for the specified PhysicalVolume(s) with the suffix %PVS,
提供要为新逻辑卷分配的逻辑扩展数据块数。
这也可以表示为后缀为%vg的卷组中的总空间、
后缀为%free的卷组中的剩余可用空间或后缀为%pvs的指定物理卷的剩余可用空间的百分比,
-L, --size LogicalVolumeSize[kKmMgGtTpPeE]
Gives the size to allocate for the new logical volume. A size suffix
of K for kilobytes, M for megabytes, G for gigabytes, T for ter-
abytes, P for petabytes or E for exabytes is optional.
Default unit is megabytes.
提供为新逻辑卷分配的大小。千字节的大小后缀为K,兆字节的大小后缀为M,
千兆字节的大小后缀为G,兆字节的大小后缀为T,千兆字节的大小后缀为P,
兆字节的大小后缀为E,兆字节的大小后缀为E。默认单位为兆字节。
Gives the size to allocate for the new logical volume. A size suffix
of K for kilobytes, M for megabytes, G for gigabytes, T for ter-
abytes, P for petabytes or E for exabytes is optional.
Default unit is megabytes.
提供为新逻辑卷分配的大小。千字节的大小后缀为K,兆字节的大小后缀为M,
千兆字节的大小后缀为G,兆字节的大小后缀为T,千兆字节的大小后缀为P,
兆字节的大小后缀为E,兆字节的大小后缀为E。默认单位为兆字节。
--minor minor
Set the minor number./设置次要号码。
Set the minor number./设置次要号码。
-M, --persistent y|n
Set to y to make the minor number specified persistent.
设置为y,使指定的次要数字持久化。
Set to y to make the minor number specified persistent.
设置为y,使指定的次要数字持久化。
-m, --mirrors Mirrors
Creates a mirrored logical volume with Mirrors copies. For example,
specifying "-m 1" would result in a mirror with two-sides; that is, a
linear volume plus one copy.
Creates a mirrored logical volume with Mirrors copies. For example,
specifying "-m 1" would result in a mirror with two-sides; that is, a
linear volume plus one copy.
Specifying the optional argument --nosync will cause the creation of
the mirror to skip the initial resynchronization. Any data written
afterwards will be mirrored, but the original contents will not be
copied. This is useful for skipping a potentially long and resource
intensive initial sync of an empty device.
the mirror to skip the initial resynchronization. Any data written
afterwards will be mirrored, but the original contents will not be
copied. This is useful for skipping a potentially long and resource
intensive initial sync of an empty device.
The optional argument --mirrorlog specifies the type of log to be
used. The default is disk, which is persistent and requires a small
amount of storage space, usually on a separate device from the data
being mirrored. Using core means the mirror is regenerated by copying
the data from the first device again each time the device is acti-
vated, for example, after every reboot.
used. The default is disk, which is persistent and requires a small
amount of storage space, usually on a separate device from the data
being mirrored. Using core means the mirror is regenerated by copying
the data from the first device again each time the device is acti-
vated, for example, after every reboot.
The optional argument --corelog is equivalent to --mirrorlog core.
使用镜像副本创建镜像逻辑卷。例如,指定“-m 1”将导致具有两面的镜像,
即线性卷加上一个副本。指定可选参数--nosync将导致创建镜像跳过初始重新同步。
之后写入的任何数据都将被镜像,但不会复制原始内容。
这对于跳过空设备的可能很长且资源密集的初始同步很有用。
可选参数--mirrorlog指定要使用的日志类型。默认值是磁盘,它是持久性的,
需要少量的存储空间,通常位于与要镜像的数据不同的设备上。
使用core意味着每次激活设备时(例如,每次重新启动后),
都会通过从第一个设备再次复制数据来重新生成镜像。
可选参数--corelog等价于--mirrorlog core。
使用镜像副本创建镜像逻辑卷。例如,指定“-m 1”将导致具有两面的镜像,
即线性卷加上一个副本。指定可选参数--nosync将导致创建镜像跳过初始重新同步。
之后写入的任何数据都将被镜像,但不会复制原始内容。
这对于跳过空设备的可能很长且资源密集的初始同步很有用。
可选参数--mirrorlog指定要使用的日志类型。默认值是磁盘,它是持久性的,
需要少量的存储空间,通常位于与要镜像的数据不同的设备上。
使用core意味着每次激活设备时(例如,每次重新启动后),
都会通过从第一个设备再次复制数据来重新生成镜像。
可选参数--corelog等价于--mirrorlog core。
-n, --name LogicalVolumeName
The name for the new logical volume.
Without this option a default names of "lvol#" will be generated
where # is the LVM internal number of the logical volume.
新逻辑卷的名称。如果没有此选项,将生成默认名称“lvol”,其中是逻辑卷的lvm内部编号。
The name for the new logical volume.
Without this option a default names of "lvol#" will be generated
where # is the LVM internal number of the logical volume.
新逻辑卷的名称。如果没有此选项,将生成默认名称“lvol”,其中是逻辑卷的lvm内部编号。
-p, --permission r|rw
Set access permissions to read only or read and write.
Default is read and write.
将访问权限设置为只读或读写。
默认为读写。
Set access permissions to read only or read and write.
Default is read and write.
将访问权限设置为只读或读写。
默认为读写。
-r, --readahead ReadAheadSectors|auto|none/预读预读预读扇区自动无
Set read ahead sector count of this logical volume. For volume
groups with metadata in lvm1 format, this must be a value between 2
and 120. The default value is "auto" which allows the kernel to
choose a suitable value automatically. "None" is equivalent to spec-
ifying zero.
设置此逻辑卷的预读扇区计数。对于元数据为lvm1格式的卷组,此值必须介于2和120之间。
默认值是“auto”,它允许内核自动选择合适的值。“无”等于指定零。
Set read ahead sector count of this logical volume. For volume
groups with metadata in lvm1 format, this must be a value between 2
and 120. The default value is "auto" which allows the kernel to
choose a suitable value automatically. "None" is equivalent to spec-
ifying zero.
设置此逻辑卷的预读扇区计数。对于元数据为lvm1格式的卷组,此值必须介于2和120之间。
默认值是“auto”,它允许内核自动选择合适的值。“无”等于指定零。
-R, --regionsize MirrorLogRegionSize
A mirror is divided into regions of this size (in MB), and the mirror
log uses this granularity to track which regions are in sync.
镜像被划分成这个大小的区域(以MB为单位),镜像日志使用这个粒度来跟踪哪些区域是同步的。
A mirror is divided into regions of this size (in MB), and the mirror
log uses this granularity to track which regions are in sync.
镜像被划分成这个大小的区域(以MB为单位),镜像日志使用这个粒度来跟踪哪些区域是同步的。
-s, --snapshot
Create a snapshot logical volume (or snapshot) for an existing, so
called original logical volume (or origin). Snapshots provide a
?.rozen image?. of the contents of the origin while the origin can
still be updated. They enable consistent backups and online recovery
of removed/overwritten data/files. The snapshot does not need the
same amount of storage the origin has. In a typical scenario, 15-20%
might be enough. In case the snapshot runs out of storage, use lvex-
tend(8) to grow it. Shrinking a snapshot is supported by lvreduce(8)
as well. Run lvdisplay(8) on the snapshot in order to check how much
data is allocated to it. Note that a small amount of the space you
allocate to the snapshot is used to track the locations of the chunks
of data, so you should allocate slightly more space than you actually
need and monitor the rate at which the snapshot data is growing so
you can avoid running out of space.
为现有逻辑卷(或快照)创建快照逻辑卷(或快照),即所谓的原始逻辑卷(或源)。
快照提供了?罗森形象?.源的内容,但源仍可以更新。
它们支持对已删除/覆盖的数据/文件进行一致备份和在线恢复。快照不需要与源站具有相同的存储量。
在典型情况下,15-20%可能就足够了。如果快照耗尽存储空间,
请使用lvextend(8)使其增长。lvreduce(8)也支持收缩快照。
在快照上运行lvdisplay(8),以检查分配给它的数据量。请注意,分配给快照的少量空间用于跟踪数据块的位置,
因此您应该分配比实际需要的空间稍多的空间,并监视快照数据增长的速度,这样可以避免空间不足。
Create a snapshot logical volume (or snapshot) for an existing, so
called original logical volume (or origin). Snapshots provide a
?.rozen image?. of the contents of the origin while the origin can
still be updated. They enable consistent backups and online recovery
of removed/overwritten data/files. The snapshot does not need the
same amount of storage the origin has. In a typical scenario, 15-20%
might be enough. In case the snapshot runs out of storage, use lvex-
tend(8) to grow it. Shrinking a snapshot is supported by lvreduce(8)
as well. Run lvdisplay(8) on the snapshot in order to check how much
data is allocated to it. Note that a small amount of the space you
allocate to the snapshot is used to track the locations of the chunks
of data, so you should allocate slightly more space than you actually
need and monitor the rate at which the snapshot data is growing so
you can avoid running out of space.
为现有逻辑卷(或快照)创建快照逻辑卷(或快照),即所谓的原始逻辑卷(或源)。
快照提供了?罗森形象?.源的内容,但源仍可以更新。
它们支持对已删除/覆盖的数据/文件进行一致备份和在线恢复。快照不需要与源站具有相同的存储量。
在典型情况下,15-20%可能就足够了。如果快照耗尽存储空间,
请使用lvextend(8)使其增长。lvreduce(8)也支持收缩快照。
在快照上运行lvdisplay(8),以检查分配给它的数据量。请注意,分配给快照的少量空间用于跟踪数据块的位置,
因此您应该分配比实际需要的空间稍多的空间,并监视快照数据增长的速度,这样可以避免空间不足。
--virtualsize VirtualSize
Create a sparse device of the given size (in MB by default) using a
snapshot. Anything written to the device will be returned when read-
ing from it. Reading from other areas of the device will return
blocks of zeros. It is implemented by creating a hidden virtual
device of the requested size using the zero target. A suffix of
_vorigin is used for this device.
使用快照创建给定大小(默认为MB)的稀疏设备。
任何写入设备的内容在读取时都会返回。
从设备的其他区域读取将返回零块。
它是通过使用零目标创建请求大小的隐藏虚拟设备来实现的。
此设备的后缀为vorigin。
Create a sparse device of the given size (in MB by default) using a
snapshot. Anything written to the device will be returned when read-
ing from it. Reading from other areas of the device will return
blocks of zeros. It is implemented by creating a hidden virtual
device of the requested size using the zero target. A suffix of
_vorigin is used for this device.
使用快照创建给定大小(默认为MB)的稀疏设备。
任何写入设备的内容在读取时都会返回。
从设备的其他区域读取将返回零块。
它是通过使用零目标创建请求大小的隐藏虚拟设备来实现的。
此设备的后缀为vorigin。
-Z, --zero y|n
Controls zeroing of the first KB of data in the new logical volume.
Default is yes.
Volume will not be zeroed if read only flag is set.
Snapshot volumes are zeroed always.
控制新逻辑卷中前KB数据的归零。
默认值为是。
如果设置了只读标志,卷将不会归零。
快照卷始终归零。
Controls zeroing of the first KB of data in the new logical volume.
Default is yes.
Volume will not be zeroed if read only flag is set.
Snapshot volumes are zeroed always.
控制新逻辑卷中前KB数据的归零。
默认值为是。
如果设置了只读标志,卷将不会归零。
快照卷始终归零。
Warning: trying to mount an unzeroed logical volume can cause the
system to hang.
警告:尝试装入未归零的逻辑卷可能导致系统挂起。
system to hang.
警告:尝试装入未归零的逻辑卷可能导致系统挂起。
Examples/举例
"lvcreate -i 3 -I 8 -L 100M vg00" tries to create a striped logical volume
with 3 stripes, a stripesize of 8KB and a size of 100MB in the volume group
named vg00. The logical volume name will be chosen by lvcreate.
“lvcreate-i 3-i 8-l 100m vg00”尝试在名为vg00的卷组中创建一个具有3个条带、
一个8kb的条带大小和100MB大小的条带逻辑卷。逻辑卷名将由lvcreate选择。
"lvcreate -i 3 -I 8 -L 100M vg00" tries to create a striped logical volume
with 3 stripes, a stripesize of 8KB and a size of 100MB in the volume group
named vg00. The logical volume name will be chosen by lvcreate.
“lvcreate-i 3-i 8-l 100m vg00”尝试在名为vg00的卷组中创建一个具有3个条带、
一个8kb的条带大小和100MB大小的条带逻辑卷。逻辑卷名将由lvcreate选择。
"lvcreate -m1 -L 500M vg00" tries to create a mirror logical volume with 2
sides with a useable size of 500 MiB. This operation would require 3
devices - two for the mirror devices and one for the disk log.
“lvcreate-m1-l 500m vg00”尝试创建一个镜像逻辑卷,其两侧的可用大小为500mib。
此操作需要3个设备-两个用于镜像设备,一个用于磁盘日志。
"lvcreate -m1 --mirrorlog core -L 500M vg00" tries to create a mirror logi-
cal volume with 2 sides with a useable size of 500 MiB. This operation
would require 2 devices - the log is "in-memory".
“lvcreate-m1--mirrorlog core-l 500m vg00”尝试创建一个两面都有500 mib大小的镜像逻辑卷。
此操作需要2个设备-日志在内存中。
sides with a useable size of 500 MiB. This operation would require 3
devices - two for the mirror devices and one for the disk log.
“lvcreate-m1-l 500m vg00”尝试创建一个镜像逻辑卷,其两侧的可用大小为500mib。
此操作需要3个设备-两个用于镜像设备,一个用于磁盘日志。
"lvcreate -m1 --mirrorlog core -L 500M vg00" tries to create a mirror logi-
cal volume with 2 sides with a useable size of 500 MiB. This operation
would require 2 devices - the log is "in-memory".
“lvcreate-m1--mirrorlog core-l 500m vg00”尝试创建一个两面都有500 mib大小的镜像逻辑卷。
此操作需要2个设备-日志在内存中。
"lvcreate --size 100m --snapshot --name snap /dev/vg00/lvol1"
creates a snapshot logical volume named /dev/vg00/snap which has access to
the contents of the original logical volume named /dev/vg00/lvol1 at snap-
shot logical volume creation time. If the original logical volume contains a
file system, you can mount the snapshot logical volume on an arbitrary
directory in order to access the contents of the filesystem to run a backup
while the original filesystem continues to get updated.
“lvcreate--size 100M--snapshot--name snap/dev/vg00/lvol1”创建名为/dev/vg00/snap的快照逻辑卷,
在快照逻辑卷创建时可以访问名为/dev/vg00/lvol1的原始逻辑卷的内容。
如果原始逻辑卷包含文件系统,则可以将快照逻辑卷装载到任意目录上,
以便在原始文件系统继续更新时访问文件系统的内容以运行备份。
creates a snapshot logical volume named /dev/vg00/snap which has access to
the contents of the original logical volume named /dev/vg00/lvol1 at snap-
shot logical volume creation time. If the original logical volume contains a
file system, you can mount the snapshot logical volume on an arbitrary
directory in order to access the contents of the filesystem to run a backup
while the original filesystem continues to get updated.
“lvcreate--size 100M--snapshot--name snap/dev/vg00/lvol1”创建名为/dev/vg00/snap的快照逻辑卷,
在快照逻辑卷创建时可以访问名为/dev/vg00/lvol1的原始逻辑卷的内容。
如果原始逻辑卷包含文件系统,则可以将快照逻辑卷装载到任意目录上,
以便在原始文件系统继续更新时访问文件系统的内容以运行备份。
"lvcreate --virtualoriginsize 1T --size 100M --snapshot --name sparse vg1"
creates a sparse device named /dev/vg1/sparse of size 1TB with space for
just under 100MB of actual data on it.
“LVCreate-Virtalorigize 1T-size 1000 m-snapshot-name sparse VG1”创建一个
Sparse device named/dev/VG1/sparse of size 1TB with space for just under 100mb of actual data on it.
creates a sparse device named /dev/vg1/sparse of size 1TB with space for
just under 100MB of actual data on it.
“LVCreate-Virtalorigize 1T-size 1000 m-snapshot-name sparse VG1”创建一个
Sparse device named/dev/VG1/sparse of size 1TB with space for just under 100mb of actual data on it.
SEE ALSO/参照
lvm(8), vgcreate(8), lvremove(8), lvrename(8) lvextend(8), lvreduce(8),
lvdisplay(8), lvscan(8)
lvm(8), vgcreate(8), lvremove(8), lvrename(8) lvextend(8), lvreduce(8),
lvdisplay(8), lvscan(8)
Sistina Software UK LVM TOOLS 2.02.46-RHEL5 (2009-06-18) LVCREATE(8)