1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/man/lvm.8

307 lines
11 KiB
Groff
Raw Normal View History

2001-12-31 20:20:22 +03:00
.TH LVM 8 "LVM TOOLS" "Sistina Software UK" \" -*- nroff -*-
.SH NAME
lvm \- LVM2 tools
.SH SYNOPSIS
.B lvm
2002-01-04 21:56:56 +03:00
[command | file]
2001-12-31 20:20:22 +03:00
.SH DESCRIPTION
2002-01-04 21:56:56 +03:00
\fBlvm\fP provides the command-line tools for LVM2. A separate
manual page describes each command in detail.
.LP
If \fBlvm\fP 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 \fBreadline\fP(3) for details.
.LP
If \fBlvm\fP 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.
.LP
2004-11-12 18:59:09 +03:00
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 \fBaddtag\fP below.
.LP
2002-01-04 21:56:56 +03:00
One advantage of using the built-in shell is that configuration
2004-11-12 18:59:09 +03:00
information gets cached internally between commands.
2002-01-04 21:56:56 +03:00
.LP
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 \fBlvm\fP.
2004-11-12 18:59:09 +03:00
.SH BUILT-IN COMMANDS
The following commands are built into lvm without links normally
being created in the filesystem for them.
.TP
\fBdumpconfig\fP \(em Display the configuration information after
2006-08-19 02:35:59 +04:00
loading \fBlvm.conf\fP (5) and any other configuration files.
2004-11-12 18:59:09 +03:00
.TP
\fBformats\fP \(em Display recognised metadata formats.
.TP
\fBhelp\fP \(em Display the help text.
.TP
\fBpvdata\fP \(em Not implemented in LVM2.
.TP
\fBsegtypes\fP \(em Display recognised logical volume segment types.
.TP
\fBversion\fP \(em Display version information.
2002-11-18 17:04:08 +03:00
.LP
.SH COMMANDS
The following commands implement the core LVM functionality.
.TP
\fBpvchange\fP \(em Change attributes of a physical volume.
.TP
\fBpvck\fP \(em Check physical volume metadata.
.TP
\fBpvcreate\fP \(em Initialize a disk or partition for use by LVM.
.TP
\fBpvdisplay\fP \(em Display attributes of a physical volume.
.TP
\fBpvmove\fP \(em Move physical extents.
.TP
\fBpvremove\fP \(em Remove a physical volume.
.TP
\fBpvresize\fP \(em Resize a disk or partition in use by LVM2.
.TP
\fBpvs\fP \(em Report information about physical volumes.
.TP
\fBpvscan\fP \(em Scan all disks for physical volumes.
.TP
\fBvgcfgbackup\fP \(em Backup volume group descriptor area.
.TP
\fBvgcfgrestore\fP \(em Restore volume group descriptor area.
.TP
\fBvgchange\fP \(em Change attributes of a volume group.
.TP
\fBvgck\fP \(em Check volume group metadata.
.TP
\fBvgconvert\fP \(em Convert volume group metadata format.
.TP
\fBvgcreate\fP \(em Create a volume group.
.TP
\fBvgdisplay\fP \(em Display attributes of volume groups.
.TP
\fBvgexport\fP \(em Make volume groups unknown to the system.
.TP
\fBvgextend\fP \(em Add physical volumes to a volume group.
.TP
\fBvgimport\fP \(em Make exported volume groups known to the system.
.TP
\fBvgmerge\fP \(em Merge two volume groups.
.TP
\fBvgmknodes\fP \(em Recreate volume group directory and logical volume special files
.TP
\fBvgreduce\fP \(em Reduce a volume group by removing one or more physical volumes.
.TP
\fBvgremove\fP \(em Remove a volume group.
.TP
\fBvgrename\fP \(em Rename a volume group.
.TP
\fBvgs\fP \(em Report information about volume groups.
.TP
\fBvgscan\fP \(em Scan all disks for volume groups and rebuild caches.
.TP
\fBvgsplit\fP \(em Split a volume group into two, moving any logical volumes from one volume group to another by moving entire physical volumes.
.TP
\fBlvchange\fP \(em Change attributes of a logical volume.
.TP
\fBlvconvert\fP \(em Convert a logical volume from linear to mirror or snapshot.
.TP
\fBlvcreate\fP \(em Create a logical volume in an existing volume group.
.TP
\fBlvdisplay\fP \(em Display attributes of a logical volume.
.TP
\fBlvextend\fP \(em Extend the size of a logical volume.
.TP
\fBlvmchange\fP \(em Change attributes of the logical volume manager.
.TP
\fBlvmdiskscan\fP \(em Scan for all devices visible to LVM2.
.TP
\fBlvmdump\fP \(em Create lvm2 information dumps for diagnostic purposes.
.TP
\fBlvreduce\fP \(em Reduce the size of a logical volume.
.TP
\fBlvremove\fP \(em Remove a logical volume.
.TP
\fBlvrename\fP \(em Rename a logical volume.
.TP
\fBlvresize\fP \(em Resize a logical volume.
.TP
\fBlvs\fP \(em Report information about logical volumes.
.TP
\fBlvscan\fP \(em Scan (all disks) for logical volumes.
.TP
2008-01-11 23:24:25 +03:00
The following commands are not implemented in LVM2 but might be in the future: lvmsadc, lvmsar, pvdata.
.SH OPTIONS
2004-11-12 18:59:09 +03:00
The following options are available for many of the commands.
They are implemented generically and documented here rather
than repeated on individual manual pages.
.TP
\fB-h | --help\fP \(em Display the help text.
.TP
2002-11-18 17:04:08 +03:00
\fB--version\fP \(em Display version information.
.TP
\fB-v | --verbose\fP \(em Set verbose level.
2002-11-18 17:04:08 +03:00
Repeat from 1 to 3 times to increase the detail of messages
sent to stdout and stderr. Overrides config file setting.
.TP
\fB-d | --debug\fP \(em Set debug level.
2002-11-18 17:04:08 +03:00
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.
.TP
\fB--quiet\fP \(em Suppress output and log messages.
Overrides -d and -v.
2002-11-18 17:04:08 +03:00
.TP
\fB-t | --test\fP \(em Run in test mode.
Commands will not update metadata.
2004-11-12 18:59:09 +03:00
This is implemented by disabling all metadata writing but nevertheless
returning success to the calling function. This may lead to unusual
error messages in multi-stage operations if a tool relies on reading
back metadata it believes has changed but hasn't.
2002-11-18 17:04:08 +03:00
.TP
\fB--driverloaded\fP { \fBy\fP | \fBn\fP }
Whether or not the device-mapper kernel driver is loaded.
If you set this to \fBn\fP, no attempt will be made to contact the driver.
.TP
\fB-A | --autobackup\fP { \fBy\fP | \fBn\fP }
Whether or not to metadata should be backed up automatically after a change.
You are strongly advised not to disable this!
See
.B vgcfgbackup (8).
.TP
\fB-P | --partial\fP
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, \fB/dev/ioerror\fP will be substituted, and you could use
\fBdmsetup (8)\fP 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 \fBpvcreate -u\fP to set the uuid to
match the original followed by \fBvgcfgrestore (8)\fP.
.TP
2004-03-22 18:08:50 +03:00
\fB-M | --metadatatype type\fP
Specifies which type of on-disk metadata to use, such as \fBlvm1\fP
or \fBlvm2\fP, which can be abbreviated to \fB1\fP or \fB2\fP respectively.
The default (lvm2) can be changed by setting \fBformat\fP in the \fBglobal\fP
section of the config file.
.TP
2002-11-18 17:04:08 +03:00
\fB--ignorelockingfailure\fP
This lets you proceed with read-only metadata operations such as
\fBlvchange -ay\fP and \fBvgchange -ay\fP 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.
2004-03-22 18:08:50 +03:00
.TP
\fB--addtag tag\fP
Add the tag \fBtag\fP to a PV, VG or LV.
A tag is a word that can be used to group LVM2 objects of the same type
together.
Tags can be given on the command line in place of PV, VG or LV
arguments. Tags should be prefixed with @ to avoid ambiguity.
Each tag is expanded by replacing it with all objects possessing
that tag which are of the type expected by its position on the command line.
PVs can only possess tags while they are part of a Volume Group:
PV tags are discarded if the PV is removed from the VG.
As an example, you could tag some LVs as \fBdatabase\fP and others
as \fBuserdata\fP and then activate the database ones
with \fBlvchange -ay @database\fP.
Objects can possess multiple tags simultaneously.
Only the new LVM2 metadata format supports tagging: objects using the
LVM1 metadata format cannot be tagged because the on-disk format does not
support it.
Snapshots cannot be tagged.
Characters allowed in tags are: A-Z a-z 0-9 _ + . -
.TP
\fB--deltag tag\fP
Delete the tag \fBtag\fP from a PV, VG or LV, if it's present.
2004-11-16 21:09:32 +03:00
.TP
\fB--alloc AllocationPolicy\fP
2006-10-08 16:01:13 +04:00
The allocation policy to use: \fBcontiguous\fP, \fBcling\fP, \fBnormal\fP, \fBanywhere\fP or \fBinherit\fP.
2004-11-16 21:09:32 +03:00
When a command needs to allocate physical extents from the volume group,
the allocation policy controls how they are chosen.
Each volume group and logical volume has an allocation policy.
The default for a volume group is \fBnormal\fP which applies
common-sense rules such as not placing parallel stripes on the same
physical volume. The default for a logical volume is \fBinherit\fP
which applies the same policy as for the volume group. These policies can
be changed using \fBlvchange\fP (8) and \fBvgchange\fP (8) or over-ridden
on the command line of any command that performs allocation.
2006-10-08 16:01:13 +04:00
The \fBcontiguous\fP policy requires that new extents be placed adjacent
to existing extents.
The \fBcling\fP policy places new extents on the same physical
volume as existing extents in the same stripe of the Logical Volume.
If there are sufficient free extents to satisfy
2004-11-16 21:09:32 +03:00
an allocation request but \fBnormal\fP doesn't use them,
\fBanywhere\fP will - even if that reduces performance by
placing two stripes on the same physical volume.
.IP
N.B. The policies described above are not implemented fully yet.
2006-10-08 16:01:13 +04:00
In particular, contiguous free space cannot be broken up to
satisfy allocation attempts.
2002-01-04 21:56:56 +03:00
.SH ENVIRONMENT VARIABLES
.TP
\fBLVM_SYSTEM_DIR\fP
Directory containing lvm.conf and other LVM
system files.
Defaults to "/etc/lvm".
.TP
\fBHOME\fP
2002-11-18 17:04:08 +03:00
Directory containing .lvm_history if the internal readline shell
2002-01-04 21:56:56 +03:00
is invoked.
.TP
\fBLVM_VG_NAME\fP
The volume group name that is assumed for
any reference to a logical volume that doesn't specify a path.
Not set by default.
.SH DIAGNOSTICS
All tools return a status code of zero on success or non-zero on failure.
2001-12-31 20:20:22 +03:00
.SH FILES
.I /etc/lvm/lvm.conf
.br
.I $HOME/.lvm_history
.SH SEE ALSO
2004-11-12 18:59:09 +03:00
.BR clvmd (8),
.BR lvchange (8),
.BR lvcreate (8),
.BR lvdisplay (8),
.BR lvextend (8),
.BR lvmchange (8),
2004-11-12 18:59:09 +03:00
.BR lvmdiskscan (8),
.BR lvreduce (8),
.BR lvremove (8),
.BR lvrename (8),
.BR lvresize (8),
2004-11-12 18:59:09 +03:00
.BR lvs (8),
.BR lvscan (8),
.BR pvchange (8),
.BR pvck (8),
.BR pvcreate (8),
.BR pvdisplay (8),
2004-11-12 18:59:09 +03:00
.BR pvmove (8),
.BR pvremove (8),
.BR pvs (8),
.BR pvscan (8),
.BR vgcfgbackup (8),
.BR vgchange (8),
.BR vgck (8),
2004-11-12 18:59:09 +03:00
.BR vgconvert (8),
.BR vgcreate (8),
.BR vgdisplay (8),
.BR vgextend (8),
2004-11-12 18:59:09 +03:00
.BR vgimport (8),
.BR vgmerge (8),
2004-11-12 18:59:09 +03:00
.BR vgmknodes (8),
.BR vgreduce (8),
.BR vgremove (8),
.BR vgrename (8),
2004-11-12 18:59:09 +03:00
.BR vgs (8),
.BR vgscan (8),
2004-11-12 18:59:09 +03:00
.BR vgsplit (8),
2002-01-04 21:56:56 +03:00
.BR readline (3),
.BR lvm.conf (5)