LVM(8)

NAME
lvm - LVM2 tools

SYNOPSIS
lvm [command | file]

DESCRIPTION
lvm provides the command-line tools for LVM2. 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 history 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.

One advantage of using the built-in shell is that configuration information is 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.

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". If a list of VGs is required but is left empty, a list of all VGs will be substituted. If 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".

OPTIONS
The following options are available for many of the commands and are not documented on individual manual pages.

-h | --help — Display the help text.

--version — Display version information.

-v | --verbose — Set verbose level.
    Repeat from 1 to 3 times to increase the detail of messages sent to stdout and stderr. Overrides config file setting.

-d | --debug — Set debug level.
    Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). Overrides config file setting.

--quiet — Suppress output and log messages.
    Overrides -d and -v.

-t | --test — Run in test mode.
    Commands will not update metadata.

--driverloaded { y | n }
    Whether or not the device-mapper kernel driver is loaded. If you set this to n, no attempt will be made to contact the driver.

-A | --autobackup { y | n }
    Whether or not to metadata should be backed up automatically after a change. You are strongly advised not to disable this! See vgcfgbackup (8).

-P | --partial
    When set, the tools will do their best to provide access to volume groups that are only partially available. Where part of a logical volume is missing, /dev/ioerror will be substituted, and you could use dmsetup (8) to set this up to return I/O errors when accessed, or create it as a large block device of nulls. Metadata may not be changed with this option. To insert a replacement physical volume of the same or large size use pvcreate -u to set the uuid to match the original followed by vgcfgrestore (8).

--ignorelockingfailure
    This lets you proceed with read-only metadata operations such as lvchange -ay and vgchange -ay even if the locking module fails. One use for this is in a system init script if the lock directory is mounted read-only when the script runs.

ENVIRONMENT VARIABLES

LVM_SYSTEM_DIR
    Directory containing lvm.conf and other LVM system files. Defaults to "/etc/lvm".

HOME
    Directory containing .lvm_history if the internal readline shell is invoked.

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.

DIAGNOSTICS
All tools return a status code of zero on success or non-zero on failure.

FILES
/etc/lvm/lvm.conf
$HOME/.lvm_history

SEE ALSO
lvchange(8), lvcreate(8), lvdisplay(8), lvextend(8), lvmchange(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvscan(8), pvchange(8), pvcreate(8), pvdisplay(8), pvscan(8), vgcfgbackup(8), vgchange(8), vgck(8), vgcreate(8), vgdisplay(8), vgextend(8), vgmerge(8), vgreduce(8), vgremove(8), vgrename(8), vgscan(8), readline(3), lvm.conf(5)