1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-29 13:44:18 +03:00

Compare commits

..

6 Commits

Author SHA1 Message Date
David Teigland
0a0d991bb5 lvm shell: clear argv for each command 2017-01-13 12:04:25 -06:00
David Teigland
f98b4f3dc2 help: accept positional args
lvm help <commandname> ...
2017-01-13 12:04:24 -06:00
David Teigland
46ad67b31c fix lvmcmdline warning
declaration of ‘usage’ shadows a globa
2017-01-13 12:04:24 -06:00
David Teigland
6c0dbea70a Makefile: clean up create-command parts 2017-01-13 12:04:19 -06:00
David Teigland
4e9ca81960 man lvm: remove options
all options are now included in commands
2017-01-13 12:04:19 -06:00
David Teigland
bb1f0db3a6 args: add man page descriptions 2017-01-12 16:05:16 -06:00
7 changed files with 702 additions and 368 deletions

View File

@@ -45,6 +45,9 @@ 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.
.P
Additional hyphens within option names are ignored. For example,
\fB\-\-readonly\fP and \fB\-\-read\-only\fP are both accepted.
.
.SH BUILT-IN COMMANDS
.
@@ -238,261 +241,6 @@ The following commands are not implemented in LVM2 but might be
in the future:
.BR lvmsadc ", " lvmsar ", " pvdata .
.
.SH OPTIONS
.
The following options are available for many of the commands.
They are implemented generically and documented here rather
than repeated on individual manual pages.
.P
Additional hyphens within option names are ignored. For example,
\fB\-\-readonly\fP and \fB\-\-read\-only\fP are both accepted.
.
.HP
.BR \-h | \-? | \-\-help
.br
Display the help text.
.
.HP
.BR \-\-version
.br
Display version information.
.
.HP
.BR \-v | \-\-verbose
.br
Set verbose level. Repeat from 1 to 3 times to increase the detail
of messages sent to stdout and stderr. Overrides config file setting.
.
.HP
.BR \-d | \-\-debug
.br
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.
.
.HP
.BR \-q | \-\-quiet
.br
Suppress output and log messages.
Overrides \fB\-d\fP and \fB\-v\fP.
Repeat once to also suppress any prompts with answer 'no'.
.
.HP
.BR \-\-yes
.br
Don't prompt for confirmation interactively but instead always assume the
answer is 'yes'. Take great care if you use this!
.
.HP
.BR \-t | \-\-test
.br
Run in test mode. Commands will not update metadata.
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.
.
.HP
.BR \-\-driverloaded
.RB { y | n }
.br
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.
.
.HP
.BR \-A | \-\-autobackup
.RB { y | n }
.br
Whether or not to metadata should be backed up automatically after a change.
You are strongly advised not to disable this!
See \fBvgcfgbackup\fP(8).
.
.HP
.BR \-P | \-\-partial
.br
When set, the tools will do their best to provide access to Volume Groups
that are only partially available (one or more Physical Volumes belonging
to the Volume Group are missing from the system). Where part of a logical
volume is missing, \fI\%/dev/ioerror\fP will be substituted, and you could use
\fBdmsetup\fP(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 \fBpvcreate \-u\fP to set the uuid to
match the original followed by \fBvgcfgrestore\fP(8).
.
.HP
.BR \-S | \-\-select
.IR Selection
.br
For reporting commands, display only rows that match \fISelection\fP criteria.
All rows are displayed with the additional "selected" column (\fB-o selected\fP)
showing 1 if the row matches the \fISelection\fP and 0 otherwise. For non-reporting
commands which process LVM entities, the selection can be used to match items
to process. See \fBSelection\fP section in \fBlvmreport\fP(7) man page for more
information about the way the selection criteria are constructed.
.
.HP
.BR \-M | \-\-metadatatype
.IR Type
.br
Specifies which \fItype\fP 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 (\fBlvm2\fP) can be changed by setting \fBformat\fP
in the \fBglobal\fP section of the config file \fBlvm.conf\fP(5).
.
.HP
.BR \-\-ignorelockingfailure
.br
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.
.
.HP
.BR \-\-ignoreskippedcluster
.br
Use to avoid exiting with an non-zero status code if the command is run
without clustered locking and some clustered Volume Groups have to be
skipped over.
.
.HP
.BR \-\-readonly
.br
Run the command in a special read-only mode which will read on-disk
metadata without needing to take any locks. This can be used to peek
inside metadata used by a virtual machine image while the virtual
machine is running.
It can also be used to peek inside the metadata of clustered Volume
Groups when clustered locking is not configured or running. No attempt
will be made to communicate with the device-mapper kernel driver, so
this option is unable to report whether or not Logical Volumes are
actually in use.
.
.HP
.BR \-\-foreign
.br
Cause the command to access foreign VGs, that would otherwise be skipped.
It can be used to report or display a VG that is owned by another host.
This option can cause a command to perform poorly because lvmetad caching
is not used and metadata is read from disks.
.
.HP
.BR \-\-shared
.br
Cause the command to access shared VGs, that would otherwise be skipped
when lvmlockd is not being used. It can be used to report or display a
lockd VG without locking. Applicable only if LVM is compiled with lockd
support.
.
.HP
.BR \-\-addtag
.IR Tag
.br
Add the tag \fITag\fP to a PV, VG or LV.
Supply this argument multiple times to add more than one tag at once.
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.
Characters allowed in tags are:
.BR A - Z
.BR a - z
.BR 0 - 9
.BR "_ + . -"
and as of version 2.02.78 the following characters are also accepted:
.BR "/ = ! : # &" .
.
.HP
.BR \-\-deltag
.IR Tag
.br
Delete the tag \fITag\fP from a PV, VG or LV, if it's present.
Supply this argument multiple times to remove more than one tag at once.
.
.HP
.BR \-\-alloc
.RB { anywhere | contiguous | cling | inherit | normal }
.br
Selects the allocation policy when a command needs to allocate
Physical Extents from the Volume Group.
Each Volume Group and Logical Volume has an allocation policy defined.
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 overridden
on the command line of any command that performs allocation.
The \fBcontiguous\fP policy requires that new Physical Extents be placed adjacent
to existing Physical Extents.
The \fBcling\fP policy places new Physical Extents on the same Physical
Volume as existing Physical Extents in the same stripe of the Logical Volume.
If there are sufficient free Physical Extents to satisfy
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.
.
.HP
.BR \-\-commandprofile
.IR ProfileName
.br
Selects the command configuration profile to use when processing an LVM command.
See also \fBlvm.conf\fP(5) for more information about \fBcommand profile config\fP and
the way it fits with other LVM configuration methods. Using \fB\-\-commandprofile\fP
option overrides any command profile specified via \fBLVM_COMMAND_PROFILE\fP
environment variable.
.
.HP
.BR \-\-metadataprofile
.IR ProfileName
.br
Selects the metadata configuration profile to use when processing an LVM command.
When using metadata profile during Volume Group or Logical Volume creation,
the metadata profile name is saved in metadata. When such Volume Group or Logical
Volume is processed next time, the metadata profile is automatically applied
and the use of \fB\-\-metadataprofile\fP option is not necessary. See also
\fBlvm.conf\fP(5) for more information about \fBmetadata profile config\fP and the
way it fits with other LVM configuration methods.
.
.HP
.BR \-\-profile
.IR ProfileName
.br
A short form of \fB\-\-metadataprofile\fP for \fBvgcreate\fP, \fBlvcreate\fP,
\fBvgchange\fP and \fBlvchange\fP command and a short form of \fB\-\-commandprofile\fP
for any other command (with the exception of \fBlvmconfig\fP command where the
\fB\-\-profile\fP has special meaning, see \fBlvmconfig\fP(8) for more information).
.
.HP
.BR \-\-reportformat
.IR {basic|json}
.br
Overrides current output format for reports which is defined globally by
\fBreport/output_format\fP configuration setting in \fBlvm.conf\fP(5).
The \fBbasic\fP format is the original format with columns and rows and
if there is more than one report per command, each report is prefixed
with report's name for identification. The \fBjson\fP stands for report
output in JSON format.
.HP
.BR \-\-config
.IR ConfigurationString
.br
Uses the ConfigurationString as direct string representation of the configuration
to override the existing configuration. The ConfigurationString is of exactly
the same format as used in any LVM configuration file. See \fBlvm.conf\fP(5)
for more information about \fBdirect config override on command line\fP and the
way it fits with other LVM configuration methods.
.
.SH VALID NAMES
.
The valid characters for VG and LV names are:

View File

@@ -1,3 +1,4 @@
#
# Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
# Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
@@ -140,6 +141,8 @@ all: device-mapper
CFLAGS_lvm.o += $(EXTRA_EXEC_CFLAGS)
CFLAGS_lvmcmdline.o += $(VALGRIND_CFLAGS)
INCLUDES += -I$(top_builddir)/tools
lvm: $(OBJECTS) lvm.o $(top_builddir)/lib/liblvm-internal.a
$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) -o $@ $(OBJECTS) lvm.o \
$(LVMLIBS) $(READLINE_LIBS) $(LIBS) -rdynamic
@@ -173,12 +176,35 @@ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX)
$(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \
egrep -v '^ *(|#.*|config|devtypes|dumpconfig|formats|fullreport|help|lastlog|lvpoll|pvdata|segtypes|systemid|tags|version) *$$' > .commands
ccmd: create-commands.c
$(CC) create-commands.c -o ccmd
ccmd: $(srcdir)/create-commands.c
$(CC) $(srcdir)/create-commands.c -o ccmd
command-lines.h: ccmd
./ccmd --output struct command-lines.in > command-lines.h
./ccmd --output count command-lines.in > command-lines-count.h
.DELETE_ON_ERROR:
command-lines.h: $(srcdir)/command-lines.in ccmd
$(top_builddir)/tools/ccmd --output struct $(srcdir)/command-lines.in > $@
command-lines-count.h: $(srcdir)/command-lines.in ccmd
$(top_builddir)/tools/ccmd --output count $(srcdir)/command-lines.in > $@
# move properly to configure
WC = /usr/bin/wc
GREP = /bin/grep
SORT = /bin/sort
CUT = /bin/cut
SED = /bin/sed
# FIXME Add licence text from template file
command-lines-count-new.h: $(srcdir)/command-lines.in ccmd Makefile
set -o pipefail && \
(echo -n "#define COMMAND_COUNT " && \
$(GREP) '^ID:' $(srcdir)/command-lines.in | $(WC) -l && \
echo -e "enum {\n\tno_CMD," && \
$(GREP) '^ID:' $(srcdir)/command-lines.in | $(CUT) -d\ -f2 | $(SORT) -u | $(SED) 's/\(.*\)/\t&_CMD,/' && \
echo -e "\tCOMMAND_ID_COUNT,\n};" \
) > $@
$(SOURCES:%.c=%.d): command-lines.h command-lines-count.h
ifneq ("$(CFLOW_CMD)", "")
CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))

View File

@@ -61,7 +61,8 @@ arg(alloc_ARG, '\0', "alloc", alloc_VAL, 0, 0,
"use them, \\fBanywhere\\fP will use them even if it reduces performance,\n"
"e.g. by placing two stripes on the same PV.\n"
"Optional positional PV args on the command line can also be used to limit\n"
"which PVs the command will use for allocation.\n")
"which PVs the command will use for allocation.\n"
"See lvm(8) for more information about allocation.\n")
arg(atomic_ARG, '\0', "atomic", 0, 0, 0,
"Makes a pvmove operation atomic, ensuring that all affected LVs are\n"
@@ -175,7 +176,12 @@ arg(errorwhenfull_ARG, '\0', "errorwhenfull", bool_VAL, 0, 0,
"Errors are returned if no space is available after the timeout.\n"
"(Also see dm-thin-pool kernel module option no_space_timeout.)\n")
arg(force_long_ARG, '\0', "force", 0, ARG_COUNTABLE, 0, NULL)
arg(force_long_ARG, '\0', "force", 0, ARG_COUNTABLE, 0,
"Force metadata restore even with thin pool LVs.\n"
"Use with extreme caution. Most changes to thin metadata\n"
"cannot be reverted.\n"
"You may lose data if you restore metadata that does not match the\n"
"thin pool kernel metadata precisely.\n")
arg(foreign_ARG, '\0', "foreign", 0, 0, 0,
"Report/display foreign VGs that would otherwise be skipped.\n"
@@ -301,7 +307,11 @@ arg(metadatasize_ARG, '\0', "metadatasize", sizemb_VAL, 0, 0,
"The size may be rounded.\n")
arg(minor_ARG, '\0', "minor", number_VAL, ARG_GROUPABLE, 0,
"A block device minor number.\n")
"#lvcreate\n"
"#lvchange\n"
"Sets the minor number of an LV block device.\n"
"#pvscan\n"
"The minor number of a device.\n")
arg(minrecoveryrate_ARG, '\0', "minrecoveryrate", sizekb_VAL, 0, 0,
"Sets the minimum recovery rate for a RAID LV. The rate value\n"
@@ -318,7 +328,8 @@ arg(mirrorlog_ARG, '\0', "mirrorlog", mirrorlog_VAL, 0, 0,
"the first device to others) each time the LV is activated, e.g. after reboot.\n"
"\\fBmirrored\\fP is a persistent log that is itself mirrored.\n")
arg(mirrorsonly_ARG, '\0', "mirrorsonly", 0, 0, 0, NULL)
arg(mirrorsonly_ARG, '\0', "mirrorsonly", 0, 0, 0,
"Only remove missing PVs from mirror LVs.\n")
arg(mknodes_ARG, '\0', "mknodes", 0, 0, 0,
"Also checks the LVM special files in /dev that are needed for active\n"
@@ -536,7 +547,21 @@ arg(separator_ARG, '\0', "separator", string_VAL, 0, 0,
"String to use to separate each column. Useful if grepping the output.\n")
arg(shared_ARG, '\0', "shared", 0, 0, 0,
"Report/display shared VGs that would otherwise be skipped because\n"
"#vgcreate\n"
"Create a shared VG using lvmlockd if LVM is compiled with lockd support.\n"
"lvmlockd will select lock type sanlock or dlm depending on which lock\n"
"manager is running. This allows multiple hosts to share a VG on shared\n"
"devices. lvmlockd and a lock manager must be configured and running.\n"
"(A shared VG using lvmlockd is different from a clustered VG using clvmd.)\n"
"See lvmlockd(8) for more information about shared VGs.\n"
"#vgs\n"
"#lvs\n"
"#pvs\n"
"#fullreport\n"
"#vgdisplay\n"
"#lvdisplay\n"
"#pvdisplay\n"
"Report/display shared VGs that would otherwise be skipped when\n"
"lvmlockd is not being used on the host.\n"
"See lvmlockd(8) for more information about shared VGs.\n")
@@ -638,7 +663,7 @@ arg(trackchanges_ARG, '\0', "trackchanges", 0, 0, 0,
"changed data are resynchronized during merge. (This option only applies\n"
"when using the raid1 LV type.)\n")
/* FIXME: hide this? */
/* TODO: hide this? */
arg(trustcache_ARG, '\0', "trustcache", 0, 0, 0,
"Avoids certain device scanning during command processing. Do not use.\n")
@@ -752,102 +777,624 @@ arg(resizable_ARG, '\0', "resizable", bool_VAL, 0, 0, NULL)
* ... and now the short args.
*/
arg(activate_ARG, 'a', "activate", activation_VAL, 0, 0,
"Change the availability of LVs.\n"
"\\fBy\\fP makes LVs available on the system.\n"
"\\fBn\\fP makes LVs unavailable on the system.\n"
"Using device-mapper in the kernel, a block device for the LV\n"
"is added or removed on the system corresponding to the activation change.\n"
"When a block device exists for the LV, data on the LV can be accessed.\n"
"A symbolic link /dev/VGName/LVName pointing\n"
"to the device node is created or removed on an activation change.\n"
"#lvchange\n"
"#vgchange\n"
"Change the active state of LVs.\n"
"An active LV can be used through a block device,\n"
"allowing data on the LV to be accessed.\n"
"\\fBy\\fP makes LVs active, or available.\n"
"\\fBn\\fP makes LVs inactive, or unavailable.\n"
"The block device for the LV is added or removed from the system\n"
"using device-mapper in the kernel.\n"
"A symbolic link /dev/VGName/LVName pointing to the device node is also added/removed.\n"
"All software and scripts should access the device through the symbolic\n"
"link and present this as the name of the device.\n"
"The location and name of the underlying device node may depend on\n"
"the distribution and configuration (e.g. udev) and might change\n"
"from release to release.\n"
"the distribution, configuration (e.g. udev), or release version.\n"
"\\fBay\\fP specifies autoactivation, in which case an LV is activated\n"
"only if it matches an item in lvm.conf activation/auto_activation_volume_list.\n"
"If the list is not set, all LVs are considered to match.\n"
"If the list is not set, all LVs are considered to match, and if\n"
"if the list is set but empty, no LVs match.\n"
"Autoactivation should be used during system boot to make it possible\n"
"to select which LVs should be automatically activated by the system.\n"
"See lvmlockd(8) for more information about activation modes related\n"
"to shared VGs (\\fBey|sh\\fP).\n"
"See clvmd(8) for more information about activation modes related\n"
"to clustered VGs (\\fBey|sh|ly\\fP).\n")
"See lvmlockd(8) for more information about activation options for shared VGs.\n"
"See clvmd(8) for more information about activation options for clustered VGs.\n"
"#lvcreate\n"
"Controls the active state of the new LV.\n"
"\\fBy\\fP makes the LV active, or available.\n"
"New LVs are made active by default.\n"
"\\fBn\\fP makes the LV inactive, or unavailable, only when possible.\n"
"In some cases, creating an LV requires it to be active.\n"
"For example, COW snapshots of an active origin LV can only\n"
"be created in the active state (this does not apply to thin snapshots.)\n"
"The --zero option normally requires the LV to be active.\n"
"If autoactivation \\fBay\\fP is used, the LV is only activated\n"
"if it matches an item in lvm.conf activation/auto_activation_volume_list.\n"
"\\fBay\\fP implies --zero n and --wipesignatures n.\n"
"See lvmlockd(8) for more information about activation options for shared VGs.\n"
"See clvmd(8) for more information about activation options for clustered VGs.\n")
arg(all_ARG, 'a', "all", 0, 0, 0, NULL)
arg(autobackup_ARG, 'A', "autobackup", bool_VAL, 0, 0, NULL)
arg(activevolumegroups_ARG, 'A', "activevolumegroups", 0, 0, 0, NULL)
arg(background_ARG, 'b', "background", 0, 0, 0, NULL)
arg(all_ARG, 'a', "all", 0, 0, 0,
"#vgreduce\n"
"Removes all empty PVs if none are named on the command line.\n"
"#lvscan\n"
"#lvdisplay\n"
"#lvs\n"
"Show information about internal LVs.\n"
"These are components of normal LVs, such as mirrors,\n"
"which are not independently accessible, e.g. not mountable.\n"
"#vgs\n"
"List all VGs. Equivalent to not specifying any VGs.\n"
"#pvs\n"
"#pvdisplay\n"
"Show information about devices that have not been initialized\n"
"by LVM, i.e. they are not PVs.\n")
arg(autobackup_ARG, 'A', "autobackup", bool_VAL, 0, 0,
"Specifies if metadata should be backed up automatically after a change.\n"
"Enabling this is strongly advised! See vgcfgbackup(8) for more information.\n")
arg(activevolumegroups_ARG, 'A', "activevolumegroups", 0, 0, 0,
"Only select active VGs. The VG is considered active\n"
"if at least one of its LVs is active.\n")
/* FIXME: remove background option from pvscan, it's not used */
arg(background_ARG, 'b', "background", 0, 0, 0,
"If the operation requires polling, this option causes the command to\n"
"return before the operation is complete, and polling is done in the\n"
"background.\n")
/* Not used */
arg(backgroundfork_ARG, 'b', "background", 0, 0, 0, NULL)
arg(basevgname_ARG, 'n', "basevgname", string_VAL, 0, 0, NULL)
arg(blockdevice_ARG, 'b', "blockdevice", 0, 0, 0, NULL)
arg(chunksize_ARG, 'c', "chunksize", sizekb_VAL, 0, 0, NULL)
arg(clustered_ARG, 'c', "clustered", bool_VAL, 0, 0, NULL)
arg(colon_ARG, 'c', "colon", 0, 0, 0, NULL)
arg(columns_ARG, 'C', "columns", 0, 0, 0, NULL)
arg(contiguous_ARG, 'C', "contiguous", bool_VAL, 0, 0, NULL)
arg(debug_ARG, 'd', "debug", 0, ARG_COUNTABLE, 0, NULL)
arg(exported_ARG, 'e', "exported", 0, 0, 0, NULL)
arg(basevgname_ARG, 'n', "basevgname", string_VAL, 0, 0,
"By default the snapshot VG will be renamed to the original name plus a\n"
"numeric suffix to avoid duplicate naming (e.g. 'test_vg' would be renamed\n"
"to 'test_vg1'). This option will override the base VG name that is\n"
"used for all VG renames. If a VG already exists with the specified name\n"
"a numeric suffix will be added (like the previous example) to make it unique.\n")
arg(blockdevice_ARG, 'b', "blockdevice", 0, 0, 0,
"No longer used.\n")
arg(chunksize_ARG, 'c', "chunksize", sizekb_VAL, 0, 0,
"The size of chunks in a snapshot, cache pool or thin pool.\n"
"For snapshots, the value must be a power of 2 between 4KiB and 512KiB\n"
"and the default value is 4.\n"
"For a cache pool the value must be between 32KiB and 1GiB\n"
"and the default value is 64.\n"
"For a thin pool the value must be between 64KiB and 1GiB\n"
"and the default value starts with 64 and scales up to fit the\n"
"pool metadata size within 128MiB, if the pool metadata size is not specified.\n"
"The value must be a multiple of 64KiB.\n")
arg(clustered_ARG, 'c', "clustered", bool_VAL, 0, 0,
"#vgcreate\n"
"Create a clustered VG using clvmd if LVM is compiled with cluster support.\n"
"This allows multiple hosts to share a VG on shared devices.\n"
"clvmd and a lock manager must be configured and running.\n"
"(A clustered VG using clvmd is different from a shared VG using lvmlockd.)\n"
"See clvmd(8) for more information about clustered VGs.\n"
"#vgchange\n"
"Change the clustered property of a VG using clvmd.\n"
"See clvmd(8) for more information about clustered VGs.\n"
"#vgsplit\n"
"Specifies the clustered property of the new VG.\n")
arg(colon_ARG, 'c', "colon", 0, 0, 0,
"Generate colon separated output for easier parsing in scripts or programs.\n"
"Also see vgs(8) which provides considerably more control over the output.\n")
arg(columns_ARG, 'C', "columns", 0, 0, 0,
"Display output in columns, the equivalent of vgs(8).\n"
"Options listed are the same as options given in vgs(8).\n")
arg(contiguous_ARG, 'C', "contiguous", bool_VAL, 0, 0,
"Sets or resets the contiguous allocation policy for LVs.\n"
"Default is no contiguous allocation based on a next free principle.\n"
"It is only possible to change a non-contiguous allocation policy\n"
"to contiguous if all of the allocated physical extents in the LV\n"
"are already contiguous.\n")
arg(debug_ARG, 'd', "debug", 0, ARG_COUNTABLE, 0,
"Set debug level. Repeat from 1 to 6 times to increase the detail of\n"
"messages sent to the log file and/or syslog (if configured).\n")
arg(exported_ARG, 'e', "exported", 0, 0, 0,
"Only show PVs belonging to exported VGs.\n")
/* Not used. */
arg(physicalextent_ARG, 'E', "physicalextent", 0, 0, 0, NULL)
arg(file_ARG, 'f', "file", string_VAL, 0, 0, NULL)
arg(force_ARG, 'f', "force", 0, ARG_COUNTABLE, 0, NULL)
arg(file_ARG, 'f', "file", string_VAL, 0, 0,
"#lvmconfig\n"
"#dumpconfig\n"
"#config\n"
"Write output to the named file.\n"
"#vgcfgbackup\n"
"Write the backup to the named file.\n"
"When backing up more than one VG, the file name is\n"
"treated as a template, and %s is replaced by the VG name.\n"
"#vgcfgrestore\n"
"Read metadata backup from the named file.\n"
"Usually this file was created by vgcfgbackup.\n")
arg(force_ARG, 'f', "force", 0, ARG_COUNTABLE, 0,
"Override various checks, confirmations and protections.\n"
"Use with extreme caution.\n")
/* Not used. */
arg(full_ARG, 'f', "full", 0, 0, 0, NULL)
arg(help_ARG, 'h', "help", 0, ARG_COUNTABLE, 0, NULL)
arg(cache_ARG, 'H', "cache", 0, 0, 0, NULL)
arg(history_ARG, 'H', "history", 0, 0, 0, NULL)
arg(help_ARG, 'h', "help", 0, ARG_COUNTABLE, 0,
"Display help text. Repeat this option for more information.\n")
arg(cache_ARG, 'H', "cache", 0, 0, 0,
"Specifies the command is handling a cache LV or cache pool.\n"
"See --type cache and --type cache-pool.\n"
"See lvmcache(7) for more information about LVM caching.\n")
arg(history_ARG, 'H', "history", 0, 0, 0,
"Include historical LVs in the output.\n"
"(This has no effect unless LVs were removed while\n"
"lvm.conf metadata/record_lvs_history was enabled.\n")
/* Not used */
arg(help2_ARG, '?', "", 0, 0, 0, NULL)
arg(import_ARG, 'i', "import", 0, 0, 0, NULL)
arg(interval_ARG, 'i', "interval", number_VAL, 0, 0, NULL)
arg(import_ARG, 'i', "import", 0, 0, 0,
"Import exported VGs. Otherwise VGs that have been exported\n"
"will not be changed (nor will their associated PVs).\n")
arg(interval_ARG, 'i', "interval", number_VAL, 0, 0,
"Report progress at regular intervals.\n")
/* Not used */
arg(iop_version_ARG, 'i', "iop_version", 0, 0, 0, NULL)
arg(stripes_ARG, 'i', "stripes", number_VAL, 0, 0, NULL)
arg(stripesize_ARG, 'I', "stripesize", sizekb_VAL, 0, 0, NULL)
arg(logicalvolume_ARG, 'l', "logicalvolume", number_VAL, 0, 0, NULL)
arg(maxlogicalvolumes_ARG, 'l', "maxlogicalvolumes", number_VAL, 0, 0, NULL)
arg(extents_ARG, 'l', "extents", numsignedper_VAL, 0, 0, NULL)
arg(list_ARG, 'l', "list", 0, 0, 0, NULL)
arg(lvmpartition_ARG, 'l', "lvmpartition", 0, 0, 0, NULL)
arg(size_ARG, 'L', "size", sizemb_VAL, 0, 0, NULL)
arg(persistent_ARG, 'M', "persistent", bool_VAL, 0, 0, NULL)
arg(major_ARG, 'j', "major", number_VAL, ARG_GROUPABLE, 0, NULL)
arg(setactivationskip_ARG, 'k', "setactivationskip", bool_VAL, 0, 0, NULL)
arg(ignoreactivationskip_ARG, 'K', "ignoreactivationskip", 0, 0, 0, NULL)
arg(maps_ARG, 'm', "maps", 0, 0, 0, NULL)
arg(mirrors_ARG, 'm', "mirrors", numsigned_VAL, 0, 0, NULL)
arg(metadatatype_ARG, 'M', "metadatatype", metadatatype_VAL, 0, 0, NULL)
arg(name_ARG, 'n', "name", string_VAL, 0, 0, NULL)
arg(nofsck_ARG, 'n', "nofsck", 0, 0, 0, NULL)
arg(novolumegroup_ARG, 'n', "novolumegroup", 0, 0, 0, NULL)
arg(stripes_ARG, 'i', "stripes", number_VAL, 0, 0,
"Specifies the number of stripes in a striped LV. This is the number of\n"
"PVs (devices) that a striped LV is spread across. Data that\n"
"appears sequential in the LV is spread across multiple devices in units of\n"
"the stripe size (see --stripesize). This does not apply to\n"
"existing allocated space, only newly allocated space can be striped.\n"
"When creating a RAID 4/5/6 LV, this number does not include the extra\n"
"devices that are required for parity. The largest number depends on\n"
"the RAID type (raid0: 64, raid10: 32, raid4/5: 63, raid6: 62.)\n"
"When unspecified, the default depends on the RAID type\n"
"(raid0: 2, raid10: 4, raid4/5: 3, raid6: 5.)\n"
"When unspecified, to stripe across all PVs of the VG,\n"
"set lvm.conf allocation/raid_stripe_all_devices=1.\n")
arg(stripesize_ARG, 'I', "stripesize", sizekb_VAL, 0, 0,
"The amount of data that is written to one device before\n"
"moving to the next in a striped LV.\n")
arg(logicalvolume_ARG, 'l', "logicalvolume", number_VAL, 0, 0,
"Sets the maximum number of LVs allowed in a VG.\n")
arg(maxlogicalvolumes_ARG, 'l', "maxlogicalvolumes", number_VAL, 0, 0,
"Sets the maximum number of LVs allowed in a VG.\n")
arg(extents_ARG, 'l', "extents", numsignedper_VAL, 0, 0,
"#lvcreate\n"
"Specifies the size of the new LV in logical extents.\n"
"The --size and --extents options are alternate methods of specifying size.\n"
"The total number of physical extents used will be\n"
"greater when redundant data is needed for RAID levels.\n"
"An alternate syntax allows the size to be determined indirectly\n"
"as a percentage of the size of a related VG, LV, or set of PVs. The\n"
"suffix \\fB%VG\\fP denotes the total size of the VG, the suffix \\fB%FREE\\fP\n"
"the remaining free space in the VG, and the suffix \\fB%PVS\\fP the free\n"
"space in the specified PVs. For a snapshot, the size\n"
"can be expressed as a percentage of the total size of the origin LV\n"
"with the suffix \\fB%ORIGIN\\fP (\\fB100%ORIGIN\\fP provides space for\n"
"the whole origin).\n"
"When expressed as a percentage, the size defines an upper limit for the\n"
"number of logical extents in the new LV. The precise number of logical\n"
"extents in the new LV is not determined until the command has completed.\n"
"#lvreduce\n"
"#lvextend\n"
"#lvresize\n"
"Specifies the new size of the LV in logical extents.\n"
"The --size and --extents options are alternate methods of specifying size.\n"
"The total number of physical extents used will be\n"
"greater when redundant data is needed for RAID levels.\n"
"An alternate syntax allows the size to be determined indirectly\n"
"as a percentage of the size of a related VG, LV, or set of PVs. The\n"
"suffix \\fB%VG\\fP denotes the total size of the VG, the suffix \\fB%FREE\\fP\n"
"the remaining free space in the VG, and the suffix \\fB%PVS\\fP the free\n"
"space in the specified PVs. For a snapshot, the size\n"
"can be expressed as a percentage of the total size of the origin LV\n"
"with the suffix \\fB%ORIGIN\\fP (\\fB100%ORIGIN\\fP provides space for\n"
"the whole origin).\n"
"When expressed as a percentage, the size defines an upper limit for the\n"
"number of logical extents in the new LV. The precise number of logical\n"
"extents in the new LV is not determined until the command has completed.\n"
"The plus prefix \\fB+\\fP can be used, in which case\n"
"the value is added to the current size,\n"
"or the minus prefix \\fB-\\fP can be used, in which case\n"
"the value is subtracted from the current size.\n")
arg(list_ARG, 'l', "list", 0, 0, 0,
"#lvmconfig\n"
"#dumpconfig\n"
"#config\n"
"List config settings with summarizing comment. This is the same as using\n"
"options --type list --withsummary.\n"
"#vgcfgrestore\n"
"List metadata backup and archive files pertaining to the VG.\n"
"May be used with --file. Does not restore the VG.\n"
"#vgmerge\n"
"Display merged destination VG like vgdisplay -v.\n")
arg(lvmpartition_ARG, 'l', "lvmpartition", 0, 0, 0,
"Only report PVs.\n")
arg(size_ARG, 'L', "size", sizemb_VAL, 0, 0,
"#lvcreate\n"
"Specifies the size of the new LV.\n"
"The --size and --extents options are alternate methods of specifying size.\n"
"The total number of physical extents used will be\n"
"greater when redundant data is needed for RAID levels.\n"
"A suffix can be chosen from: \\fBbBsSkKmMgGtTpPeE\\fP.\n"
"All units are base two values, regardless of letter capitalization:\n"
"b|B is bytes, s|S is sectors of 512 bytes,\n"
"k|K is kilobytes, m|M is megabytes,\n"
"g|G is gigabytes, t|T is terabytes,\n"
"p|P is petabytes, e|E is exabytes.\n"
"#lvreduce\n"
"#lvextend\n"
"#lvresize\n"
"Specifies the new size of the LV.\n"
"The --size and --extents options are alternate methods of specifying size.\n"
"The total number of physical extents used will be\n"
"greater when redundant data is needed for RAID levels.\n"
"A suffix can be chosen from: \\fBbBsSkKmMgGtTpPeE\\fP.\n"
"All units are base two values, regardless of letter capitalization:\n"
"b|B is bytes, s|S is sectors of 512 bytes,\n"
"k|K is kilobytes, m|M is megabytes,\n"
"g|G is gigabytes, t|T is terabytes,\n"
"p|P is petabytes, e|E is exabytes.\n"
"The plus prefix \\fB+\\fP can be used, in which case\n"
"the value is added to the current size,\n"
"or the minus prefix \\fB-\\fP can be used, in which case\n"
"the value is subtracted from the current size.\n")
arg(persistent_ARG, 'M', "persistent", bool_VAL, 0, 0,
"When yes, makes the specified minor number persistent.\n")
arg(major_ARG, 'j', "major", number_VAL, ARG_GROUPABLE, 0,
"#lvcreate\n"
"#lvchange\n"
"Sets the major number of an LV block device.\n"
"#pvscan\n"
"The major number of a device.\n")
arg(setactivationskip_ARG, 'k', "setactivationskip", bool_VAL, 0, 0,
"Persistently sets (yes) or clears (no) the \"activation skip\" flag on an LV.\n"
"An LV with this flag set is not activated unless the\n"
"--ignoreactivationskip option is used by the activation command.\n"
"This flag is set by default on new thin snapshot LVs.\n"
"The flag is not applied to deactivation.\n"
"The current value of the flag is indicated in the lvs lv_attr bits.\n")
arg(ignoreactivationskip_ARG, 'K', "ignoreactivationskip", 0, 0, 0,
"Ignore the \"activation skip\" LV flag during activation\n"
"to allow LVs with the flag set to be activated.\n")
arg(maps_ARG, 'm', "maps", 0, 0, 0,
"#lvdisplay\n"
"Display the mapping of logical extents to PVs and physical extents.\n"
"To map physical extents to logical extents use:\n"
"pvs --segments -o+lv_name,seg_start_pe,segtype\n"
"#pvdisplay\n"
"Display the mapping of physical extents to LVs and logical extents.\n")
/* FIXME: should the unused mirrors option be removed from lvextend? */
arg(mirrors_ARG, 'm', "mirrors", numsigned_VAL, 0, 0,
"#lvcreate\n"
"Specifies the number of mirror images in addition to the original LV\n"
"image, e.g. --mirrors 1 means there are two images of the data, the\n"
"original and one mirror image.\n"
"Optional positional PV args on the command line can specify the devices\n"
"the images should be placed on.\n"
"There are two mirroring implementations: \"raid1\" and \"mirror\".\n"
"These are the names of the corresponding LV types, or \"segment types\".\n"
"Use the --type option to specify which to use (raid1 is default,\n"
"and mirror is legacy)\n"
"Use lvm.conf global/mirror_segtype_default and\n"
"global/raid10_segtype_default to configure the default types.\n"
"See the --nosync option for avoiding initial image synchronization.\n"
"#lvconvert\n"
"Specifies the number of mirror images in addition to the original LV\n"
"image, e.g. --mirrors 1 means there are two images of the data, the\n"
"original and one mirror image.\n"
"Optional positional PV args on the command line can specify the devices\n"
"the images should be placed on.\n"
"There are two mirroring implementations: \"raid1\" and \"mirror\".\n"
"These are the names of the corresponding LV types, or \"segment types\".\n"
"Use the --type option to specify which to use (raid1 is default,\n"
"and mirror is legacy)\n"
"Use lvm.conf global/mirror_segtype_default and\n"
"global/raid10_segtype_default to configure the default types.\n"
"The plus prefix \\fB+\\fP can be used, in which case\n"
"the number is added to the current number of images,\n"
"or the minus prefix \\fB-\\fP can be used, in which case\n"
"the number is subtracted from the current number of images.\n"
"#lvextend\n"
"Not used.\n")
arg(metadatatype_ARG, 'M', "metadatatype", metadatatype_VAL, 0, 0,
"Specifies the type of on-disk metadata to use.\n"
"\\fBlvm2\\fP (or just \\fB2\\fP) is the current, standard format.\n"
"\\fBlvm1\\fP (or just \\fB1\\fP) is a historical format that\n"
"can be used for accessing old data.\n")
arg(name_ARG, 'n', "name", string_VAL, 0, 0,
"#lvcreate\n"
"#lvconvert\n"
"Specifies the name of a new LV.\n"
"When unspecified, a default name of \"lvol#\" is\n"
"generated, where # is a number generated by LVM.\n"
"#pvmove\n"
"Move only the extents belonging to the named LV.\n"
"#vgsplit\n"
"Move only PVs used by the named LV.\n")
arg(nofsck_ARG, 'n', "nofsck", 0, 0, 0,
"Do not perform fsck before resizing filesystem when filesystem\n"
"requires it. You may need to use --force to proceed with\n"
"this option.\n")
arg(novolumegroup_ARG, 'n', "novolumegroup", 0, 0, 0,
"Only show PVs not belonging to any VG.\n")
/* Not used */
arg(oldpath_ARG, 'n', "oldpath", 0, 0, 0, NULL)
arg(options_ARG, 'o', "options", string_VAL, ARG_GROUPABLE, 0, NULL)
arg(sort_ARG, 'O', "sort", string_VAL, ARG_GROUPABLE, 0, NULL)
arg(maxphysicalvolumes_ARG, 'p', "maxphysicalvolumes", uint32_VAL, 0, 0, NULL)
arg(permission_ARG, 'p', "permission", permission_VAL, 0, 0, NULL)
arg(partial_ARG, 'P', "partial", 0, 0, 0, NULL)
/*
* FIXME: a free-form discussion section and document the
* VG/LV/PV attr bits which were previously listed
* in the description for -o.
*/
arg(options_ARG, 'o', "options", string_VAL, ARG_GROUPABLE, 0,
"Comma-separated, ordered list of fields to display in columns.\n"
"String arg syntax is: [+|-|#]Field1[,Field2 ...]\n"
"The prefix \\fB+\\fP will append the specified fields to the default fields,\n"
"\\fB-\\fP will remove the specified fields from the default fields, and\n"
"\\fB#\\fP will compact specified fields (removing them when empty for all rows.)\n"
"Use \\fB-o help\\fP to view the list of all available fields.\n"
"The -o option can be repeated, providing several lists.\n"
"These lists are evaluated from left to right.\n"
"Use field name \\fBlv_all\\fP to view all LV fields,\n"
"\\fBvg_all\\fP all VG fields,\n"
"\\fBpv_all\\fP all PV fields,\n"
"\\fBpvseg_all\\fP all PV segment fields,\n"
"\\fBseg_all\\fP all LV segment fields, and\n"
"\\fBpvseg_all\\fP all PV segment columns.\n"
"See the lvm.conf report section for more config options.\n"
"See lvmreport(7) for more information about reporting.\n")
arg(sort_ARG, 'O', "sort", string_VAL, ARG_GROUPABLE, 0,
"Comma-separated ordered list of columns to sort by. Replaces the default\n"
"selection. Precede any column with \\fB-\\fP for a reverse sort on that column.\n")
arg(maxphysicalvolumes_ARG, 'p', "maxphysicalvolumes", uint32_VAL, 0, 0,
"Sets the maximum number of PVs that can belong to the VG.\n"
"The value 0 removes any limitation.\n"
"For large numbers of PVs, also see options --pvmetadatacopies,\n"
"and --vgmetadatacopies for improving performance.\n")
arg(permission_ARG, 'p', "permission", permission_VAL, 0, 0,
"Set access permission to read only \\fBr\\fP or read and write \\fBrw\\fP.\n")
/* FIXME: I left out some of the previous description that didn't sound correct. */
arg(partial_ARG, 'P', "partial", 0, 0, 0,
"When set, the tools will do their best to provide access to VGs\n"
"that are only partially available (one or more PVs belonging\n"
"to the VG are missing from the system). Metadata may not be\n"
"changed with this option.\n")
/* Not used */
arg(physicalvolume_ARG, 'P', "physicalvolume", 0, 0, 0, NULL)
arg(quiet_ARG, 'q', "quiet", 0, ARG_COUNTABLE, 0, NULL)
arg(readahead_ARG, 'r', "readahead", readahead_VAL, 0, 0, NULL)
arg(resizefs_ARG, 'r', "resizefs", 0, 0, 0, NULL)
arg(quiet_ARG, 'q', "quiet", 0, ARG_COUNTABLE, 0,
"Suppress output and log messages. Overrides --debug and --verbose.\n"
"Repeat once to also suppress any prompts with answer no.\n")
arg(readahead_ARG, 'r', "readahead", readahead_VAL, 0, 0,
"Sets read ahead sector count of an LV.\n"
"\\fBauto\\fP is the default which allows the kernel to choose\n"
"a suitable value automatically.\n"
"\\fBnone\\fP is equivalent to zero.\n")
arg(resizefs_ARG, 'r', "resizefs", 0, 0, 0,
"Resize underlying filesystem together with the LV using fsadm(8).\n")
/* Not used */
arg(reset_ARG, 'R', "reset", 0, 0, 0, NULL)
arg(regionsize_ARG, 'R', "regionsize", sizemb_VAL, 0, 0, NULL)
arg(physicalextentsize_ARG, 's', "physicalextentsize", sizemb_VAL, 0, 0, NULL)
arg(snapshot_ARG, 's', "snapshot", 0, 0, 0, NULL)
arg(short_ARG, 's', "short", 0, 0, 0, NULL)
arg(regionsize_ARG, 'R', "regionsize", sizemb_VAL, 0, 0,
"A mirror is divided into regions of this size, and the mirror log\n"
"uses this granularity to track which regions are in sync.\n"
"(This can be used with the \"mirror\" type, not the \"raid1\" type.)\n")
arg(physicalextentsize_ARG, 's', "physicalextentsize", sizemb_VAL, 0, 0,
"#vgcreate\n"
"Sets the physical extent size of PVs in the VG.\n"
"The value must be either a power of 2 of at least 1 sector\n"
"(where the sector size is the largest sector size of the PVs\n"
"currently used in the VG), or at least 128KiB.\n"
"Once this value has been set, it is difficult to change\n"
"without recreating the VG, unless no extents need moving.\n"
"#vgchange\n"
"Sets the physical extent size of PVs in the VG.\n"
"The value must be either a power of 2 of at least 1 sector\n"
"(where the sector size is the largest sector size of the PVs\n"
"currently used in the VG), or at least 128KiB.\n"
"Once this value has been set, it is difficult to change\n"
"without recreating the VG, unless no extents need moving.\n"
"Before increasing the physical extent size, you might need to use lvresize,\n"
"pvresize and/or pvmove so that everything fits. For example, every\n"
"contiguous range of extents used in a LV must start and end on an extent boundary.\n")
arg(snapshot_ARG, 's', "snapshot", 0, 0, 0,
"#lvcreate\n"
"Create a snapshot. Snapshots provide a \"frozen image\" of an origin LV.\n"
"The snapshot LV can be used, e.g. for backups, while the origin LV\n"
"continues to be used.\n"
"This option can create a COW (copy on write) snapshot,\n"
"or a thin snapshot (in a thin pool.)\n"
"Thin snapshots are created when the origin is a thin LV and\n"
"the size option is NOT specified. Thin snapshots share the same blocks\n"
"in the thin pool, and do not allocate new space from the VG.\n"
"Thin snapshots are created with the \"activation skip\" flag,\n"
"see --setactivationskip.\n"
"A thin snapshot of a non-thin \"external origin\" LV is created\n"
"when a thin pool is specified. Unprovisioned blocks in the thin snapshot\n"
"LV are read from the external origin LV. The external origin LV must\n"
"be read-only.\n"
"See lvmthin(7) for more information about LVM thin provisioning.\n"
"COW snapshots are created when a size is specified. The size is allocated\n"
"from space in the VG, and is the amount of space that can be used\n"
"for saving COW blocks as writes occur to the origin or snapshot.\n"
"The size chosen should depend upon the amount of writes that are expected;\n"
"often 20% of the origin LV is enough. If COW space runs low, it can\n"
"be extended with lvextend (shrinking is also allowed with lvreduce.)\n"
"A small amount of the COW snapshot LV size is used to track COW block\n"
"locations, so the full size is not available for COW data blocks.\n"
"Use lvs to check how much space is used, and see --monitor to\n"
"to automatically extend the size to avoid running out of space.\n"
"#lvconvert\n"
"Combine a former COW snapshot LV with a former origin LV to reverse\n"
"a previous --splitsnapshot command.\n")
arg(short_ARG, 's', "short", 0, 0, 0,
"#pvdisplay\n"
"Only display the size of the given PVs.\n"
"#vgdisplay\n"
"Give a short listing showing the existence of VGs.\n"
"#pvscan\n"
"Short listing format.\n")
/* Not used */
arg(stdin_ARG, 's', "stdin", 0, 0, 0, NULL)
arg(select_ARG, 'S', "select", string_VAL, ARG_GROUPABLE, 0, NULL)
arg(test_ARG, 't', "test", 0, 0, 0, NULL)
arg(thin_ARG, 'T', "thin", 0, 0, 0, NULL)
arg(uuid_ARG, 'u', "uuid", 0, 0, 0, NULL)
arg(uuidstr_ARG, 'u', "uuid", string_VAL, 0, 0, NULL)
arg(select_ARG, 'S', "select", string_VAL, ARG_GROUPABLE, 0,
"Select objects for processing and reporting based on specified criteria.\n"
"The criteria syntax is described in lvmreport(7) under Selection.\n"
"For reporting commands, display rows that match the criteria.\n"
"All rows can be displayed with an additional \"selected\" field (-o selected)\n"
"showing 1 if the row matches the selection and 0 otherwise.\n"
"For non-reporting commands which process LVM entities, the selection is\n"
"used to choose items to process.\n")
arg(test_ARG, 't', "test", 0, 0, 0,
"Run in test mode. Commands will not update metadata.\n"
"This is implemented by disabling all metadata writing but nevertheless\n"
"returning success to the calling function. This may lead to unusual\n"
"error messages in multi-stage operations if a tool relies on reading\n"
"back metadata it believes has changed but hasn't.\n")
arg(thin_ARG, 'T', "thin", 0, 0, 0,
"Specifies the command is handling a thin LV or thin pool.\n"
"See --type thin, --type thin-pool, and --virtualsize.\n"
"See lvmthin(7) for more information about LVM thin provisioning.\n")
arg(uuid_ARG, 'u', "uuid", 0, 0, 0,
"#pvchange\n"
"Generate new random UUID for specified PVs.\n"
"#pvscan\n"
"Show UUIDs in addition to device names.\n"
"#vgchange\n"
"Generate new random UUID for specified VGs.\n")
arg(uuidstr_ARG, 'u', "uuid", string_VAL, 0, 0,
"Specify a UUID for the device.\n"
"Without this option, a random UUID is generated.\n"
"This option is needed before restoring a backup of LVM metadata\n"
"onto a replacement device; see vgcfgrestore(8). As such, use of\n"
"--restorefile is compulsory unless the --norestorefile is used.\n"
"All PVs must have unique UUIDs, and LVM will prevent certain operations\n"
"if multiple devices are seen with the same UUID.\n"
"See vgimportclone(8) for more information.\n")
/* Not used */
arg(uuidlist_ARG, 'U', "uuidlist", 0, 0, 0, NULL)
arg(verbose_ARG, 'v', "verbose", 0, ARG_COUNTABLE, 0, NULL)
arg(verbose_ARG, 'v', "verbose", 0, ARG_COUNTABLE, 0,
"Set verbose level. Repeat from 1 to 4 times to increase the detail\n"
"of messages sent to stdout and stderr.\n")
/* Not used */
arg(volumegroup_ARG, 'V', "volumegroup", 0, 0, 0, NULL)
arg(virtualsize_ARG, 'V', "virtualsize", sizemb_VAL, 0, 0, NULL)
arg(wipesignatures_ARG, 'W', "wipesignatures", bool_VAL, 0, 0, NULL)
arg(allocatable_ARG, 'x', "allocatable", bool_VAL, 0, 0, NULL)
arg(resizeable_ARG, 'x', "resizeable", bool_VAL, 0, 0, NULL)
arg(yes_ARG, 'y', "yes", 0, 0, 0, NULL)
arg(zero_ARG, 'Z', "zero", bool_VAL, 0, 0, NULL)
arg(virtualsize_ARG, 'V', "virtualsize", sizemb_VAL, 0, 0,
"The virtual size of a new thin LV.\n"
"See lvmthin(7) for more information about LVM thin provisioning.\n"
"Using virtual size (-V) and actual size (-L) together creates\n"
"a sparse LV.\n"
"lvm.conf global/sparse_segtype_default determines the\n"
"default segment type used to create a sparse LV.\n"
"Anything written to a sparse LV will be returned when reading from it.\n"
"Reading from other areas of the LV will return blocks of zeros.\n"
"When using a snapshot to create a sparse LV, a hidden virtual device\n"
"is created using the zero target, and the LV has the suffix _vorigin.\n"
"Snapshots are less efficient than thin provisioning when creating\n"
"large sparse LVs (GiB).\n")
arg(wipesignatures_ARG, 'W', "wipesignatures", bool_VAL, 0, 0,
"Controls detection and subsequent wiping of signatures on new LVs.\n"
"There is a prompt for each signature detected to confirm its wiping\n"
"(unless --yes is used to override confirmations.)\n"
"When not specified, signatures are wiped whenever zeroing is done\n"
"(see --zero). This behaviour can be configured with\n"
"lvm.conf allocation/wipe_signatures_when_zeroing_new_lvs.\n"
"If blkid wiping is used (lvm.conf allocation/use_blkid_wiping)\n"
"and LVM is compiled with blkid wiping support, then the blkid(8)\n"
"library is used to detect the signatures (use blkid -k to list the\n"
"signatures that are recognized).\n"
"Otherwise, native LVM code is used to detect signatures\n"
"(only MD RAID, swap and LUKS signatures are detected in this case.)\n"
"The LV is not wiped if the read only flag is set.\n")
arg(allocatable_ARG, 'x', "allocatable", bool_VAL, 0, 0,
"Enable or disable allocation of physical extents on this PV.\n")
arg(resizeable_ARG, 'x', "resizeable", bool_VAL, 0, 0,
"Enables or disables the addition or removal of PVs to/from a VG\n"
"(by vgextend/vgreduce).\n")
arg(yes_ARG, 'y', "yes", 0, 0, 0,
"Do not prompt for confirmation interactively but always assume the\n"
"answer yes. Use with extreme caution.\n")
arg(zero_ARG, 'Z', "zero", bool_VAL, 0, 0,
"#lvchange\n"
"Set zeroing mode for thin pool. Note: already provisioned blocks from pool\n"
"in non-zero mode are not cleared in unwritten parts when setting --zero y.\n"
"#lvconvert\n"
"For snapshots, this controls zeroing of the first 4KiB of data in the\n"
"snapshot. If the LV is read-only, the snapshot will not be zeroed.\n"
"For thin pools, this controls zeroing of provisioned blocks.\n"
"Provisioning of large zeroed chunks negatively impacts performance.\n"
"#lvcreate\n"
"Controls zeroing of the first 4KiB of data in the new LV.\n"
"Default is \\fBy\\fP.\n"
"Snapshot COW volumes are always zeroed.\n"
"LV is not zeroed if the read only flag is set.\n"
"Warning: trying to mount an unzeroed LV can cause the system to hang.\n"
"#pvcreate\n"
"#vgcreate\n"
"#vgextend\n"
"Controls if the first 4 sectors (2048 bytes) of the device are wiped.\n"
"The default is to wipe these sectors unless either or both of\n"
"--restorefile or --uuid are specified.\n")
/* this should always be last */
arg(ARG_COUNT, '-', "", 0, 0, 0, NULL)

View File

@@ -1589,6 +1589,7 @@ formats
ID: formats_general
help
OP: String ...
ID: help_general
version

View File

@@ -2187,9 +2187,10 @@ static void print_man_option_desc(struct cmd_name *cname, int opt_enum)
const char *desc = opt_names[opt_enum].desc;
char buf[DESC_LINE];
int started_cname = 0;
int line_count = 0;
int di, bi;
if (!strstr(desc, "#")) {
if (desc[0] != '#') {
printf("%s", desc);
return;
}
@@ -2206,8 +2207,10 @@ static void print_man_option_desc(struct cmd_name *cname, int opt_enum)
continue;
if (buf[0] != '#') {
if (started_cname)
if (started_cname) {
printf("%s", buf);
line_count++;
}
memset(buf, 0, sizeof(buf));
bi = 0;
@@ -2216,8 +2219,14 @@ static void print_man_option_desc(struct cmd_name *cname, int opt_enum)
/* Line starting with #cmdname */
/* Must be starting a new command name. */
if (started_cname)
/*
* Must be starting a new command name.
* If no lines have been printed, multiple command names
* are using the same text. If lines have been printed,
* then the start of a new command name means the end
* of text for the current command name.
*/
if (line_count && started_cname)
return;
if (!strncmp(buf + 1, cname->name, strlen(cname->name))) {

View File

@@ -210,7 +210,7 @@ int lvm_shell(struct cmd_context *cmd, struct cmdline_context *cmdline)
{
log_report_t saved_log_report_state = log_get_report_state();
char *orig_command_log_selection = NULL;
int is_lastlog_cmd = 0, argc, ret;
int is_lastlog_cmd = 0, argc, ret, i;
char *input = NULL, *args[MAX_ARGS], **argv;
rl_readline_name = "lvm";
@@ -262,6 +262,9 @@ int lvm_shell(struct cmd_context *cmd, struct cmdline_context *cmdline)
add_history(input);
for (i = 0; i < MAX_ARGS; i++)
args[i] = NULL;
argv = args;
if (lvm_split(input, &argc, argv, MAX_ARGS) == MAX_ARGS) {

View File

@@ -1288,7 +1288,7 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
#define HELP_LINE_SIZE 1024
static void _print_usage(const char *usage, int only_required)
static void _print_usage(const char *usage_str, int only_required)
{
char buf[HELP_LINE_SIZE];
int optional_ui = 0;
@@ -1296,7 +1296,7 @@ static void _print_usage(const char *usage, int only_required)
int ui;
int bi;
if (!usage || !strlen(usage))
if (!usage_str || !strlen(usage_str))
return;
/*
@@ -1313,32 +1313,32 @@ static void _print_usage(const char *usage, int only_required)
memset(buf, 0, sizeof(buf));
bi = 0;
for (ui = 0; ui < strlen(usage); ui++) {
if (!bi && ((usage[ui] == ' ') || (usage[ui] == '\n')))
for (ui = 0; ui < strlen(usage_str); ui++) {
if (!bi && ((usage_str[ui] == ' ') || (usage_str[ui] == '\n')))
continue;
/* The first "[ " indicates the start of the optional opt_args. */
if ((usage[ui] == '[') && (usage[ui+1] == ' ')) {
if ((usage_str[ui] == '[') && (usage_str[ui+1] == ' ')) {
optional_ui = ui;
break;
}
if (usage[ui] == '\0')
if (usage_str[ui] == '\0')
break;
if (usage[ui] == '(') {
if (usage_str[ui] == '(') {
buf[bi++] = '\n';
buf[bi++] = '\t';
}
buf[bi++] = usage[ui];
buf[bi++] = usage_str[ui];
if (usage[ui] == ')') {
if (usage_str[ui] == ')') {
buf[bi++] = '\n';
buf[bi++] = '\t';
}
if (usage[ui] == ',') {
if (usage_str[ui] == ',') {
buf[bi++] = '\n';
buf[bi++] = '\t';
buf[bi++] = ' ';
@@ -1368,25 +1368,25 @@ static void _print_usage(const char *usage, int only_required)
memset(buf, 0, sizeof(buf));
bi = 0;
for (ui = optional_ui; ui < strlen(usage); ui++) {
for (ui = optional_ui; ui < strlen(usage_str); ui++) {
/* The second "[ " indicates the start of the optional pos_args. */
if ((ui > optional_ui) && (usage[ui] == '[') && (usage[ui+1] == ' ')) {
if ((ui > optional_ui) && (usage_str[ui] == '[') && (usage_str[ui+1] == ' ')) {
optional_pos_ui = ui;
break;
}
if (usage[ui] == '\0')
if (usage_str[ui] == '\0')
break;
if (usage[ui] == '\n')
if (usage_str[ui] == '\n')
break;
if (!bi)
buf[bi++] = '\t';
buf[bi++] = usage[ui];
buf[bi++] = usage_str[ui];
if (usage[ui] == ',') {
if (usage_str[ui] == ',') {
buf[bi++] = '\n';
buf[bi++] = '\t';
buf[bi++] = ' ';
@@ -1413,16 +1413,16 @@ static void _print_usage(const char *usage, int only_required)
memset(buf, 0, sizeof(buf));
bi = 0;
for (ui = optional_pos_ui; ui < strlen(usage); ui++) {
if (usage[ui] == '\0')
for (ui = optional_pos_ui; ui < strlen(usage_str); ui++) {
if (usage_str[ui] == '\0')
break;
if (usage[ui] == '\n')
if (usage_str[ui] == '\n')
break;
if (!bi)
buf[bi++] = '\t';
buf[bi++] = usage[ui];
buf[bi++] = usage_str[ui];
if (bi == (HELP_LINE_SIZE - 1))
break;