> man lvm
LVM(8) System Manager's Manual LVM(8) NAME
lvm — LVM2 tools SYNOPSIS
lvm [command|file] DESCRIPTION
The Logical Volume Manager (LVM) provides tools to create virtual block devices from physical devices. Vir‐
tual devices may be easier to manage than physical devices, and can have capabilities beyond what the physi‐
cal devices provide themselves. A Volume Group (VG) is a collection of one or more physical devices, each
called a Physical Volume (PV). A Logical Volume (LV) is a virtual block device that can be used by the sys‐
tem or applications. Each block of data in an LV is stored on one or more PV in the VG, according to algo‐
rithms implemented by Device Mapper (DM) in the kernel. The lvm command, and other commands listed below, are the command-line tools for LVM. A separate manual page
describes each command in detail. If lvm is invoked with no arguments it presents a readline prompt (assuming it was compiled with readline
support). LVM commands may be entered interactively at this prompt with readline facilities including his‐
tory and command name and option completion. Refer to readline(3) for details. If lvm is invoked with argv[0] set to the name of a specific LVM command (for example by using a hard or soft
link) it acts as that command. On invocation, lvm requires that only the standard file descriptors stdin, stdout and stderr are available.
If others are found, they get closed and messages are issued warning about the leak. This warning can be
suppressed by setting the environment variable LVM_SUPPRESS_FD_WARNINGS. Where commands take VG or LV names as arguments, the full path name is optional. An LV called "lvol0" in a
VG called "vg0" can be specified as "vg0/lvol0". Where a list of VGs is required but is left empty, a list
of all VGs will be substituted. Where a list of LVs is required but a VG is given, a list of all the LVs in
that VG will be substituted. So lvdisplay vg0 will display all the LVs in "vg0". Tags can also be used -
see --addtag below. One advantage of using the built-in shell is that configuration information gets cached internally between
commands. A file containing a simple script with one command per line can also be given on the command line. The
script can also be executed directly if the first line is #! followed by the absolute path of lvm. Additional hyphens within option names are ignored. For example, --readonly and --read-only are both
accepted. BUILT-IN COMMANDS
The following commands are built into lvm without links normally being created in the filesystem for them. config The same as lvmconfig(8) below.
devtypes Display the recognised built-in block device types.
dumpconfig The same as lvmconfig(8) below.
formats Display recognised metadata formats.
fullreport Report information about PVs, PV segments, VGs, LVs and LV segments, all at once.
help Display the help text.
lastlog Display log report of last command run in LVM shell if command log reporting is enabled.
lvpoll Complete lvmpolld operations (Internal command).
segtypes Display recognised Logical Volume segment types.
systemid Display any system ID currently set on this host.
tags Display any tags defined on this host.
version Display version information. COMMANDS
The following commands implement the core LVM functionality. pvchange Change attributes of a Physical Volume.
pvck Check Physical Volume metadata.
pvcreate Initialize a disk or partition for use by LVM.
pvdisplay Display attributes of a Physical Volume.
pvmove Move Physical Extents.
pvremove Remove a Physical Volume.
pvresize Resize a disk or partition in use by LVM2.
pvs Report information about Physical Volumes.
pvscan Scan all disks for Physical Volumes.
vgcfgbackup Backup Volume Group descriptor area.
vgcfgrestore Restore Volume Group descriptor area.
vgchange Change attributes of a Volume Group.
vgck Check Volume Group metadata.
vgconvert Convert Volume Group metadata format.
vgcreate Create a Volume Group.
vgdisplay Display attributes of Volume Groups.
vgexport Make volume Groups unknown to the system.
vgextend Add Physical Volumes to a Volume Group.
vgimport Make exported Volume Groups known to the system.
vgimportclone Import and rename duplicated Volume Group (e.g. a hardware snapshot).
vgmerge Merge two Volume Groups.
vgmknodes Recreate Volume Group directory and Logical Volume special files
vgreduce Reduce a Volume Group by removing one or more Physical Volumes.
vgremove Remove a Volume Group.
vgrename Rename a Volume Group.
vgs Report information about Volume Groups.
vgscan Scan all disks for Volume Groups and rebuild caches.
vgsplit Split a Volume Group into two, moving any logical volumes from one Volume Group to another by
moving entire Physical Volumes.
lvchange Change attributes of a Logical Volume.
lvconvert Convert a Logical Volume from linear to mirror or snapshot.
lvcreate Create a Logical Volume in an existing Volume Group.
lvdisplay Display attributes of a Logical Volume.
lvextend Extend the size of a Logical Volume.
lvmconfig Display the configuration information after loading lvm.conf(5) and any other configuration
files.
lvmdiskscan Scan for all devices visible to LVM2.
lvmdump Create lvm2 information dumps for diagnostic purposes.
lvreduce Reduce the size of a Logical Volume.
lvremove Remove a Logical Volume.
lvrename Rename a Logical Volume.
lvresize Resize a Logical Volume.
lvs Report information about Logical Volumes.
lvscan Scan (all disks) for Logical Volumes. The following LVM1 commands are not implemented in LVM2: lvmchange, lvmsadc, lvmsar, pvdata. For performance
metrics, use dmstats(8) or to manipulate the kernel device-mapper driver used by LVM2 directly, use
dmsetup(8). VALID NAMES
The valid characters for VG and LV names are: a-z A-Z 0-9 + _ . - VG names cannot begin with a hyphen. The name of a new LV also cannot begin with a hyphen. However, if the
configuration setting metadata/record_lvs_history is enabled then an LV name with a hyphen as a prefix indi‐
cates that, although the LV was removed, it is still being tracked because it forms part of the history of at
least one LV that is still present. This helps to record the ancestry of thin snapshots even after some
links in the chain have been removed. A reference to the historical LV 'lvol1' in VG 'vg00' would be
'vg00/\-lvol1' or just '-lvol1' if the VG is already set. (The latter form must be preceded by '--' to ter‐
minate command line option processing before reaching this argument.) There are also various reserved names that are used internally by lvm that can not be used as LV or VG names.
A VG cannot be called anything that exists in /dev/ at the time of creation, nor can it be called '.' or
'..'. An LV cannot be called '.', '..', 'snapshot' or 'pvmove'. The LV name may also not contain any of the
following strings: '_cdata', '_cmeta', '_corig', '_mlog', '_mimage', '_pmspare', '_rimage', '_rmeta',
'_tdata', '_tmeta' or '_vorigin'. A directory bearing the name of each Volume Group is created under /dev
when any of its Logical Volumes are activated. Each active Logical Volume is accessible from this directory
as a symbolic link leading to a device node. Links or nodes in /dev/mapper are intended only for internal
use and the precise format and escaping might change between releases and distributions. Other software and
scripts should use the /dev/VolumeGroupName/LogicalVolumeName format to reduce the chance of needing amend‐
ment when the software is updated. Should you need to process the node names in /dev/mapper, you may use
dmsetup splitname to separate out the original VG, LV and internal layer names. UNIQUE NAMES
VG names should be unique. vgcreate will produce an error if the specified VG name matches an existing VG
name. However, there are cases where different VGs with the same name can appear to LVM, e.g. after moving
disks or changing filters. When VGs with the same name exist, commands operating on all VGs will include all of the VGs with the same
name. If the ambiguous VG name is specified on the command line, the command will produce an error. The
error states that multiple VGs exist with the specified name. To process one of the VGs specifically, the
--select option should be used with the UUID of the intended VG: '--select vg_uuid=<uuid>'. An exception is if all but one of the VGs with the shared name is foreign (see lvmsystemid(7).) In this
case, the one VG that is not foreign is assumed to be the intended VG and is processed. LV names are unique within a VG. The name of an historical LV cannot be reused until the historical LV has
itself been removed or renamed. ALLOCATION
When an operation needs to allocate Physical Extents for one or more Logical Volumes, the tools proceed as
follows: First of all, they generate the complete set of unallocated Physical Extents in the Volume Group. If any
ranges of Physical Extents are supplied at the end of the command line, only unallocated Physical Extents
within those ranges on the specified Physical Volumes are considered. Then they try each allocation policy in turn, starting with the strictest policy (contiguous) and ending with
the allocation policy specified using --alloc or set as the default for the particular Logical Volume or Vol‐
ume Group concerned. For each policy, working from the lowest-numbered Logical Extent of the empty Logical
Volume space that needs to be filled, they allocate as much space as possible according to the restrictions
imposed by the policy. If more space is needed, they move on to the next policy. The restrictions are as follows: Contiguous requires that the physical location of any Logical Extent that is not the first Logical Extent of
a Logical Volume is adjacent to the physical location of the Logical Extent immediately preceding it. Cling requires that the Physical Volume used for any Logical Extent to be added to an existing Logical Volume
is already in use by at least one Logical Extent earlier in that Logical Volume. If the configuration param‐
eter allocation/cling_tag_list is defined, then two Physical Volumes are considered to match if any of the
listed tags is present on both Physical Volumes. This allows groups of Physical Volumes with similar proper‐
ties (such as their physical location) to be tagged and treated as equivalent for allocation purposes. When a Logical Volume is striped or mirrored, the above restrictions are applied independently to each stripe
or mirror image (leg) that needs space. Normal will not choose a Physical Extent that shares the same Physical Volume as a Logical Extent already
allocated to a parallel Logical Volume (i.e. a different stripe or mirror image/leg) at the same offset
within that parallel Logical Volume. When allocating a mirror log at the same time as Logical Volumes to hold the mirror data, Normal will first
try to select different Physical Volumes for the log and the data. If that's not possible and the alloca‐
tion/mirror_logs_require_separate_pvs configuration parameter is set to 0, it will then allow the log to
share Physical Volume(s) with part of the data. When allocating thin pool metadata, similar considerations to those of a mirror log in the last paragraph
apply based on the value of the allocation/thin_pool_metadata_require_separate_pvs configuration parameter. If you rely upon any layout behaviour beyond that documented here, be aware that it might change in future
versions of the code. For example, if you supply on the command line two empty Physical Volumes that have an identical number of
free Physical Extents available for allocation, the current code considers using each of them in the order
they are listed, but there is no guarantee that future releases will maintain that property. If it is impor‐
tant to obtain a specific layout for a particular Logical Volume, then you should build it up through a
sequence of lvcreate(8) and lvconvert(8) steps such that the restrictions described above applied to each
step leave the tools no discretion over the layout. To view the way the allocation process currently works in any specific case, read the debug logging output,
for example by adding -vvvv to a command. LOGICAL VOLUME TYPES
Some logical volume types are simple to create and can be done with a single lvcreate(8) command. The linear
and striped logical volume types are an example of this. Other logical volume types may require more than
one command to create. The cache (lvmcache(7)) and thin provisioning (lvmthin(7)) types are examples of
this. DIAGNOSTICS
All tools return a status code of zero on success or non-zero on failure. The non-zero codes distinguish
only between the broad categories of unrecognised commands, problems processing the command line arguments
and any other failures. As LVM remains under active development, the code used in a specific case occasion‐
ally changes between releases. Message text may also change. ENVIRONMENT VARIABLES
HOME Directory containing .lvm_history if the internal readline shell is invoked. LVM_OUT_FD
File descriptor to use for common output from LVM commands. LVM_ERR_FD
File descriptor to use for error output from LVM commands. LVM_REPORT_FD
File descriptor to use for report output from LVM commands. LVM_COMMAND_PROFILE
Name of default command profile to use for LVM commands. This profile is overriden by direct use of
--commandprofile command line option. LVM_RUN_BY_DMEVENTD
This variable is normally set by dmeventd plugin to inform lvm2 command it is running from dmeventd
plugin so lvm2 takes some extra action to avoid comunication and deadlocks with dmeventd. LVM_SYSTEM_DIR
Directory containing lvm.conf(5) and other LVM system files. Defaults to "/etc/lvm". LVM_SUPPRESS_FD_WARNINGS
Suppress warnings about unexpected file descriptors passed into LVM. LVM_VG_NAME
The Volume Group name that is assumed for any reference to a Logical Volume that doesn't specify a
path. Not set by default. LVM_LVMETAD_PIDFILE
Path to the file that stores the lvmetad process ID. LVM_LVMETAD_SOCKET
Path to the socket used to communicate with lvmetad. LVM_LVMPOLLD_PIDFILE
Path to the file that stores the lvmpolld process ID. LVM_LVMPOLLD_SOCKET
Path to the socket used to communicate with lvmpolld.. LVM_LOG_FILE_EPOCH
A string of up to 32 letters appended to the log filename and followed by the process ID and a startup
timestamp using this format string "_%s_%d_%llu". When set, each process logs to a separate file. LVM_LOG_FILE_MAX_LINES
If more than this number of lines are sent to the log file, the command gets aborted. Automated tests
use this to terminate looping commands. LVM_EXPECTED_EXIT_STATUS
The status anticipated when the process exits. Use ">N" to match any status greater than N. If the
actual exit status matches and a log file got produced, it is deleted. LVM_LOG_FILE_EPOCH and
LVM_EXPECTED_EXIT_STATUS together allow automated test scripts to discard uninteresting log data. LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES
Used to suppress warning messages when the configured locking is known to be unavailable. DM_ABORT_ON_INTERNAL_ERRORS
Abort processing if the code detects a non-fatal internal error. DM_DISABLE_UDEV
Avoid interaction with udev. LVM will manage the relevant nodes in /dev directly. FILES
/etc/lvm/lvm.conf
$HOME/.lvm_history SEE ALSO
lvm(8) lvm.conf(5) lvmconfig(8) pvchange(8) pvck(8) pvcreate(8) pvdisplay(8) pvmove(8) pvremove(8) pvresize(8) pvs(8) pvscan(8) vgcfgbackup(8) vgcfgrestore(8) vgchange(8) vgck(8) vgcreate(8) vgconvert(8) vgdisplay(8) vgexport(8)
vgextend(8) vgimport(8) vgimportclone(8) vgmerge(8) vgmknodes(8) vgreduce(8) vgremove(8) vgrename(8) vgs(8)
vgscan(8) vgsplit(8) lvcreate(8) lvchange(8) lvconvert(8) lvdisplay(8) lvextend(8) lvreduce(8) lvremove(8) lvrename(8) lvresize(8)
lvs(8) lvscan(8) lvm-fullreport(8) lvm-lvpoll(8) lvm2-activation-generator(8) blkdeactivate(8) lvmdump(8) dmeventd(8) lvmetad(8) lvmpolld(8) lvmlockd(8) lvmlockctl(8) clvmd(8) cmirrord(8) lvmdbusd(8) lvmsystemid(7) lvmreport(7) lvmraid(7) lvmthin(7) lvmcache(7) dmsetup(8), dmstats(8), readline(3) Red Hat, Inc. LVM TOOLS 2.02.171(2)-RHEL7 (2017-05-03) LVM(8)

LVM man帮助的更多相关文章

  1. Linux LVM逻辑卷配置过程详解

    许多Linux使用者安装操作系统时都会遇到这样的困境:如何精确评估和分配各个硬盘分区的容量,如果当初评估不准确,一旦系统分区不够用时可能不得不备份.删除相关数据,甚至被迫重新规划分区并重装操作系统,以 ...

  2. linux下 lvm 磁盘扩容

    打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...

  3. LVM基本介绍与常用命令

    一.LVM介绍LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制LVM - 优点:LVM通常用于装备大量磁盘的系统,但它同样适 ...

  4. Linux归档压缩、分区管理与LVM管理

    归档和压缩命令: 命令格式: gzip [-9] 文件名 bzip2 [-9] 文件名 gzip –d .gz格式的压缩文件 bzip2 –d .bz2格式的压缩文件 选项: -9:高压缩比,多用于压 ...

  5. 2.lvm动态逻辑卷

    Lvm动态逻辑卷 一.             基本概念 LVM 把实际的物理磁盘数据映射到一个简单而灵活的虚拟逻辑存储视图上,藉以控制磁盘资源: 也就是重新考虑了管理文件系统和卷的方法,在文件系统管 ...

  6. Linux LVM学习总结——扩展卷组VG

    Linux服务器由于应用变更或需求的缘故,有可能出现分区空间不足的情况,此时往往需要进行扩容(要增加分区的空间),而采用LVM的好处就是可以在不需停机的情况下可以方便地调整各个分区大小.如下所示,分区 ...

  7. LVM 管理减少swap分区空间增加到根分区

    简介 LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制,它由Heinz Mauelshagen在Linux 2.4内核上实现 ...

  8. archlinux安裝手记(Win10+Arch、GPT+UEFI、lvm)

    准备工具和设置制作启动盘连接网络硬盘分区规划分区LVM方案创建文件系统分区挂载激活lvm2钩子基础安装和配置配置镜像源基础系统安装fstab进入系统initramfs引导程序网络搭建使用环境用户管理用 ...

  9. parted LVM划分4T磁盘,在线扩展1.5T

      磁盘分区: parted /dev/emcpowera (parted) print Model: Unknown (unknown) Disk /dev/emcpowera: 4398GB Se ...

  10. Linux LVM逻辑卷

    概述 LVM的产生是因为传统的分区一旦分区好后就无法在线扩充空间,也存在一些工具能实现在线扩充空间但是还是会面临数据损坏的风险:传统的分区当分区空间不足时,一般的解决办法是再创建一个更大的分区将原分区 ...

随机推荐

  1. HDU 4528

    一直在纠结怎么样表示找到了人,,,开始时竟灰笨得设两个BOOL.后来参考别人的可以使用二进制位. 另外,此处有一个剪枝就是,就到达该点之后的状态的found(即找到人的状态)在之前已出现过,可以剪去. ...

  2. java 线程 错失的信号、notify() 与notifyAll的使用

    package org.rui.thread.block; import java.util.Timer; import java.util.TimerTask; import java.util.c ...

  3. cocos2d-android学习四 ---- 精灵的创建

    上篇文章我们创建了一个黑乎乎的界面.以下我们就给它增加一个精灵. 我们这次就一起来学习精灵的基础知识. 1.什么是精灵 游戏中全部会动的对象都是精灵,能够是主人公,背景元素,一个子弹或者是敌人. 一个 ...

  4. 学习Mockito - Mockito对Annotation的支持

    学习Mockito - Mockito对Annotation的支持 博客分类: test junit工作  Mockito支持对变量进行注解,例如将mock对象设为测试类的属性,然后通过注解的方式@M ...

  5. SPOJ COWPIC(逆序对变形题)

    SPOJ COWPIC 题目链接 题意:一个序列,相邻能够交换.问最少交换几次使得变成循环的1-n的当中一种 思路:对于原来正常的变换成1-n而言,答案就是逆序对了,而多了这么一个变形,事实上仅仅须要 ...

  6. 曲线控件我一直用codeproject上的那几个(C++ 100款开源界面库)

    Alberl#23楼[楼主] 2013-11-04 11:47 Alberl @baita00引用看了大神的教程,真的不错,学习了很多东西,^_^.这节教程里,大神好像在找曲线控件,是吗?大神有什特殊 ...

  7. SimpleMappingExceptionResolver异常映射

    转自:https://blog.csdn.net/qqqqqq654/article/details/65767701 SimpleMappingException异常映射 当异常发生时,我们可以将它 ...

  8. 备份SQL SERVER 2005数据库

  9. hiho一下 第174周

    题目1 : Dice Possibility 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 What is possibility of rolling N dice ...

  10. python课程设计笔记(四)整数、浮点数与字符串 time库

    整数类型(范围无限制) 十进制1 -1 二进制0b1 -0b1 八进制0o1 -0o1 十六进制0x1 -0x1 浮点类型(范围有限制但可忽略) 运算存在不确定尾数 :0.1+0.2!=0.3 原因: ...