master - cleanup: use const
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=aff62c74b7b947...
Commit: aff62c74b7b947d19dda7f03e79d0f2437ad4730
Parent: f16ad760cb828228affd13cb6d701dfb54a5f249
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 18 18:50:22 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 20 00:43:40 2017 +0100
cleanup: use const
---
tools/command.c | 4 ++--
tools/command.h | 2 +-
tools/lvmcmdline.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 0ec5176..f46fb3d 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -1302,8 +1302,8 @@ static void factor_common_options(void)
static int long_name_compare(const void *on1, const void *on2)
{
- struct opt_name **optname1 = (void *)on1;
- struct opt_name **optname2 = (void *)on2;
+ const struct opt_name * const *optname1 = (const void *)on1;
+ const struct opt_name * const *optname2 = (const void *)on2;
return strcmp((*optname1)->long_opt + 2, (*optname2)->long_opt + 2);
}
diff --git a/tools/command.h b/tools/command.h
index 95bd797..2d8f628 100644
--- a/tools/command.h
+++ b/tools/command.h
@@ -177,7 +177,7 @@ struct command {
int command_enum; /* <command_id>_CMD */
int command_index; /* position in commands[] */
- struct command_function *functions; /* new style */
+ const struct command_function *functions; /* new style */
command_fn fn; /* old style */
unsigned int cmd_flags; /* CMD_FLAG_ */
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index c304602..e796873 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -109,7 +109,7 @@ static struct cmdline_context _cmdline;
* to use these functions instead of the old per-command-name function.
* For now, any command id not included here uses the old command fn.
*/
-struct command_function command_functions[CMD_COUNT] = {
+static const struct command_function command_functions[CMD_COUNT] = {
{ lvmconfig_general_CMD, lvmconfig },
{ lvchange_properties_CMD, lvchange_properties_cmd },
{ lvchange_resync_CMD, lvchange_resync_cmd },
@@ -1112,7 +1112,7 @@ static struct command_name *find_command_name(const char *name)
return NULL;
}
-static struct command_function *_find_command_id_function(int command_enum)
+static const struct command_function *_find_command_id_function(int command_enum)
{
int i;
7 years, 2 months
master - man: thin dmeventd plugin update
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f16ad760cb8282...
Commit: f16ad760cb828228affd13cb6d701dfb54a5f249
Parent: cd24e6de898f9f20a56430d4a6d55c635a65bc65
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 19 15:50:19 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 20 00:43:12 2017 +0100
man: thin dmeventd plugin update
Document new dmeventd/thin_command lvm.conf configurable.
---
man/dmeventd.8.in | 108 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 74 insertions(+), 34 deletions(-)
diff --git a/man/dmeventd.8.in b/man/dmeventd.8.in
index aa62451..057f756 100644
--- a/man/dmeventd.8.in
+++ b/man/dmeventd.8.in
@@ -23,40 +23,6 @@ dmeventd is the event monitoring daemon for device-mapper devices.
Library plugins can register and carry out actions triggered when
particular events occur.
.
-.SH LVM PLUGINS
-.
-.HP
-.IR Mirror
-.br
-Attempts to handle device failure automatically. See
-.BR lvm.conf (5).
-.
-.HP
-.IR Raid
-.br
-Attempts to handle device failure automatically. See
-.BR lvm.conf (5).
-.
-.HP
-.IR Snapshot
-.br
-Monitors how full a snapshot is becoming and emits a warning to
-syslog when it exceeds 80% full.
-The warning is repeated when 85%, 90% and 95% of the snapshot is filled.
-See
-.BR lvm.conf (5).
-Snapshot which runs out of space gets invalid and when it is mounted,
-it gets umounted if possible.
-.
-.HP
-.IR Thin
-.br
-Monitors how full a thin pool data and metadata is becoming and emits
-a warning to syslog when it exceeds 80% full.
-The warning is repeated when 85%, 90% and 95% of the thin pool is filled.
-See
-.BR lvm.conf (5).
-If the thin-pool runs out of space, thin volumes are umounted if possible.
.
.SH OPTIONS
.
@@ -104,6 +70,80 @@ events to monitor from the currently running daemon.
.br
Show version of dmeventd.
.
+.SH LVM PLUGINS
+.
+.HP
+.BR Mirror
+.br
+Attempts to handle device failure automatically. See
+.BR lvm.conf (5).
+.
+.HP
+.BR Raid
+.br
+Attempts to handle device failure automatically. See
+.BR lvm.conf (5).
+.
+.HP
+.BR Snapshot
+.br
+Monitors how full a snapshot is becoming and emits a warning to
+syslog when it exceeds 80% full.
+The warning is repeated when 85%, 90% and 95% of the snapshot is filled.
+See
+.BR lvm.conf (5).
+Snapshot which runs out of space gets invalid and when it is mounted,
+it gets umounted if possible.
+.
+.HP
+.BR Thin
+.br
+Monitors how full a thin pool data and metadata is becoming and emits
+a warning to syslog when it exceeds 80% full.
+The warning is repeated when more then 85%, 90% and 95%
+of the thin pool is filled. See
+.BR lvm.conf (5).
+When a thin pool fills over 50% (data or metadata) thin plugin calls
+configured \fIdmeventd/thin_command\fP with every 5% increase.
+With default setting it calls internal
+\fBlvm lvextend --use-policies\fP to resize thin pool
+when it's been filled above configured threshold
+\fIactivation/thin_pool_autoextend_threshold\fP.
+If the command fails, dmeventd thin plugin will keep
+retrying execution with increasing time delay between
+retries upto 42 minutes.
+User may also configure external command to support more advanced
+maintenance operations of a thin pool.
+Such external command can e.g. remove some unneeded snapshots,
+use \fBfstrim\fP(8) to free recover space in a thin pool,
+but also can use \fBlvextend --use-policies\fP if other actions
+have not released enough space.
+Command is executed with environmental variable
+\fBLVM_RUN_BY_DMEVENTD=1\fP so any lvm2 command executed
+in this environment will not try to interact with dmeventd.
+To see the fullness of a thin pool command may check these
+two environmental variables
+\fBDMEVENTD_THIN_POOL_DATA\fP and \fBDMEVENTD_THIN_POOL_DATA\fP.
+Command can also read status with tools like \fBlvs\fP(8).
+.
+.SH ENVIRONMENT VARIABLES
+.
+.TP
+.B DMEVENTD_THIN_POOL_DATA
+Variable is set by thin plugin and is available to executed program. Value present
+actual usage of thin pool data volume. Variable is not set when error event
+is processed.
+.TP
+.B DMEVENTD_THIN_POOL_DATA
+Variable is set by thin plugin and is available to executed program. Value present
+actual usage of thin pool metadata volume. Variable is not set when error event
+is processed.
+.TP
+.B LVM_RUN_BY_DMEVENTD
+Variable is set by thin plugin to prohibit recursive interation
+with dmeventd by any executed lvm2 command from
+a thin_command environment.
+.
.SH SEE ALSO
.
.BR lvm (8),
7 years, 2 months
master - man: dmstats update
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cd24e6de898f9f...
Commit: cd24e6de898f9f20a56430d4a6d55c635a65bc65
Parent: 665479b818a7e43ca8176fcfdbe34f0fad03451e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 19 15:51:06 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Feb 19 22:59:43 2017 +0100
man: dmstats update
Fixing colorization bugs
---
man/dmstats.8.in | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/man/dmstats.8.in b/man/dmstats.8.in
index 167711c..ba828dc 100644
--- a/man/dmstats.8.in
+++ b/man/dmstats.8.in
@@ -44,7 +44,7 @@ dmstats \(em device-mapper statistics management
.B dmsetup
.B stats
.I command
-.RB [ options ]
+[OPTIONS]
.sp
.
.PD 0
@@ -53,13 +53,13 @@ dmstats \(em device-mapper statistics management
.de CMD_COMMAND
. ad l
. IR command
-. RI [ device_name |
-. RB [ \-u | \-\-uuid
-. IR uuid ]
-. RB | [ \-\-major
+. IR device_name " |"
+. BR \-\-major
. IR major
. BR \-\-minor
-. IR minor ]
+. IR minor " |"
+. BR \-u | \-\-uuid
+. IR uuid
. RB \%[ \-v | \-\-verbose]
. ad b
..
@@ -82,9 +82,7 @@ dmstats \(em device-mapper statistics management
.de CMD_CREATE
. ad l
. BR create
-. RB [ device_name...
-. RB | file_path...
-. RB | [ \-\-alldevices ]]
+. IR device_name... | file_path... | \fB\-\-alldevices
. RB [ \-\-areas
. IR nr_areas | \fB\-\-areasize
. IR area_size ]
@@ -110,8 +108,7 @@ dmstats \(em device-mapper statistics management
.de CMD_DELETE
. ad l
. BR delete
-. RI [ device_name ]
-. RB [ \-\-alldevices ]
+. IR device_name | \fB\-\-alldevices
. OPT_PROGRAMS
. OPT_REGIONS
. ad b
@@ -123,10 +120,9 @@ dmstats \(em device-mapper statistics management
.de CMD_GROUP
. ad l
. BR group
-. RI [ device_name ]
+. RI [ device_name | \fB\-\-alldevices ]
. RB [ \-\-alias
. IR name ]
-. RB [ \-\-alldevices ]
. RB [ \-\-regions
. IR regions ]
. ad b
@@ -205,8 +201,7 @@ dmstats \(em device-mapper statistics management
.de CMD_UNGROUP
. ad l
. BR ungroup
-. RI [ device_name ]
-. RB [ \-\-alldevices ]
+. RI [ device_name | \fB\-\-alldevices ]
. RB [ \-\-groupid
. IR id ]
. ad b
@@ -217,7 +212,7 @@ dmstats \(em device-mapper statistics management
.de CMD_UPDATE_FILEMAP
. ad l
. BR update_filemap
-. RI file_path
+. IR file_path
. RB [ \-\-groupid
. IR id ]
. ad b
7 years, 2 months
master - man: dmsetup update
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=665479b818a7e4...
Commit: 665479b818a7e43ca8176fcfdbe34f0fad03451e
Parent: 2a21a19d904c34e56e3ab3fe026dbc5658f68925
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 19 15:50:49 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Feb 19 22:59:43 2017 +0100
man: dmsetup update
---
man/dmsetup.8.in | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/man/dmsetup.8.in b/man/dmsetup.8.in
index 36a6d74..bd26efa 100644
--- a/man/dmsetup.8.in
+++ b/man/dmsetup.8.in
@@ -27,9 +27,9 @@ dmsetup \(em low level logical volume management
. IR uuid ]
. RB \%[ \-\-addnodeoncreate | \-\-addnodeonresume ]
. RB \%[ \-n | \-\-notable | \-\-table
-. RI \%{ table | table_file }]
+. IR \%table | table_file ]
. RB [ \-\-readahead
-. RB \%{[ + ] \fIsectors | auto | none }]
+. RB \%[ + ] \fIsectors | auto | none ]
. ad b
..
.CMD_CREATE
@@ -92,7 +92,7 @@ dmsetup \(em low level logical volume management
. BR load
. IR device_name
. RB [ \-\-table
-. RI { table | table_file }]
+. IR table | table_file ]
. ad b
..
.CMD_LOAD
@@ -146,7 +146,7 @@ dmsetup \(em low level logical volume management
. BR reload
. IR device_name
. RB [ \-\-table
-. RI { table | table_file }]
+. IR table | table_file ]
. ad b
..
.CMD_RELOAD
@@ -202,7 +202,7 @@ dmsetup \(em low level logical volume management
. RB [ \-\-noflush ]
. RB [ \-\-nolockfs ]
. RB \%[ \-\-readahead
-. RB \%{[ + ] \fIsectors | auto | none }]
+. RB \%[ + ] \fIsectors | auto | none ]
. ad b
..
.CMD_RESUME
@@ -447,7 +447,7 @@ The default interval is one second.
.
.HP
.BR \-\-manglename
-.RB { auto | hex | none }
+.BR auto | hex | none
.br
Mangle any character not on a whitelist using mangling_mode when
processing device-mapper device names and UUIDs. The names and UUIDs
@@ -529,7 +529,7 @@ Specify which fields to display.
.
.HP
.BR \-\-readahead
-.RB {[ + ] \fIsectors | auto | none }
+.RB [ + ] \fIsectors | auto | none
.br
Specify read ahead size in units of sectors.
The default value is \fBauto\fP which allows the kernel to choose
7 years, 2 months
master - commands: fix memleak
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2a21a19d904c34...
Commit: 2a21a19d904c34e56e3ab3fe026dbc5658f68925
Parent: 87c89ac2791e9b443db8c009db67610cbd97b4f2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 18 18:49:19 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Feb 19 22:59:43 2017 +0100
commands: fix memleak
Keep all allocations 'mempool' allocated for simple cleanup.
---
tools/lvmcmdline.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 26f7476..c304602 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2519,7 +2519,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
/* each command should start out with sigint flag cleared */
sigint_clear();
- cmd->name = strdup(argv[0]);
+ cmd->name = dm_pool_strdup(cmd->mem, argv[0]);
/* eliminate '-' from all options starting with -- */
for (i = 1; i < argc; i++) {
7 years, 2 months
master - lvresize: fix regressiong on accepting args
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87c89ac2791e9b...
Commit: 87c89ac2791e9b443db8c009db67610cbd97b4f2
Parent: 13944738d49ee420cb8b6b9eab4984b0a01b700d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 19 19:08:48 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sun Feb 19 22:59:43 2017 +0100
lvresize: fix regressiong on accepting args
Commit f45b68940667563e1a8d3bbd5d30864c04381bdf caused regression
of lvresize -m and --type parameter
After fix this sequence may work when we also fix syntax description:
lvcreate -l1 -m1 -n lv1 vg
lvextend --type mirror -m1 -l+1 vg/lv1
---
tools/lvresize.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/tools/lvresize.c b/tools/lvresize.c
index 28fd0fd..1d59239 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -21,7 +21,7 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
const char *cmd_name = command_name(cmd);
const char *type_str = arg_str_value(cmd, type_ARG, NULL);
- if (type_str && (lp->segtype = get_segtype_from_string(cmd, type_str)))
+ if (type_str && !(lp->segtype = get_segtype_from_string(cmd, type_str)))
return_0;
if (!strcmp(cmd_name, "lvreduce"))
@@ -122,10 +122,13 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
return 0;
}
- if ((lp->mirrors = arg_count(cmd, mirrors_ARG)) &&
- (arg_sign_value(cmd, mirrors_ARG, SIGN_NONE) == SIGN_MINUS)) {
- log_error("Mirrors argument may not be signed.");
- return 0;
+ if (arg_is_set(cmd, mirrors_ARG)) {
+ if (arg_sign_value(cmd, mirrors_ARG, SIGN_NONE) != SIGN_NONE) {
+ log_error("Mirrors argument may not be signed.");
+ return 0;
+ }
+ if ((lp->mirrors = arg_uint_value(cmd, mirrors_ARG, 0)))
+ lp->mirrors++;
}
if ((lp->stripes = arg_uint_value(cmd, stripes_ARG, 0)) &&
7 years, 2 months
master - man/help: fix description of r|R unit
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=13944738d49ee4...
Commit: 13944738d49ee420cb8b6b9eab4984b0a01b700d
Parent: fab0d63121f0ac59996526db40b70cb1efceb306
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 17 15:44:26 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 17 15:44:26 2017 -0600
man/help: fix description of r|R unit
---
tools/args.h | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/args.h b/tools/args.h
index 0575a2f..e7a1ab2 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -673,12 +673,11 @@ arg(unconfigured_ARG, '\0', "unconfigured", 0, 0, 0,
arg(units_ARG, '\0', "units", units_VAL, 0, 0,
"All sizes are output in these units:\n"
- "human-(r)eadable with rounding,\n"
+ "human-(r)eadable with '<' rounding indicator,\n"
"(h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes,\n"
"(g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes.\n"
"Capitalise to use multiples of 1000 (S.I.) instead of 1024.\n"
- "Custom units can be specified, e.g. --units 3M.\n"
- "r|R rounds numbers and displays the '<' prefix before rounded values.\n")
+ "Custom units can be specified, e.g. --units 3M.\n")
arg(unquoted_ARG, '\0', "unquoted", 0, 0, 0,
"When used with --nameprefixes, output values in the field=value\n"
7 years, 3 months
master - man: print space before built-in name
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fab0d63121f0ac...
Commit: fab0d63121f0ac59996526db40b70cb1efceb306
Parent: 87fe9328d30660e2eecd990bfce893ae65817f44
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 17 15:33:04 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 17 15:33:35 2017 -0600
man: print space before built-in name
print 'lvm config' not 'lvm-config'
---
tools/command.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 2897c65..0ec5176 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -2636,8 +2636,11 @@ void print_man(char *name, char *des_file, int include_primary, int include_seco
char *lvmname = name;
int i;
- if (!strncmp(name, "lvm-", 4))
+ if (!strncmp(name, "lvm-", 4)) {
+ char *space = strchr(lvmname, '-');
+ *space = ' ';
name += 4;
+ }
cname = find_command_name(name);
7 years, 3 months
master - man pvmove: move details to notes
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=87fe9328d30660...
Commit: 87fe9328d30660e2eecd990bfce893ae65817f44
Parent: 6064b0359a7f3fbc07e56dd7094732ea184c199e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 17 15:28:00 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 17 15:28:00 2017 -0600
man pvmove: move details to notes
---
man/pvmove.8.des | 45 ---------------------------------------------
man/pvmove.8.end | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 45 deletions(-)
diff --git a/man/pvmove.8.des b/man/pvmove.8.des
index 5286ef4..c003c5e 100644
--- a/man/pvmove.8.des
+++ b/man/pvmove.8.des
@@ -14,48 +14,3 @@ More than one pvmove can run concurrently if they are moving data from
different source PVs, but additional pvmoves will ignore any LVs already
in the process of being changed, so some data might not get moved.
-pvmove works as follows:
-
-1. A temporary 'pvmove' LV is created to store details of all the data
-movements required.
-
-2. Every LV in the VG is searched for contiguous data that need moving
-according to the command line arguments.
-For each piece of data found, a new segment is added to the end of the
-pvmove LV.
-This segment takes the form of a temporary mirror to copy the data
-from the original location to a newly allocated location.
-The original LV is updated to use the new temporary mirror segment
-in the pvmove LV instead of accessing the data directly.
-
-3. The VG metadata is updated on disk.
-
-4. The first segment of the pvmove LV is activated and starts to mirror
-the first part of the data. Only one segment is mirrored at once as this
-is usually more efficient.
-
-5. A daemon repeatedly checks progress at the specified time interval.
-When it detects that the first temporary mirror is in sync, it breaks that
-mirror so that only the new location for that data gets used and writes a
-checkpoint into the VG metadata on disk. Then it activates the mirror for
-the next segment of the pvmove LV.
-
-6. When there are no more segments left to be mirrored, the temporary LV
-is removed and the VG metadata is updated so that the LVs reflect the new
-data locations.
-
-Note that this new process cannot support the original LVM1
-type of on-disk metadata. Metadata can be converted using
-\fBvgconvert\fP(8).
-
-If the \fB\-\-atomic\fP option is used, a slightly different approach is
-used for the move. Again, a temporary 'pvmove' LV is created to store the
-details of all the data movements required. This temporary LV contains
-all the segments of the various LVs that need to be moved. However, in
-this case, an identical LV is allocated that contains the same number of
-segments and a mirror is created to copy the contents from the first
-temporary LV to the second. After a complete copy is made, the temporary
-LVs are removed, leaving behind the segments on the destination PV. If an
-abort is issued during the move, all LVs being moved will remain on the
-source PV.
-
diff --git a/man/pvmove.8.end b/man/pvmove.8.end
index 9dd3adc..906606d 100644
--- a/man/pvmove.8.end
+++ b/man/pvmove.8.end
@@ -1,3 +1,50 @@
+.SH NOTES
+
+pvmove works as follows:
+
+1. A temporary 'pvmove' LV is created to store details of all the data
+movements required.
+
+2. Every LV in the VG is searched for contiguous data that need moving
+according to the command line arguments.
+For each piece of data found, a new segment is added to the end of the
+pvmove LV.
+This segment takes the form of a temporary mirror to copy the data
+from the original location to a newly allocated location.
+The original LV is updated to use the new temporary mirror segment
+in the pvmove LV instead of accessing the data directly.
+
+3. The VG metadata is updated on disk.
+
+4. The first segment of the pvmove LV is activated and starts to mirror
+the first part of the data. Only one segment is mirrored at once as this
+is usually more efficient.
+
+5. A daemon repeatedly checks progress at the specified time interval.
+When it detects that the first temporary mirror is in sync, it breaks that
+mirror so that only the new location for that data gets used and writes a
+checkpoint into the VG metadata on disk. Then it activates the mirror for
+the next segment of the pvmove LV.
+
+6. When there are no more segments left to be mirrored, the temporary LV
+is removed and the VG metadata is updated so that the LVs reflect the new
+data locations.
+
+Note that this new process cannot support the original LVM1
+type of on-disk metadata. Metadata can be converted using
+\fBvgconvert\fP(8).
+
+If the \fB\-\-atomic\fP option is used, a slightly different approach is
+used for the move. Again, a temporary 'pvmove' LV is created to store the
+details of all the data movements required. This temporary LV contains
+all the segments of the various LVs that need to be moved. However, in
+this case, an identical LV is allocated that contains the same number of
+segments and a mirror is created to copy the contents from the first
+temporary LV to the second. After a complete copy is made, the temporary
+LVs are removed, leaving behind the segments on the destination PV. If an
+abort is issued during the move, all LVs being moved will remain on the
+source PV.
+
.SH EXAMPLES
Move all physical extents that are used by simple LVs on the specified PV to
7 years, 3 months
master - man: mention force behavior in various places
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6064b0359a7f3f...
Commit: 6064b0359a7f3fbc07e56dd7094732ea184c199e
Parent: 50e0345f9d245cdcb29e4988760e788defa5e88e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Feb 17 15:11:19 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Feb 17 15:11:19 2017 -0600
man: mention force behavior in various places
---
man/lvremove.8.des | 5 +++++
man/pvcreate.8.des | 3 +++
man/pvremove.8.des | 5 +++++
man/vgcfgrestore.8.des | 3 +++
man/vgremove.8.des | 3 +++
5 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/man/lvremove.8.des b/man/lvremove.8.des
index d049c63..14587c1 100644
--- a/man/lvremove.8.des
+++ b/man/lvremove.8.des
@@ -6,6 +6,11 @@ removal. LVs cannot be deactivated or removed while they are open (e.g.
if they contain a mounted filesystem). Removing an origin LV will also
remove all dependent snapshots.
+When a single force option is used, LVs are removed without confirmation,
+and the command will try to deactivate unused LVs.
+
+To remove damaged LVs, two force options may be required (\fB-ff\fP).
+
\fBHistorical LVs\fP
If the configuration setting \fBmetadata/record_lvs_history\fP is enabled
diff --git a/man/pvcreate.8.des b/man/pvcreate.8.des
index 3dfddbc..1b00e9e 100644
--- a/man/pvcreate.8.des
+++ b/man/pvcreate.8.des
@@ -16,3 +16,6 @@ data on that disk. This can be done by zeroing the first sector with:
Use \fBvgcreate\fP(8) to create a new VG on the PV, or \fBvgextend\fP(8)
to add the PV to existing VG.
+The force option will create a PV without confirmation. Repeating the
+force option (\fB-ff\fP) will forcibly create a PV, overriding checks that
+normally prevent it, e.g. if the PV is already in a VG.
diff --git a/man/pvremove.8.des b/man/pvremove.8.des
index f12b76e..cc84148 100644
--- a/man/pvremove.8.des
+++ b/man/pvremove.8.des
@@ -1,2 +1,7 @@
pvremove wipes the label on a device so that LVM will no longer recognise
it as a PV.
+
+A PV cannot be removed from a VG while it is used by an active LV.
+
+Repeat the force option (\fB-ff\fP) to forcibly remove a PV belonging to
+an existing VG. Normally, \fBvgreduce\fP(8) should be used instead.
diff --git a/man/vgcfgrestore.8.des b/man/vgcfgrestore.8.des
index cb7867d..ee3a99e 100644
--- a/man/vgcfgrestore.8.des
+++ b/man/vgcfgrestore.8.des
@@ -6,3 +6,6 @@ A back up file can be specified with \fB\-\-file\fP. If no backup file is
specified, the most recent one is used. Use \fB\-\-list\fP for a list of
the available back up and archive files of a VG.
+WARNING: When a VG contains thin pools, changes to thin metadata cannot be
+reverted, and data loss may occur if thin metadata has changed. The force
+option is required to restore in this case.
diff --git a/man/vgremove.8.des b/man/vgremove.8.des
index 04dc0e3..6414c73 100644
--- a/man/vgremove.8.des
+++ b/man/vgremove.8.des
@@ -4,3 +4,6 @@ to confirm LV removal.
If one or more PVs in the VG are lost, consider
\fBvgreduce \-\-removemissing\fP to make the VG
metadata consistent again.
+
+Repeat the force option (\fB-ff\fP) to forcibly remove LVs in the VG
+without confirmation.
7 years, 3 months