Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=550536474f2b2ad3ac58f…
Commit: 550536474f2b2ad3ac58f1f91aa2325022df53b9
Parent: 5036244ce87f3854c7d6b14ab754f43eceaf24eb
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 7 14:30:03 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 10 10:38:32 2019 -0500
vgsplit: simplify vg creation
The way that this command now uses the global lock
followed by a label scan, it can simply check if the
new VG name exists, and if not lock it and create it.
---
lib/metadata/metadata.c | 62 +---------------------
tools/vgsplit.c | 133 ++++++++++-------------------------------------
2 files changed, 29 insertions(+), 166 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index e0a5114..aceac5a 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -985,29 +985,6 @@ int vg_has_unknown_segments(const struct volume_group *vg)
return 0;
}
-struct volume_group *vg_lock_and_create(struct cmd_context *cmd, const char *vg_name, int *exists)
-{
- uint32_t rc;
- struct volume_group *vg;
-
- if (!validate_name(vg_name)) {
- log_error("Invalid vg name %s", vg_name);
- return NULL;
- }
-
- rc = vg_lock_newname(cmd, vg_name);
- if (rc == FAILED_EXIST)
- *exists = 1;
- if (rc != SUCCESS)
- return NULL;
-
- vg = vg_create(cmd, vg_name);
- if (!vg)
- unlock_vg(cmd, NULL, vg_name);
-
- return vg;
-}
-
/*
* Create a VG with default parameters.
*/
@@ -3265,7 +3242,7 @@ static int _vg_read_orphan_pv(struct lvmcache_info *info, void *baton)
/* Make orphan PVs look like a VG. */
struct volume_group *vg_read_orphans(struct cmd_context *cmd, const char *orphan_vgname)
{
- const struct format_type *fmt;
+ const struct format_type *fmt = cmd->fmt;
struct lvmcache_vginfo *vginfo;
struct volume_group *vg = NULL;
struct _vg_read_orphan_baton baton;
@@ -3277,9 +3254,6 @@ struct volume_group *vg_read_orphans(struct cmd_context *cmd, const char *orphan
if (!(vginfo = lvmcache_vginfo_from_vgname(orphan_vgname, NULL)))
return_NULL;
- if (!(fmt = lvmcache_fmt_from_vgname(cmd, orphan_vgname, NULL, 0)))
- return_NULL;
-
vg = fmt->orphan_vg;
dm_list_iterate_items_safe(pvl, tpvl, &vg->pvs)
@@ -3973,40 +3947,6 @@ uint32_t vg_read_error(struct volume_group *vg_handle)
return SUCCESS;
}
-/*
- * Lock a vgname and/or check for existence.
- * Takes a WRITE lock on the vgname before scanning.
- * If scanning fails or vgname found, release the lock.
- * NOTE: If you find the return codes confusing, you might think of this
- * function as similar to an open() call with O_CREAT and O_EXCL flags
- * (open returns fail with -EEXIST if file already exists).
- *
- * Returns:
- * FAILED_LOCKING - Cannot lock name
- * FAILED_EXIST - VG name already exists - cannot reserve
- * SUCCESS - VG name does not exist in system and WRITE lock held
- */
-uint32_t vg_lock_newname(struct cmd_context *cmd, const char *vgname)
-{
- if (!lock_vol(cmd, vgname, LCK_VG_WRITE, NULL))
- return FAILED_LOCKING;
-
- /* Find the vgname in the cache */
- /* If it's not there we must do full scan to be completely sure */
- if (!lvmcache_fmt_from_vgname(cmd, vgname, NULL, 1)) {
- lvmcache_label_scan(cmd);
- if (!lvmcache_fmt_from_vgname(cmd, vgname, NULL, 1)) {
- lvmcache_label_scan(cmd);
- if (!lvmcache_fmt_from_vgname(cmd, vgname, NULL, 0))
- return SUCCESS; /* vgname not found after scanning */
- }
- }
-
- /* Found vgname so cannot reserve. */
- unlock_vg(cmd, NULL, vgname);
- return FAILED_EXIST;
-}
-
struct format_instance *alloc_fid(const struct format_type *fmt,
const struct format_instance_ctx *fic)
{
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index abf7013..61cb13b 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -446,80 +446,6 @@ static int _move_cache(struct volume_group *vg_from,
}
/*
- * Create or open the destination of the vgsplit operation.
- * Returns
- * - non-NULL: VG handle w/VG lock held
- * - NULL: no VG lock held
- */
-static struct volume_group *_vgsplit_to(struct cmd_context *cmd,
- const char *vg_name_to,
- int *existing_vg)
-{
- struct volume_group *vg_to = NULL;
- int exists = 0;
-
- log_verbose("Checking for new volume group \"%s\"", vg_name_to);
- /*
- * First try to create a new VG. If we cannot create it,
- * and we get FAILED_EXIST (we will not be holding a lock),
- * a VG must already exist with this name. We then try to
- * read the existing VG - the vgsplit will be into an existing VG.
- *
- * Otherwise, if the lock was successful, it must be the case that
- * we obtained a WRITE lock and could not find the vgname in the
- * system. Thus, the split will be into a new VG.
- */
- vg_to = vg_lock_and_create(cmd, vg_name_to, &exists);
- if (!vg_to && !exists) {
- log_error("Can't get lock for %s", vg_name_to);
- release_vg(vg_to);
- return NULL;
- }
- if (!vg_to && exists) {
- *existing_vg = 1;
- release_vg(vg_to);
- vg_to = vg_read_for_update(cmd, vg_name_to, NULL, 0, 0);
-
- if (vg_read_error(vg_to)) {
- release_vg(vg_to);
- return_NULL;
- }
-
- } else if (vg_read_error(vg_to) == SUCCESS) {
- *existing_vg = 0;
- }
- return vg_to;
-}
-
-/*
- * Open the source of the vgsplit operation.
- * Returns
- * - non-NULL: VG handle w/VG lock held
- * - NULL: no VG lock held
- */
-static struct volume_group *_vgsplit_from(struct cmd_context *cmd,
- const char *vg_name_from)
-{
- struct volume_group *vg_from;
-
- log_verbose("Checking for volume group \"%s\"", vg_name_from);
-
- vg_from = vg_read_for_update(cmd, vg_name_from, NULL, 0, 0);
- if (vg_read_error(vg_from)) {
- release_vg(vg_from);
- return NULL;
- }
-
- if (vg_is_shared(vg_from)) {
- log_error("vgsplit not allowed for lock_type %s", vg_from->lock_type);
- unlock_and_release_vg(cmd, vg_from, vg_name_from);
- return NULL;
- }
-
- return vg_from;
-}
-
-/*
* Has the user given an option related to a new vg as the split destination?
*/
static int _new_vg_option_specified(struct cmd_context *cmd)
@@ -537,11 +463,11 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
struct vgcreate_params vp_def;
const char *vg_name_from, *vg_name_to;
struct volume_group *vg_to = NULL, *vg_from = NULL;
+ struct lvmcache_vginfo *vginfo_to;
int opt;
int existing_vg = 0;
int r = ECMD_FAILED;
const char *lv_name;
- int lock_vg_from_first = 1;
if ((arg_is_set(cmd, name_ARG) + argc) < 3) {
log_error("Existing VG, new VG and either physical volumes "
@@ -577,47 +503,44 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
lvmcache_label_scan(cmd);
- if (strcmp(vg_name_to, vg_name_from) < 0)
- lock_vg_from_first = 0;
-
- if (lock_vg_from_first) {
- if (!(vg_from = _vgsplit_from(cmd, vg_name_from)))
- return_ECMD_FAILED;
- /*
- * Set metadata format of original VG.
- * NOTE: We must set the format before calling vg_lock_and_create()
- * since vg_lock_and_create() calls the per-format constructor.
- */
- cmd->fmt = vg_from->fid->fmt;
-
- if (!(vg_to = _vgsplit_to(cmd, vg_name_to, &existing_vg))) {
- unlock_and_release_vg(cmd, vg_from, vg_name_from);
- return_ECMD_FAILED;
+ if (!(vginfo_to = lvmcache_vginfo_from_vgname(vg_name_to, NULL))) {
+ if (!validate_name(vg_name_to)) {
+ log_error("Invalid vg name %s.", vg_name_to);
+ return ECMD_FAILED;
}
- } else {
- if (!(vg_to = _vgsplit_to(cmd, vg_name_to, &existing_vg)))
- return_ECMD_FAILED;
- if (!(vg_from = _vgsplit_from(cmd, vg_name_from))) {
- unlock_and_release_vg(cmd, vg_to, vg_name_to);
- return_ECMD_FAILED;
+ if (!lock_vol(cmd, vg_name_to, LCK_VG_WRITE, NULL)) {
+ log_error("Failed to lock new VG name %s.", vg_name_to);
+ return ECMD_FAILED;
}
- if (cmd->fmt != vg_from->fid->fmt) {
- /* In this case we don't know the vg_from->fid->fmt */
- log_error("Unable to set new VG metadata type based on "
- "source VG format - use -M option.");
- goto bad;
+ if (!(vg_to = vg_create(cmd, vg_name_to))) {
+ log_error("Failed to create new VG %s.", vg_name_to);
+ unlock_vg(cmd, NULL, vg_name_to);
+ return ECMD_FAILED;
+ }
+ } else {
+ if (!(vg_to = vg_read_for_update(cmd, vg_name_to, NULL, 0, 0))) {
+ log_error("Failed to read VG %s.", vg_name_to);
+ return ECMD_FAILED;
}
+ existing_vg = 1;
}
+ if (!(vg_from = vg_read_for_update(cmd, vg_name_from, NULL, 0, 0))) {
+ log_error("Failed to read VG %s.", vg_name_to);
+ unlock_and_release_vg(cmd, vg_to, vg_name_to);
+ return ECMD_FAILED;
+ }
+
+ cmd->fmt = vg_from->fid->fmt;
+
if (existing_vg) {
if (_new_vg_option_specified(cmd)) {
- log_error("Volume group \"%s\" exists, but new VG "
- "option specified", vg_name_to);
+ log_error("Volume group \"%s\" exists, but new VG option specified", vg_name_to);
goto bad;
}
- if (!vgs_are_compatible(cmd, vg_from,vg_to))
+ if (!vgs_are_compatible(cmd, vg_from, vg_to))
goto_bad;
} else {
if (!vgcreate_params_set_defaults(cmd, &vp_def, vg_from)) {
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=36cbc6db24f8aa01fb1c1…
Commit: 36cbc6db24f8aa01fb1c1be095b22a672434f754
Parent: 4c020b4d4afff51272252f58e5251f79c26f6603
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Jun 10 10:07:30 2019 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Jun 10 10:34:58 2019 -0500
locking: reset global_ex flag at end of cmd
These two flags may be not reset at the end of
the command when the unlock is implicit, which
is a problem if the cmd struct is reused.
Clear the flags in the general fin_locking.
---
lib/locking/locking.c | 10 +++++++++-
lib/locking/locking.h | 2 +-
tools/lvmcmdline.c | 2 +-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index 630a3bc..c3ea536 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -156,12 +156,20 @@ int init_locking(struct cmd_context *cmd,
return 1;
}
-void fin_locking(void)
+void fin_locking(struct cmd_context *cmd)
{
/* file locking disabled */
if (!_locking.flags)
return;
+ /*
+ * These may be automatically released when the
+ * command ends, without an explicit unlock call,
+ * in which case these flags would not be cleared.
+ */
+ cmd->lockf_global_ex = 0;
+ cmd->lockd_global_ex = 0;
+
_locking.fin_locking();
}
diff --git a/lib/locking/locking.h b/lib/locking/locking.h
index 41faf68..746667a 100644
--- a/lib/locking/locking.h
+++ b/lib/locking/locking.h
@@ -22,7 +22,7 @@
struct logical_volume;
int init_locking(struct cmd_context *cmd, int file_locking_sysinit, int file_locking_readonly, int file_locking_ignorefail);
-void fin_locking(void);
+void fin_locking(struct cmd_context *cmd);
void reset_locking(void);
int vg_write_lock_held(void);
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 30f54e6..8091b39 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3043,7 +3043,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
ret = cmd->command->fn(cmd, argc, argv);
lvmlockd_disconnect();
- fin_locking();
+ fin_locking(cmd);
if (!_cmd_no_meta_proc(cmd) && find_config_tree_bool(cmd, global_notify_dbus_CFG, NULL))
lvmnotify_send(cmd);
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a2c309a5c5eb22a94be0a…
Commit: a2c309a5c5eb22a94be0ae2919831a10b0493974
Parent: 07d41de74c40e6472a708fc0112ad668477305b5
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Fri Jun 7 17:59:43 2019 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Fri Jun 7 17:59:43 2019 +0200
build: make generate
---
conf/example.conf.in | 57 ++++++++++++++++++++++++++++++++++++++--
man/lvconvert.8_pregen | 61 ++++++++++++++++++++++++++++++++++++++++---
man/lvcreate.8_pregen | 5 ++-
man/pvck.8_pregen | 67 +++++++++++++++++++++++++++++++++++++++++++++---
4 files changed, 177 insertions(+), 13 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index dfe8006..a5eba01 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -88,6 +88,22 @@ devices {
#
external_device_info_source = "none"
+ # Configuration option devices/hints.
+ # Use a local file to remember which devices have PVs on them.
+ # Some commands will use this as an optimization to reduce device
+ # scanning, and will only scan the listed PVs. Removing the hint file
+ # will cause lvm to generate a new one. Disable hints if PVs will
+ # be copied onto devices using non-lvm commands, like dd.
+ #
+ # Accepted values:
+ # all
+ # Use all hints.
+ # none
+ # Use no hints.
+ #
+ # This configuration option has an automatic default value.
+ # hints = "all"
+
# Configuration option devices/preferred_names.
# Select which path name to display for a block device.
# If multiple path names exist for a block device, and LVM needs to
@@ -167,8 +183,18 @@ devices {
sysfs_scan = 1
# Configuration option devices/scan_lvs.
- # Scan LVM LVs for layered PVs.
- scan_lvs = 1
+ # Scan LVM LVs for layered PVs, allowing LVs to be used as PVs.
+ # When 1, LVM will detect PVs layered on LVs, and caution must be
+ # taken to avoid a host accessing a layered VG that may not belong
+ # to it, e.g. from a guest image. This generally requires excluding
+ # the LVs with device filters. Also, when this setting is enabled,
+ # every LVM command will scan every active LV on the system (unless
+ # filtered), which can cause performance problems on systems with
+ # many active LVs. When this setting is 0, LVM will not detect or
+ # use PVs that exist on LVs, and will not allow a PV to be created on
+ # an LV. The LVs are ignored using a built in device filter that
+ # identifies and excludes LVs.
+ scan_lvs = 0
# Configuration option devices/multipath_component_detection.
# Ignore devices that are components of DM multipath devices.
@@ -720,7 +746,8 @@ log {
# Configuration option log/indent.
# Indent messages according to their severity.
- indent = 1
+ # This configuration option has an automatic default value.
+ # indent = 0
# Configuration option log/command_names.
# Display the command name on each line of output.
@@ -746,6 +773,20 @@ log {
# available: memory, devices, io, activation, allocation,
# metadata, cache, locking, lvmpolld. Use "all" to see everything.
debug_classes = [ "memory", "devices", "io", "activation", "allocation", "metadata", "cache", "locking", "lvmpolld", "dbus" ]
+
+ # Configuration option log/debug_file_fields.
+ # The fields included in debug output written to log file.
+ # Use "all" to include everything (the default).
+ # This configuration option is advanced.
+ # This configuration option has an automatic default value.
+ # debug_file_fields = [ "time", "command", "fileline", "message" ]
+
+ # Configuration option log/debug_output_fields.
+ # The fields included in debug output written to stderr.
+ # Use "all" to include everything (the default).
+ # This configuration option is advanced.
+ # This configuration option has an automatic default value.
+ # debug_output_fields = [ "time", "command", "fileline", "message" ]
}
# Configuration section backup.
@@ -1174,6 +1215,16 @@ global {
# When enabled, an LVM command that changes PVs, changes VG metadata,
# or changes the activation state of an LV will send a notification.
notify_dbus = 1
+
+ # Configuration option global/io_memory_size.
+ # The amount of memory in KiB that LVM allocates to perform disk io.
+ # LVM performance may benefit from more io memory when there are many
+ # disks or VG metadata is large. Increasing this size may be necessary
+ # when a single copy of VG metadata is larger than the current setting.
+ # This value should usually not be decreased from the default; setting
+ # it too low can result in lvm failing to read VGs.
+ # This configuration option has an automatic default value.
+ # io_memory_size = 8192
}
# Configuration section activation.
diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen
index 842be37..7252f6f 100644
--- a/man/lvconvert.8_pregen
+++ b/man/lvconvert.8_pregen
@@ -43,6 +43,10 @@ lvconvert - Change logical volume layout
.ad b
.br
.ad l
+ \fB--cachevol\fP \fILV\fP
+.ad b
+.br
+.ad l
\fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT]
.ad b
.br
@@ -567,7 +571,7 @@ Convert LV to a thin LV, using the original LV as an external origin.
.br
-
-Attach a cache to an LV, converts the LV to type cache.
+Attach a cache pool to an LV, converts the LV to type cache.
.br
.P
\fBlvconvert\fP \fB--type\fP \fBcache\fP \fB--cachepool\fP \fILV\fP \fILV\fP\fI_linear_striped_thinpool_vdo_vdopool_vdopooldata_raid\fP
@@ -629,7 +633,7 @@ Attach a cache to an LV, converts the LV to type cache.
Attach a writecache to an LV, converts the LV to type writecache.
.br
.P
-\fBlvconvert\fP \fB--type\fP \fBwritecache\fP \fB--cachepool\fP \fILV\fP \fILV\fP\fI_linear_striped_raid\fP
+\fBlvconvert\fP \fB--type\fP \fBwritecache\fP \fB--cachevol\fP \fILV\fP \fILV\fP\fI_linear_striped_raid\fP
.br
.RS 4
.ad l
@@ -641,6 +645,49 @@ Attach a writecache to an LV, converts the LV to type writecache.
.br
-
+Attach a cache to an LV, converts the LV to type cache.
+.br
+.P
+\fBlvconvert\fP \fB--type\fP \fBcache\fP \fB--cachevol\fP \fILV\fP \fILV\fP\fI_linear_striped_thinpool_raid\fP
+.br
+.RS 4
+.ad l
+[ \fB-H\fP|\fB--cache\fP ]
+.ad b
+.br
+.ad l
+[ \fB-Z\fP|\fB--zero\fP \fBy\fP|\fBn\fP ]
+.ad b
+.br
+.ad l
+[ \fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT] ]
+.ad b
+.br
+.ad l
+[ \fB--cachemetadataformat\fP \fBauto\fP|\fB1\fP|\fB2\fP ]
+.ad b
+.br
+.ad l
+[ \fB--cachemode\fP \fBwritethrough\fP|\fBwriteback\fP|\fBpassthrough\fP ]
+.ad b
+.br
+.ad l
+[ \fB--cachepolicy\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--cachesettings\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--poolmetadatasize\fP \fISize\fP[m|UNIT] ]
+.ad b
+.br
+[ COMMON_OPTIONS ]
+.RE
+.br
+-
+
Convert LV to type thin-pool.
.br
.P
@@ -1047,7 +1094,7 @@ See \fBlvmcache\fP(7) for more information.
.ad l
\fB--cachepool\fP \fILV\fP
.br
-The name of a cache pool LV.
+The name of a cache pool.
.ad b
.HP
.ad l
@@ -1063,6 +1110,12 @@ See \fBlvmcache\fP(7) for more information.
.ad b
.HP
.ad l
+\fB--cachevol\fP \fILV\fP
+.br
+The name of a cache volume.
+.ad b
+.HP
+.ad l
\fB-c\fP|\fB--chunksize\fP \fISize\fP[k|UNIT]
.br
The size of chunks in a snapshot, cache pool or thin pool.
@@ -1689,7 +1742,7 @@ Convert LV to a thin LV, using the original LV as an external origin
.br
-
-Attach a cache to an LV (infers --type cache).
+Attach a cache pool to an LV (infers --type cache).
.br
.P
\fBlvconvert\fP \fB-H\fP|\fB--cache\fP \fB--cachepool\fP \fILV\fP \fILV\fP\fI_linear_striped_thinpool_vdo_vdopool_vdopooldata_raid\fP
diff --git a/man/lvcreate.8_pregen b/man/lvcreate.8_pregen
index f1d9f13..a80f9f5 100644
--- a/man/lvcreate.8_pregen
+++ b/man/lvcreate.8_pregen
@@ -309,7 +309,8 @@ numeric suffix.
In the usage section below, when creating a pool and the name is omitted
the new LV pool name is generated with the
"vpool" for vdo-pools for prefix and a unique numeric suffix.
-Also pool name can be specified together with \fIVG\fP name i.e.:
+
+Pool name can be specified together with \fIVG\fP name i.e.:
vg00/mythinpool.
.SH USAGE
Create a linear LV.
@@ -1097,7 +1098,7 @@ See \fBlvmcache\fP(7) for more information.
.ad l
\fB--cachepool\fP \fILV\fP
.br
-The name of a cache pool LV.
+The name of a cache pool.
.ad b
.HP
.ad l
diff --git a/man/pvck.8_pregen b/man/pvck.8_pregen
index 5277418..6cdfe42 100644
--- a/man/pvck.8_pregen
+++ b/man/pvck.8_pregen
@@ -1,26 +1,58 @@
.TH PVCK 8 "LVM TOOLS #VERSION#" "Red Hat, Inc."
.SH NAME
-pvck - Check the consistency of physical volume(s)
+pvck - Check metadata on physical volumes
.
.SH SYNOPSIS
-\fBpvck\fP \fIposition_args\fP
+\fBpvck\fP \fIoption_args\fP \fIposition_args\fP
.br
[ \fIoption_args\fP ]
.br
.SH DESCRIPTION
-pvck checks the LVM metadata for consistency on PVs.
+pvck checks LVM metadata on PVs.
+
+Use the --dump option to extract metadata from PVs for debugging.
+With dump, set --pvmetadatacopies 2 to extract metadata from a
+second metadata area at the end of the device. Use the --file
+option to save the raw metadata to a specified file. (The raw
+metadata is not usable with vgcfgbackup and vgcfgrestore.)
+
.SH USAGE
+Check for metadata on a device
+.br
+.P
\fBpvck\fP \fIPV\fP ...
.br
.RS 4
+[ COMMON_OPTIONS ]
+.RE
+.br
+
+Print metadata from a device
+.br
+.P
+\fBpvck\fP \fB--dump\fP \fIString\fP \fIPV\fP
+.br
+.RS 4
.ad l
-[ \fB--labelsector\fP \fINumber\fP ]
+[ \fB-f\fP|\fB--file\fP \fIString\fP ]
+.ad b
+.br
+.ad l
+[ \fB--[pv]metadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP ]
.ad b
.br
[ COMMON_OPTIONS ]
.RE
.br
+Common options for command:
+.
+.RS 4
+.ad l
+[ \fB--labelsector\fP \fINumber\fP ]
+.ad b
+.RE
+
Common options for lvm:
.
.RS 4
@@ -113,6 +145,21 @@ For testing and debugging.
.ad b
.HP
.ad l
+\fB--dump\fP \fIString\fP
+.br
+Dump metadata from a PV. Option values include \fBmetadata\fP
+to print or save the current text metadata, \fBmetadata_area\fP
+to save the entire text metadata area to a file, \fBmetadata_all\fP
+to save the current and any previous complete versions of metadata
+to a file, and \fBheaders\fP to print and check LVM headers.
+.ad b
+.HP
+.ad l
+\fB-f\fP|\fB--file\fP \fIString\fP
+.br
+.ad b
+.HP
+.ad l
\fB-h\fP|\fB--help\fP
.br
Display help text.
@@ -154,6 +201,18 @@ on the command.
.ad b
.HP
.ad l
+\fB--[pv]metadatacopies\fP \fB0\fP|\fB1\fP|\fB2\fP
+.br
+The number of metadata areas to set aside on a PV for storing VG metadata.
+When 2, one copy of the VG metadata is stored at the front of the PV
+and a second copy is stored at the end.
+When 1, one copy of the VG metadata is stored at the front of the PV.
+When 0, no copies of the VG metadata are stored on the given PV.
+This may be useful in VGs containing many PVs (this places limitations
+on the ability to use vgsplit later.)
+.ad b
+.HP
+.ad l
\fB-q\fP|\fB--quiet\fP ...
.br
Suppress output and log messages. Overrides --debug and --verbose.