Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ff64e3500f6acf93…
Commit: ff64e3500f6acf93dce017388445c4828111d06f
Parent: e7ccad2ef0e813f6ca42ab5090e76aa5bee05912
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Thu Apr 11 15:33:59 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Thu Apr 11 15:33:59 2013 -0500
RAID: Add scrubbing support for RAID LVs
New options to 'lvchange' allow users to scrub their RAID LVs.
Synopsis:
lvchange --syncaction {check|repair} vg/raid_lv
RAID scrubbing is the process of reading all the data and parity blocks in
an array and checking to see whether they are coherent. 'lvchange' can
now initaite the two scrubbing operations: "check" and "repair". "check"
will go over the array and recored the number of discrepancies but not
repair them. "repair" will correct the discrepancies as it finds them.
'lvchange --syncaction repair vg/raid_lv' is not to be confused with
'lvconvert --repair vg/raid_lv'. The former initiates a background
synchronization operation on the array, while the latter is designed to
repair/replace failed devices in a mirror or RAID logical volume.
Additional reporting has been added for 'lvs' to support the new
operations. Two new printable fields (which are not printed by
default) have been added: "syncaction" and "mismatches". These
can be accessed using the '-o' option to 'lvs', like:
lvs -o +syncaction,mismatches vg/lv
"syncaction" will print the current synchronization operation that the
RAID volume is performing. It can be one of the following:
- idle: All sync operations complete (doing nothing)
- resync: Initializing an array or recovering after a machine failure
- recover: Replacing a device in the array
- check: Looking for array inconsistencies
- repair: Looking for and repairing inconsistencies
The "mismatches" field with print the number of descrepancies found during
a check or repair operation.
The 'Cpy%Sync' field already available to 'lvs' will print the progress
of any of the above syncactions, including check and repair.
Finally, the lv_attr field has changed to accomadate the scrubbing operations
as well. The role of the 'p'artial character in the lv_attr report field
as expanded. "Partial" is really an indicator for the health of a
logical volume and it makes sense to extend this include other health
indicators as well, specifically:
'm'ismatches: Indicates that there are discrepancies in a RAID
LV. This character is shown after a scrubbing
operation has detected that portions of the RAID
are not coherent.
'r'efresh : Indicates that a device in a RAID array has suffered
a failure and the kernel regards it as failed -
even though LVM can read the device label and
considers the device to be ok. The LV should be
'r'efreshed to notify the kernel that the device is
now available, or the device should be 'r'eplaced
if it is suspected of failing.
---
WHATS_NEW | 1 +
lib/activate/activate.c | 133 +++++++++++++++++++++++++++++++++++++++-
lib/activate/activate.h | 3 +
lib/activate/dev_manager.c | 49 +++++++++++++++
lib/activate/dev_manager.h | 3 +
lib/metadata/lv.c | 14 +++-
lib/report/columns.h | 2 +
lib/report/properties.c | 20 ++++++
lib/report/report.c | 36 +++++++++++
man/lvchange.8.in | 14 ++++
man/lvs.8.in | 16 ++++-
test/shell/lvchange-raid.sh | 145 +++++++++++++++++++++++++++++++++++++++++++
tools/args.h | 1 +
tools/commands.h | 5 +-
tools/lvchange.c | 39 +++++++++---
15 files changed, 463 insertions(+), 18 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c41dd04..43c39d6 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ New lvchange arg, '--syncaction' allows scrubbing of RAID LVs.
Improve RAID kernel status retrieval to include sync_action/mismatch_cnt.
Add external origin support for lvcreate.
Improve lvcreate, lvconvert and lvm man pages.
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 572383f..b3439ad 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -183,6 +183,18 @@ int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health)
{
return 0;
}
+int lv_raid_mismatch_count(const struct logical_volume *lv, uint64_t *cnt)
+{
+ return 0;
+}
+int lv_raid_sync_action(const struct logical_volume *lv, char **sync_action)
+{
+ return 0;
+}
+int lv_raid_message(const struct logical_volume *lv, const char *msg)
+{
+ return 0;
+}
int lv_thin_pool_percent(const struct logical_volume *lv, int metadata,
percent_t *percent)
{
@@ -796,7 +808,7 @@ int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health)
*dev_health = NULL;
if (!activation())
- return 0;
+ return_0;
log_debug_activation("Checking raid device health for LV %s/%s",
lv->vg->name, lv->name);
@@ -820,6 +832,125 @@ int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health)
return r;
}
+int lv_raid_mismatch_count(const struct logical_volume *lv, uint64_t *cnt)
+{
+ struct dev_manager *dm;
+ struct dm_status_raid *status;
+
+ *cnt = 0;
+
+ if (!activation())
+ return 0;
+
+ log_debug_activation("Checking raid mismatch count for LV %s/%s",
+ lv->vg->name, lv->name);
+
+ if (!lv_is_active(lv))
+ return_0;
+
+ if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ return_0;
+
+ if (!dev_manager_raid_status(dm, lv, &status)) {
+ dev_manager_destroy(dm);
+ return_0;
+ }
+ *cnt = status->mismatch_count;
+
+ dev_manager_destroy(dm);
+
+ return 1;
+}
+
+int lv_raid_sync_action(const struct logical_volume *lv, char **sync_action)
+{
+ struct dev_manager *dm;
+ struct dm_status_raid *status;
+ char *action;
+
+ *sync_action = NULL;
+
+ if (!activation())
+ return 0;
+
+ log_debug_activation("Checking raid sync_action for LV %s/%s",
+ lv->vg->name, lv->name);
+
+ if (!lv_is_active(lv))
+ return_0;
+
+ if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ return_0;
+
+ if (!dev_manager_raid_status(dm, lv, &status) ||
+ !(action = dm_pool_strdup(lv->vg->cmd->mem,
+ status->sync_action))) {
+ dev_manager_destroy(dm);
+ return_0;
+ }
+
+ *sync_action = action;
+
+ dev_manager_destroy(dm);
+
+ return 1;
+}
+
+int lv_raid_message(const struct logical_volume *lv, const char *msg)
+{
+ int r = 0;
+ struct dev_manager *dm;
+ struct dm_status_raid *status;
+
+ if (!lv_is_active(lv)) {
+ log_error("Unable to send message to an inactive logical volume.");
+ return 0;
+ }
+
+ if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
+ return_0;
+
+ if (!(r = dev_manager_raid_status(dm, lv, &status))) {
+ log_error("Failed to retrieve status of %s/%s",
+ lv->vg->name, lv->name);
+ goto out;
+ }
+
+ if (!status->sync_action) {
+ log_error("Kernel driver does not support this action: %s", msg);
+ goto out;
+ }
+
+ /*
+ * Note that 'dev_manager_raid_message' allows us to pass down any
+ * currently valid message. However, this function restricts the
+ * number of user available combinations to a minimum. Specifically,
+ * "idle" -> "check"
+ * "idle" -> "repair"
+ * (The state automatically switches to "idle" when a sync process is
+ * complete.)
+ */
+ if (strcmp(msg, "check") && strcmp(msg, "repair")) {
+ /*
+ * MD allows "frozen" to operate in a toggling fashion.
+ * We could allow this if we like...
+ */
+ log_error("\"%s\" is not a supported sync operation.", msg);
+ goto out;
+ }
+ if (strcmp(status->sync_action, "idle")) {
+ log_error("%s/%s state is currently \"%s\". Unable to switch to \"%s\".",
+ lv->vg->name, lv->name, status->sync_action, msg);
+ goto out;
+ }
+
+ r = dev_manager_raid_message(dm, lv, msg);
+out:
+ dev_manager_destroy(dm);
+
+ return r;
+}
+
/*
* Returns data or metadata percent usage, depends on metadata 0/1.
* Returns 1 if percent set, else 0 on failure.
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index bf1f7a0..f7c312f 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -117,6 +117,9 @@ int lv_mirror_percent(struct cmd_context *cmd, const struct logical_volume *lv,
int wait, percent_t *percent, uint32_t *event_nr);
int lv_raid_percent(const struct logical_volume *lv, percent_t *percent);
int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health);
+int lv_raid_mismatch_count(const struct logical_volume *lv, uint64_t *cnt);
+int lv_raid_sync_action(const struct logical_volume *lv, char **sync_action);
+int lv_raid_message(const struct logical_volume *lv, const char *msg);
int lv_thin_pool_percent(const struct logical_volume *lv, int metadata,
percent_t *percent);
int lv_thin_percent(const struct logical_volume *lv, int mapped,
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 4a77320..8c06476 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1066,6 +1066,55 @@ out:
return r;
}
+int dev_manager_raid_message(struct dev_manager *dm,
+ const struct logical_volume *lv,
+ const char *msg)
+{
+ int r = 0;
+ const char *dlid;
+ struct dm_task *dmt;
+ const char *layer = lv_layer(lv);
+
+ if (!(lv->status & RAID)) {
+ log_error(INTERNAL_ERROR "%s/%s is not a RAID logical volume",
+ lv->vg->name, lv->name);
+ return 0;
+ }
+
+ /* These are the supported RAID messages for dm-raid v1.5.0 */
+ if (!strcmp(msg, "idle") &&
+ !strcmp(msg, "frozen") &&
+ !strcmp(msg, "resync") &&
+ !strcmp(msg, "recover") &&
+ !strcmp(msg, "check") &&
+ !strcmp(msg, "repair") &&
+ !strcmp(msg, "reshape")) {
+ log_error("Unknown RAID message: %s", msg);
+ return 0;
+ }
+
+ if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, layer)))
+ return_0;
+
+ if (!(dmt = _setup_task(NULL, dlid, 0, DM_DEVICE_TARGET_MSG, 0, 0)))
+ return_0;
+
+ if (!dm_task_no_open_count(dmt))
+ log_error("Failed to disable open_count.");
+
+ if (!dm_task_set_message(dmt, msg))
+ goto_out;
+
+ if (!dm_task_run(dmt))
+ goto_out;
+
+ r = 1;
+out:
+ dm_task_destroy(dmt);
+
+ return r;
+}
+
#if 0
log_very_verbose("%s %s", sus ? "Suspending" : "Resuming", name);
diff --git a/lib/activate/dev_manager.h b/lib/activate/dev_manager.h
index a4556e7..ecf3c5f 100644
--- a/lib/activate/dev_manager.h
+++ b/lib/activate/dev_manager.h
@@ -57,6 +57,9 @@ int dev_manager_mirror_percent(struct dev_manager *dm,
int dev_manager_raid_status(struct dev_manager *dm,
const struct logical_volume *lv,
struct dm_status_raid **status);
+int dev_manager_raid_message(struct dev_manager *dm,
+ const struct logical_volume *lv,
+ const char *msg);
int dev_manager_thin_pool_status(struct dev_manager *dm,
const struct logical_volume *lv,
struct dm_status_thin_pool **status,
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index f1c79be..5cb87c3 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -597,11 +597,17 @@ char *lv_attr_dup(struct dm_pool *mem, const struct logical_volume *lv)
else
repstr[7] = '-';
- if (lv->status & PARTIAL_LV ||
- (lv_is_raid_type(lv) && !_lv_raid_healthy(lv)))
+ repstr[8] = '-';
+ if (lv->status & PARTIAL_LV)
repstr[8] = 'p';
- else
- repstr[8] = '-';
+ else if (lv_is_raid_type(lv)) {
+ uint64_t n;
+ if (!_lv_raid_healthy(lv))
+ repstr[8] = 'r'; /* RAID needs 'r'efresh */
+ else if ((lv->status & RAID) &&
+ lv_raid_mismatch_count(lv, &n) && n)
+ repstr[8] = 'm'; /* RAID contains 'm'ismatches */
+ }
out:
return repstr;
diff --git a/lib/report/columns.h b/lib/report/columns.h
index 23d3e11..b6dc483 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -80,6 +80,8 @@ FIELD(LVS, lv, NUM, "Snap%", lvid, 6, snpercent, snap_percent, "For snapshots, t
FIELD(LVS, lv, NUM, "Meta%", lvid, 6, metadatapercent, metadata_percent, "For thin pools, the percentage of metadata full if LV is active.", 0)
FIELD(LVS, lv, NUM, "Cpy%Sync", lvid, 8, copypercent, copy_percent, "For RAID, mirrors and pvmove, current percentage in-sync.", 0)
FIELD(LVS, lv, NUM, "Cpy%Sync", lvid, 8, copypercent, sync_percent, "For RAID, mirrors and pvmove, current percentage in-sync.", 0)
+FIELD(LVS, lv, NUM, "Mismatches", lvid, 10, mismatch_count, mismatches, "For RAID, number of mismatches found or repaired.", 0)
+FIELD(LVS, lv, STR, "SyncAction", lvid, 10, sync_action, syncaction, "For RAID, the current synchronization action being performed.", 0)
FIELD(LVS, lv, STR, "Move", lvid, 4, movepv, move_pv, "For pvmove, Source PV of temporary LV created by pvmove.", 0)
FIELD(LVS, lv, STR, "Convert", lvid, 7, convertlv, convert_lv, "For lvconvert, Name of temporary LV created by lvconvert.", 0)
FIELD(LVS, lv, STR, "Log", lvid, 3, loglv, mirror_log, "For mirrors, the LV holding the synchronisation log.", 0)
diff --git a/lib/report/properties.c b/lib/report/properties.c
index 08443d4..c04a6a1 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -93,6 +93,22 @@ static percent_t _copy_percent(const struct logical_volume *lv) {
return perc;
}
+static uint64_t _mismatches(const struct logical_volume *lv) {
+ uint64_t cnt;
+
+ if (!lv_raid_mismatch_count(lv, &cnt))
+ return 0;
+ return cnt;
+}
+
+static char *_sync_action(const struct logical_volume *lv) {
+ char *action;
+
+ if (!lv_raid_sync_action(lv, &action))
+ return 0;
+ return action;
+}
+
static percent_t _snap_percent(const struct logical_volume *lv) {
percent_t perc;
@@ -195,6 +211,10 @@ GET_LV_NUM_PROPERTY_FN(copy_percent, _copy_percent(lv))
#define _copy_percent_set _not_implemented_set
GET_LV_NUM_PROPERTY_FN(sync_percent, _copy_percent(lv))
#define _sync_percent_set _not_implemented_set
+GET_LV_NUM_PROPERTY_FN(mismatches, _mismatches(lv))
+#define _mismatches_set _not_implemented_set
+GET_LV_STR_PROPERTY_FN(syncaction, _sync_action(lv))
+#define _syncaction_set _not_implemented_set
GET_LV_STR_PROPERTY_FN(move_pv, lv_move_pv_dup(lv->vg->vgmem, lv))
#define _move_pv_set _not_implemented_set
GET_LV_STR_PROPERTY_FN(convert_lv, lv_convert_lv_dup(lv->vg->vgmem, lv))
diff --git a/lib/report/report.c b/lib/report/report.c
index 633dfe4..4b0ebef 100644
--- a/lib/report/report.c
+++ b/lib/report/report.c
@@ -936,6 +936,42 @@ no_copypercent:
return 1;
}
+static int _sync_action_disp(struct dm_report *rh __attribute__((unused)),
+ struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data,
+ void *private __attribute__((unused)))
+{
+ const struct logical_volume *lv = (const struct logical_volume *) data;
+ char *sync_action;
+
+ if (!(lv->status & RAID) ||
+ !lv_raid_sync_action(lv, &sync_action)) {
+ dm_report_field_set_value(field, "", NULL);
+ return 1;
+ }
+
+ return _string_disp(rh, mem, field, &sync_action, private);
+}
+
+static int _mismatch_count_disp(struct dm_report *rh __attribute__((unused)),
+ struct dm_pool *mem,
+ struct dm_report_field *field,
+ const void *data,
+ void *private __attribute__((unused)))
+{
+ const struct logical_volume *lv = (const struct logical_volume *) data;
+ uint64_t mismatch_count;
+
+ if (!(lv->status & RAID) ||
+ !lv_raid_mismatch_count(lv, &mismatch_count)) {
+ dm_report_field_set_value(field, "", NULL);
+ return 1;
+ }
+
+ return dm_report_field_uint64(rh, field, &mismatch_count);
+}
+
static int _dtpercent_disp(int metadata, struct dm_report *rh,
struct dm_pool *mem,
struct dm_report_field *field,
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 32a0580..295eea2 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -26,6 +26,8 @@ lvchange \- change attributes of a logical volume
.RI { y | n }]
.RB [ \-\-poll
.RI { y | n }]
+.RB [ \-\-syncaction
+.RI { check | repair }]
.RB [ \-\-sysinit ]
.RB [ \-\-noudevsync ]
.RB [ \-M | \-\-persistent
@@ -107,6 +109,18 @@ process from its last checkpoint. However, it may not be appropriate to
immediately poll a logical volume when it is activated, use
\fB\-\-poll n\fP to defer and then \fB\-\-poll y\fP to restart the process.
.TP
+.BR \-\-syncaction " {" \fIcheck | \fIrepair }
+This argument is used to initiate various RAID synchronization operations.
+The \fIcheck\fP and \fIrepair\fP options provide a way to check the
+integrity of a RAID logical volume (often referred to as "scrubbing").
+These options cause the RAID logical volume to
+read all of the data and parity blocks in the array and check for any
+discrepancies (e.g. mismatches between mirrors or incorrect parity values).
+If \fIcheck\fP is used, the discrepancies will be counted but not repaired.
+If \fIrepair\fP is used, the discrepancies will be corrected as they are
+encountered. The 'lvs' command can be used to show the number of
+discrepancies found or repaired.
+.TP
.B \-\-sysinit
Indicates that \fBlvchange\fP(8) is being invoked from early system
initialisation scripts (e.g. rc.sysinit or an initrd),
diff --git a/man/lvs.8.in b/man/lvs.8.in
index d4d77b0..727353b 100644
--- a/man/lvs.8.in
+++ b/man/lvs.8.in
@@ -97,6 +97,7 @@ lv_time,
lv_uuid,
metadata_lv,
mirror_log,
+mismatches,
modules,
move_pv,
origin,
@@ -113,6 +114,7 @@ seg_tags,
snap_percent,
stripes,
stripe_size,
+sync_action,
sync_percent,
thin_count,
transaction_id,
@@ -159,8 +161,18 @@ snapshots of thin volumes using the new thin provisioning driver appear as (t).
.IP 8 3
Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.
.IP 9 3
-(p)artial: One or more of the Physical Volumes this Logical Volume uses is
-missing from the system.
+Volume Health: (p)artial, (r)efresh needed, (m)ismatches exist.
+(p)artial signifies that one or more of the Physical Volumes this Logical
+Volume uses is missing from the system. (r)efresh signifies that one or
+more of the Physical Volumes this RAID Logical Volume uses had suffered a
+write error. The write error could be due to a temporary failure of that
+Physical Volume or an indication that it is failing. The device should be
+refreshed or replaced. (m)ismatches signifies that the RAID logical volume
+has portions of the array that are not coherent or that the array has
+recently repaired inconsistencies. An additional "check" after a "repair"
+of a RAID logical volume will clear this flag if no additional discrepancies
+are found. ("check" and "repair" of a RAID Logical Volume can be done via
+the 'lvchange' command.)
.RE
.TP
.BR \-O ", " \-\-sort
diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh
new file mode 100644
index 0000000..a1c9540
--- /dev/null
+++ b/test/shell/lvchange-raid.sh
@@ -0,0 +1,145 @@
+#!/bin/sh
+# Copyright (C) 2013 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# This test ensures that 'lvchange --refresh vg/raid_lv' properly restores
+# a transiently failed device in RAID LVs.
+
+. lib/test
+
+# dm-raid v1.5.0+ contains RAID scrubbing support
+aux target_at_least dm-raid 1 5 0 || skip
+
+aux prepare_vg 5
+
+# run_syncaction_check <VG> <LV>
+run_syncaction_check() {
+ local device
+ local seek
+ local size
+
+ aux wait_for_sync $1 $2
+
+ device=`lvs -a --noheadings -o devices $1/${2}_rimage_1 | sed s/\(.\)//`
+ device=$(sed s/^[[:space:]]*// <<< "$device")
+ size=`lvs -a --noheadings -o size --units 1k $1/$2 | sed s/\.00k//`
+ size=$(sed s/^[[:space:]]*// <<< "$size")
+ size=$(($size / 2))
+ seek=`pvs --noheadings -o mda_size --units 1k $device | sed s/\.00k//`
+ seek=$(sed s/^[[:space:]]*// <<< "$seek")
+ seek=$(($size + $seek))
+
+ # Check all is normal
+ if ! lvs --noheadings -o lv_attr $1/$2 | grep '.*-$' ||
+ [ `lvs --noheadings -o mismatches $1/$2` != 0 ]; then
+ #
+ # I think this is a kernel bug. It happens randomly after
+ # a RAID device creation. I think the mismatch count
+ # should not be set unless a check or repair is run.
+ #
+ echo "Strange... RAID has mismatch count after creation."
+
+ # Run "check" should turn up clean
+ lvchange --syncaction check $1/$2
+ fi
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*-$'
+ [ `lvs --noheadings -o mismatches $1/$2` == 0 ]
+
+ # Overwrite the last half of one of the PVs with crap
+ dd if=/dev/urandom of=$device bs=1k count=$size seek=$seek
+
+ # FIXME: Why is this necessary? caching effects?
+ # I don't need to do this when testing "real" devices...
+ lvchange -an $1/$2; lvchange -ay $1/$2
+
+ # "check" should find discrepancies but not change them
+ # 'lvs' should show results
+ lvchange --syncaction check $1/$2
+ aux wait_for_sync $1 $2
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*m$'
+ [ `lvs --noheadings -o mismatches $1/$2` != 0 ]
+
+ # "repair" will fix discrepancies and record number fixed
+ lvchange --syncaction repair $1/$2
+ aux wait_for_sync $1 $2
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*m$'
+ [ `lvs --noheadings -o mismatches $1/$2` != 0 ]
+
+ # Final "check" should show no mismatches
+ # 'lvs' should show results
+ lvchange --syncaction check $1/$2
+ aux wait_for_sync $1 $2
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*-$'
+ [ `lvs --noheadings -o mismatches $1/$2` == 0 ]
+}
+
+# run_refresh_check <VG> <LV>
+# Assumes "$dev2" is in the array
+run_refresh_check() {
+ aux wait_for_sync $1 $2
+
+ # Disable dev2 and do some I/O to make the kernel notice
+ aux disable_dev "$dev2"
+ dd if=/dev/urandom of=/dev/$1/$2 bs=4M count=1
+
+ # Check for 'p'artial flag
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*p$'
+
+ aux enable_dev "$dev2"
+
+ # Check for 'r'efresh flag
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*r$'
+
+ lvchange --refresh $1/$2
+
+ # Writing random data above should mean that the devices
+ # were out-of-sync. The refresh should have taken care
+ # of properly reintegrating the device. If any mismatches
+ # are repaired, it will show up in the 'lvs' output.
+ lvchange --syncaction repair $1/$2
+ aux wait_for_sync $1 $2
+ lvs --noheadings -o lv_attr $1/$2 | grep '.*-$'
+}
+
+run_checks() {
+ if aux target_at_least dm-raid 1 5 0; then
+ run_syncaction_check $1 $2
+ fi
+
+ if aux target_at_least dm-raid 1 5 1; then
+ run_refresh_check $1 $2
+ fi
+}
+
+########################################################
+# MAIN
+########################################################
+
+lvcreate --type raid1 -m 1 -l 2 -n $lv1 $vg "$dev1" "$dev2"
+run_checks $vg $lv1
+lvremove -ff $vg
+
+lvcreate --type raid4 -i 2 -l 4 -n $lv1 $vg "$dev1" "$dev2" "$dev3" "$dev4"
+run_checks $vg $lv1
+lvremove -ff $vg
+
+lvcreate --type raid5 -i 2 -l 4 -n $lv1 $vg "$dev1" "$dev2" "$dev3" "$dev4"
+run_checks $vg $lv1
+lvremove -ff $vg
+
+lvcreate --type raid6 -i 3 -l 6 -n $lv1 $vg \
+ "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
+run_checks $vg $lv1
+lvremove -ff $vg
+
+lvcreate --type raid10 -m 1 -i 2 -l 4 -n $lv1 $vg \
+ "$dev1" "$dev2" "$dev3" "$dev4"
+run_checks $vg $lv1
+lvremove -ff $vg
diff --git a/tools/args.h b/tools/args.h
index 49ddcd2..81793a5 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -86,6 +86,7 @@ arg(ignoreadvanced_ARG, '\0', "ignoreadvanced", NULL, 0)
arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", NULL, 0)
arg(atversion_ARG, '\0', "atversion", string_arg, 0)
arg(validate_ARG, '\0', "validate", NULL, 0)
+arg(syncaction_ARG, '\0', "syncaction", string_arg, 0)
/* Allow some variations */
arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0)
diff --git a/tools/commands.h b/tools/commands.h
index 9aed9e7..3124a13 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -90,6 +90,7 @@ xx(lvchange,
"\t[-r|--readahead ReadAheadSectors|auto|none]\n"
"\t[--refresh]\n"
"\t[--resync]\n"
+ "\t[--syncaction {check|repair}\n"
"\t[--sysinit]\n"
"\t[-t|--test]\n"
"\t[-v|--verbose]\n"
@@ -102,8 +103,8 @@ xx(lvchange,
discards_ARG, force_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG,
major_ARG, minor_ARG, monitor_ARG, noudevsync_ARG, partial_ARG,
permission_ARG, persistent_ARG, poll_ARG, readahead_ARG, resync_ARG,
- refresh_ARG, addtag_ARG, deltag_ARG, sysinit_ARG, test_ARG, yes_ARG,
- zero_ARG)
+ refresh_ARG, addtag_ARG, deltag_ARG, syncaction_ARG, sysinit_ARG, test_ARG,
+ yes_ARG, zero_ARG)
xx(lvconvert,
"Change logical volume layout",
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 67db083..e19e2e7 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -261,13 +261,6 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
return 1;
}
-static int lvchange_refresh(struct cmd_context *cmd, struct logical_volume *lv)
-{
- log_verbose("Refreshing logical volume \"%s\" (if active)", lv->name);
-
- return lv_refresh(cmd, lv);
-}
-
static int detach_metadata_devices(struct lv_segment *seg, struct dm_list *list)
{
uint32_t s;
@@ -328,8 +321,28 @@ static int attach_metadata_devices(struct lv_segment *seg, struct dm_list *list)
return 1;
}
-static int lvchange_resync(struct cmd_context *cmd,
- struct logical_volume *lv)
+/*
+ * lvchange_refresh
+ * @cmd
+ * @lv
+ *
+ * Suspend and resume a logical volume.
+ */
+static int lvchange_refresh(struct cmd_context *cmd, struct logical_volume *lv)
+{
+ log_verbose("Refreshing logical volume \"%s\" (if active)", lv->name);
+
+ return lv_refresh(cmd, lv);
+}
+
+/*
+ * lvchange_resync
+ * @cmd
+ * @lv
+ *
+ * Force a mirror or RAID array to undergo a complete initializing resync.
+ */
+static int lvchange_resync(struct cmd_context *cmd, struct logical_volume *lv)
{
int active = 0;
int monitored;
@@ -898,6 +911,13 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_FAILED;
}
+ if (arg_count(cmd, syncaction_ARG)) {
+ if (!lv_raid_message(lv, arg_str_value(cmd, syncaction_ARG, NULL))) {
+ stack;
+ return ECMD_FAILED;
+ }
+ }
+
/* activation change */
if (arg_count(cmd, activate_ARG)) {
if (!_lvchange_activate(cmd, lv)) {
@@ -956,6 +976,7 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, resync_ARG) ||
arg_count(cmd, alloc_ARG) ||
arg_count(cmd, discards_ARG) ||
+ arg_count(cmd, syncaction_ARG) ||
arg_count(cmd, zero_ARG);
int update = update_partial_safe || update_partial_unsafe;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cbcbb677313aa8a4…
Commit: cbcbb677313aa8a4116bcfd13ceccef05fb1f9a9
Parent: 95d28735ea3ad54be972707e40ee0211106ef1d1
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Wed Apr 10 16:47:04 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Wed Apr 10 16:47:04 2013 -0500
mirror: Fix overly-concerning warning on mirror up-convert failure.
Attempting to up-convert an inactive mirror when there is insufficient
space leads to the following message:
Unable to allocate extents for mirror(s).
ABORTING: Failed to remove temporary mirror layer inactive_mimagetmp_3.
Manual cleanup with vgcfgrestore and dmsetup may be required.
This is caused by a failure to execute the 'deactivate_lv' function in
the error condition. The deactivate returns an error because the LV is
already inactive. This patch checks if the LV is activate and calls
deactivate_lv only if it is. This allows the error cleanup code to work
properly in this condition.
It wasn't that big of a deal anyway, since there was no previous vg_commit
that needed to be reverted. IOW, no harm was done if the allocation failed.
The message was scary and useless.
---
tools/lvconvert.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 318ac9b..7b4bb6e 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1303,7 +1303,8 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
MIRROR_BY_LV)) {
layer_lv = seg_lv(first_seg(lv), 0);
if (!remove_layer_from_lv(lv, layer_lv) ||
- !deactivate_lv(cmd, layer_lv) ||
+ (lv_is_active(layer_lv) &&
+ !deactivate_lv(cmd, layer_lv)) ||
!lv_remove(layer_lv) || !vg_write(lv->vg) ||
!vg_commit(lv->vg)) {
log_error("ABORTING: Failed to remove "
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=95d28735ea3ad54b…
Commit: 95d28735ea3ad54be972707e40ee0211106ef1d1
Parent: 38f8f4a958980c236bf19f6e58afd55fdcdd3312
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Apr 8 15:17:12 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Mon Apr 8 15:17:12 2013 -0500
WHATS_NEW: Include entry for RAID status func improvements
---
WHATS_NEW | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 525c173..c41dd04 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Improve RAID kernel status retrieval to include sync_action/mismatch_cnt.
Add external origin support for lvcreate.
Improve lvcreate, lvconvert and lvm man pages.
Clean up format1 PV write to remove a need for an orphan VG for it to pass.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=38f8f4a958980c23…
Commit: 38f8f4a958980c236bf19f6e58afd55fdcdd3312
Parent: c22e925ce4fa765b208670e851eae5103fb141f4
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Mon Apr 8 15:04:08 2013 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Mon Apr 8 15:04:08 2013 -0500
RAID: Capture new RAID kernel sync_action status fields
I've updated the dm_status_raid structure and dm_get_status_raid()
function to make it handle the new kernel status fields that will
be coming in dm-raid v1.5.0. It is backwards compatible with the
old status line - initializing the new fields to '0'. The new
structure is also more amenable to future changes. It includes a
'reserved' field that is currently initialized to zero but could
be used to hold flags describing new features. It also now uses
pointers for the character strings instead of attempting to allocate
their space along with the structure (causing the size of the
structure to be variable). This allows future fields to be appended.
The new fields that are available are:
- sync_action : shows what the sync thread in the kernel is doing
(idle, frozen, resync, recover, check, repair, or
reshape)
- mismatch_count: shows the number of discrepancies which were
found or repaired by a "check" or "repair"
process, respectively.
---
lib/activate/activate.c | 6 +++-
lib/activate/dev_manager.c | 7 ++++-
libdm/libdevmapper.h | 14 +++++++++-
libdm/libdm-deptree.c | 55 ++++++++++++++++++++++++++++++++++++-------
4 files changed, 68 insertions(+), 14 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 26d357b..572383f 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -809,8 +809,10 @@ int lv_raid_dev_health(const struct logical_volume *lv, char **dev_health)
if (!(r = dev_manager_raid_status(dm, lv, &status)) ||
!(*dev_health = dm_pool_strdup(lv->vg->cmd->mem,
- status->dev_health)))
- stack;
+ status->dev_health))) {
+ dev_manager_destroy(dm);
+ return_0;
+ }
cached_dev_health = *dev_health;
dev_manager_destroy(dm);
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 906f53a..4a77320 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1031,7 +1031,6 @@ int dev_manager_raid_status(struct dev_manager *dm,
char *params = NULL;
const char *layer = lv_layer(lv);
- /* Build dlid for the thin pool layer */
if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, layer)))
return_0;
@@ -1051,6 +1050,12 @@ int dev_manager_raid_status(struct dev_manager *dm,
dm_get_next_target(dmt, NULL, &start, &length, &type, ¶ms);
+ if (!type || strcmp(type, "raid")) {
+ log_debug("Expected raid segment type but got %s instead",
+ type ? type : "NULL");
+ goto out;
+ }
+
if (!dm_get_status_raid(dm->mem, params, status))
goto_out;
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 184615f..2f2c77d 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -265,12 +265,22 @@ void *dm_get_next_target(struct dm_task *dmt,
*/
struct dm_pool;
+/*
+ * dm_get_status_raid will allocate the dm_status_raid structure and
+ * the necessary character arrays from the mempool provided to the
+ * function. If the mempool is from a dev_manager struct (dm->mem),
+ * then the caller does not need to free the memory - simply calling
+ * dev_manager_destroy will do.
+ */
struct dm_status_raid {
+ uint64_t reserved;
uint64_t total_regions;
uint64_t insync_regions;
+ uint64_t mismatch_count;
int dev_count;
- char raid_type[16];
- char dev_health[0];
+ char *raid_type;
+ char *dev_health;
+ char *sync_action;
};
int dm_get_status_raid(struct dm_pool *mem, const char *params,
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 8292791..750f494 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -2873,28 +2873,39 @@ int dm_tree_node_add_raid_target(struct dm_tree_node *node,
return 1;
}
+
+/*
+ * Various RAID status versions include:
+ * Versions < 1.5.0 (4 fields):
+ * <raid_type> <#devs> <health_str> <sync_ratio>
+ * Versions 1.5.0+ (6 fields):
+ * <raid_type> <#devs> <health_str> <sync_ratio> <sync_action> <mismatch_cnt>
+ */
int dm_get_status_raid(struct dm_pool *mem, const char *params,
struct dm_status_raid **status)
{
- int dev_count;
- const char *p;
+ int i;
+ const char *pp, *p;
struct dm_status_raid *s;
if (!params || !(p = strchr(params, ' '))) {
log_error("Failed to parse invalid raid params.");
return 0;
}
-
p++;
- if (sscanf(p, "%d", &dev_count) != 1)
+ /* second field holds the device count */
+ if (sscanf(p, "%d", &i) != 1)
return_0;
- s = dm_pool_zalloc(mem, sizeof(struct dm_status_raid) + dev_count + 1);
- if (!s) {
- log_error("Failed to allocate raid status structure.");
- return 0;
- }
+ if (!(s = dm_pool_zalloc(mem, sizeof(struct dm_status_raid))))
+ return_0;
+
+ if (!(s->raid_type = dm_pool_zalloc(mem, p - params)))
+ return_0; /* memory is freed went pool is destroyed */
+
+ if (!(s->dev_health = dm_pool_zalloc(mem, i + 1)))
+ return_0;
if (sscanf(params, "%s %d %s %" PRIu64 "/%" PRIu64,
s->raid_type,
@@ -2908,6 +2919,32 @@ int dm_get_status_raid(struct dm_pool *mem, const char *params,
*status = s;
+ /*
+ * All pre-1.5.0 version parameters are read. Now we check
+ * for additional 1.5.0+ parameters.
+ *
+ * Note that 'sync_action' will be NULL (and mismatch_count
+ * will be 0) if the kernel returns a pre-1.5.0 status.
+ */
+ for (p = params, i = 0; i < 4; i++, p++)
+ if (!(p = strchr(p, ' ')))
+ return 1; /* return pre-1.5.0 status */
+
+ pp = p;
+ if (!(p = strchr(p, ' '))) {
+ log_error(INTERNAL_ERROR "Bad RAID status received.");
+ return 0;
+ }
+ p++;
+
+ if (!(s->sync_action = dm_pool_zalloc(mem, p - pp)))
+ return_0;
+
+ if (sscanf(pp, "%s %" PRIu64, s->sync_action, &s->mismatch_count) != 2) {
+ log_error("Failed to parse raid params: %s", params);
+ return 0;
+ }
+
return 1;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c22e925ce4fa765b…
Commit: c22e925ce4fa765b208670e851eae5103fb141f4
Parent: ddafa0115e6881f30ada55f40cb07dd41a6afd2f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 5 12:56:19 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 5 14:15:03 2013 +0200
man: lvceate document external origin snapshot
Document added support for external origin.
---
WHATS_NEW | 1 +
man/lvcreate.8.in | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 539d8fb..525c173 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Add external origin support for lvcreate.
Improve lvcreate, lvconvert and lvm man pages.
Clean up format1 PV write to remove a need for an orphan VG for it to pass.
Fix vgextend to not allow a PV with 0 MDAs to be used while already in a VG.
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index d208cad..47c0a72 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -59,7 +59,10 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-\-poolmetadatasize
.IR ThinPoolMetadataSize [ bBsSkKmMgG ]]]
.RB [ \-\-thinpool
-.IR ThinPoolLogicalVolume { Name | Path }]
+.IR ThinPoolLogicalVolume { Name | Path }
+.RB [ \-s | \-\-snapshot
+.RI [ VolumeGroup { Name | Path }/]
+.IR ExternalOriginLogicalVolumeName ]]
.RB [ \-\-type
.IR SegmentType ]
.RB [ \-v | \-\-verbose ]
@@ -291,6 +294,15 @@ used to track the locations of the chunks of data, so you should
allocate slightly more space than you actually need and monitor
(\fB\-\-monitor\fP) the rate at which the snapshot data is growing
so you can \fBavoid\fP running out of space.
+If \fB\-\-thinpool\fP is specified, thin volume is created that will
+use given original logical volume as an external origin that
+serves unprovisioned blocks.
+Only read-only volumes can be used as external origins.
+To make the volume external origin, lvm expects the volume to be inactive.
+External origin volume can be used/shared for many thin volumes
+even from different thin pools. See
+.BR lvconvert (8)
+for online conversion to thin volumes with external origin.
.TP
.IR \fB\-T ", " \fB\-\-thin ", " \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
Creates thin pool or thin logical volume or both.
@@ -407,9 +419,15 @@ build with 2 stripes 64KiB and chunk size 256KiB together with
.sp
.B lvcreate \-i 2 \-I 64 \-c 256 \-L100M \-T vg00/pool \-V 1T \-\-name thin_lv
+Creates thin volume snapshot of read only inactive volume "vg00/origin"
+that will use an existing thin pool "vg00/pool":
+.sp
+.B lvcreate -s --thinpool "vg00/pool" origin
+
.SH SEE ALSO
.BR lvm (8),
.BR lvm.conf (5),
+.BR lvconvert (8),
.BR lvchange (8),
.BR lvextend (8),
.BR lvreduce (8),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ddafa0115e6881f3…
Commit: ddafa0115e6881f30ada55f40cb07dd41a6afd2f
Parent: 3fd0242a0af7b473f545ab89defcd0f56bcb9753
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 5 12:24:32 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 5 14:14:20 2013 +0200
man: updates for lvconvert and lvcreate
Cleanup and improvement on man pages.
---
WHATS_NEW | 1 +
man/lvconvert.8.in | 86 ++++++++++++++----------
man/lvcreate.8.in | 185 ++++++++++++++++++++++++++++++----------------------
man/lvm.8.in | 26 ++++----
4 files changed, 169 insertions(+), 129 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 61a2558..539d8fb 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Improve lvcreate, lvconvert and lvm man pages.
Clean up format1 PV write to remove a need for an orphan VG for it to pass.
Fix vgextend to not allow a PV with 0 MDAs to be used while already in a VG.
Move update_pool_params() from /tools to /lib for better reuse.
diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index c5929c2..d22994e 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -96,14 +96,14 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot
.IR StripeSize ]]]
.RB [ \-Z | \-\-zero
.RI { y | n }]
-.RB [ \-h | \-? | \-\-help ]
-.RB [ \-v | \-\-verbose ]
-.RB [ \-\-version ]
.RB [ \-T | \-\-thin
.IR ExternalOriginLogicalVolume { Name | Path }
.RB [ \-\-originname
.IR NewExternalOriginVolumeName ]]
.RI [ PhysicalVolume [ Path ][ :PE [ -PE ]]...]
+.RB [ \-h | \-? | \-\-help ]
+.RB [ \-v | \-\-verbose ]
+.RB [ \-\-version ]
.sp
.SH DESCRIPTION
@@ -123,11 +123,20 @@ the freed extents come first from the specified PhysicalVolumes.
.SH OPTIONS
See \fBlvm\fP(8) for common options.
.br
-Exactly one of
-.BR \-\-merge ", " \-\-mirrors ", " \-\-repair ", " \-\-replace
-.RB ", " \-\-snapshot ", " \-\-splitmirrors " or " \-\-thinpool
+Exactly one of
+.BR \-\-merge ,
+.BR \-\-mirrors ,
+.BR \-\-repair ,
+.BR \-\-replace ,
+.BR \-\-snapshot ,
+.BR \-\-splitmirrors
+or
+.BR \-\-thinpool
arguments is required.
.TP
+.BR \-b ", " \-\-background
+Run the daemon in the background.
+.TP
.BR \-m ", " \-\-mirrors " " \fIMirrors
Specifies the degree of the mirror you wish to create.
For example, "\fB-m 1\fP" would convert the original logical
@@ -136,17 +145,17 @@ linear volume plus one copy.
.TP
.IR \fB\-\-mirrorlog " {" disk | core | mirrored }
Specifies the type of log to use.
-The default is disk, which is persistent and requires
+The default is \fIdisk\fP, which is persistent and requires
a small amount of storage space, usually on a separate device
-from the data being mirrored.
-Core may be useful for short-lived mirrors: It means the mirror is
+from the data being mirrored.
+\fICore\fP may be useful for short-lived mirrors: It means the mirror is
regenerated by copying the data from the first device again every
time the device is activated - perhaps, for example, after every reboot.
-Using "mirrored" will create a persistent log that is itself mirrored.
+Using \fImirrored\fP will create a persistent log that is itself mirrored.
.TP
.B \-\-corelog
-The optional argument \fB--corelog\fP is the same as specifying
-\fB--mirrorlog core\fP.
+The optional argument \fB\-\-corelog\fP is the same as specifying
+\fB\-\-mirrorlog\fP \fIcore\fP.
.TP
.BR \-R ", " \-\-regionsize " " \fIMirrorLogRegionSize
A mirror is divided into regions of this size (in MB), and the mirror log
@@ -157,14 +166,11 @@ Used to convert a logical volume to another segment type or to explicitly state
the desired RAID1 segment type (\fImirror\fP or \fIraid1\fP) when converting
a linear logical volume to a mirror with the \fB-m\fP argument.
.TP
-.BR \-b ", " \-\-background
-Run the daemon in the background.
-.TP
.BR \-i ", " \-\-interval " " \fISeconds
Report progress as a percentage at regular intervals.
.TP
.B \-\-noudevsync
-Disable udev synchronisation. The
+Disables udev synchronisation. The
process will not wait for notification from udev.
It will continue irrespective of any possible udev processing
in the background. You should only use this if udev is not running
@@ -176,7 +182,7 @@ to form a new logical volume. A name must be supplied for the
newly-split-off logical volume using the \fB\-\-name\fP argument, unless
the \fB\-\-trackchanges\fP argument is given.
.TP
-.B \-n \fIName
+.BR \-n ", " \-\-name\ \fIName
The name to apply to a logical volume which has been split off from
a mirror logical volume.
.TP
@@ -190,21 +196,23 @@ Please note that this feature is only supported with the new md-based mirror
implementation and not with the original device-mapper mirror implementation.
.TP
.B \-s, \-\-snapshot
-Create a snapshot from existing logical volume using another
+Creates a snapshot from existing logical volume using another
existing logical volume as its origin.
.TP
.BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
Gives the size of chunk for snapshot and thin pool logical volumes.
+Default unit is in kilobytes.
+.br
For snapshots the value must be power of 2 between 4KiB and 512KiB
and the default value is 4.
+.br
For thin pools the value must be between 64KiB and
1GiB and the default value starts with 64 and scales
-up to fit the pool metadata size within 128MB,
+up to fit the pool metadata size within 128MiB,
if the pool metadata size is not specified.
-Older dm thin pool target version (<1.4) requires the value to be power of 2.
-The newer version requires to be the multiple of 64KiB, however discard is
-not supported for non power of 2 values.
-Default unit is in kilobytes.
+Thin pool target version <1.4 requires the value to be a power of 2.
+The newer target version relaxes limitation to be a multiple of 64KiB.
+For target version <1.5 discard is not supported for non power of 2 values.
.TP
.BR \-\-discards " {" \fIignore | \fInopassdown | \fIpassdown }
Sets discards behavior for thin pool.
@@ -235,11 +243,12 @@ be specified on the commandline or a @tag may be used to specify
multiple snapshots be merged to their respective origin.
.TP
.B \-\-originname \fINewExternalOriginVolumeName\fP
-The name for converted external origin volume.
+The new name for original logical volume, which becomes external origin volume.
.br
Without this option a default names of "lvol#" will be generated where
# is the LVM internal number of the logical volume.
-Converted volume will be read-only.
+This volume will be read-only and cannot be further modified as long,
+as it is being used as external origin.
.TP
.BR \-\-poolmetadata " " \fIThinPoolMetadataLogicalVolume { \fIName | \fIPath }
Specifies thin pool metadata logical volume.
@@ -300,11 +309,13 @@ For metadata in LVM2 format, the stripe size may be a larger
power of 2 but must not exceed the physical extent size.
.TP
.IR \fB\-T ", " \fB\-\-thin " " ExternalOriginLogicalVolume { Name | Path }
-Changes the logical volume into a thin volume for the thin pool
-specified with the option \fB\-\-thinpool\fP. \fIExternalOriginLogicalVolume\fP
-is converted into a new read-only logical volume which will be used as an
-external origin volume for unprovisioned areas.
-The non-default name for this new volume can be specified with \fB\-\-originname\fP.
+Converts the logical volume into a thin logical volume of the thin pool
+specified with \fB\-\-thinpool\fP. The original logical volume
+.I ExternalOriginLogicalVolume
+is renamed into a new read-only logical volume.
+The non-default name for this volume use \fB\-\-originname\fP.
+The volume cannot be further modified as long as it is used as an
+external origin volume for unprovisioned areas of any thin logical volume.
.TP
.IR \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
Changes logical volume into a thin pool volume. The volume
@@ -361,7 +372,7 @@ Merges "vg00/lvol1_snap" into its origin:
.B lvconvert \-\-merge vg00/lvol1_snap
If "vg00/lvol1", "vg00/lvol2" and "vg00/lvol3" are all tagged with "some_tag"
-each snapshot logical volume will be merged serially,
+each snapshot logical volume will be merged serially,
e.g.: "vg00/lvol1", then "vg00/lvol2", then "vg00/lvol3".
If \-\-background were used it would start
all snapshot logical volume merges in parallel.
@@ -413,12 +424,13 @@ For the read-only external origin use the new name "vg00/external".
.SH SEE ALSO
.BR lvm (8),
-.BR vgcreate (8),
-.BR lvremove (8),
-.BR lvrename (8),
+.BR lvm.conf (5),
+.BR lvdisplay (8),
.BR lvextend (8),
.BR lvreduce (8),
-.BR lvdisplay (8),
+.BR lvremove (8),
+.BR lvrename (8),
.BR lvscan (8),
-.BR thin_dump(8),
-.BR thin_restore(8)
+.BR vgcreate (8),
+.BR thin_dump (8),
+.BR thin_restore (8)
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index da4c1fe..d208cad 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -79,7 +79,8 @@ lvcreate \- create a logical volume in an existing volume group
.IR ChunkSize [ bBsSkK ]]
.RB [ \-\-noudevsync ]
.RB [ \-\-ignoremonitoring ]
-.RB [ \-\-monitor " {" \fIy | \fIn }]
+.RB [ \-\-monitor
+.RI { y | n }]
.RB [ \-n | \-\-name
.IR SnapshotLogicalVolume { Name | Path }]
.BR \-s | \-\-snapshot
@@ -116,27 +117,31 @@ By default, new Logical Volumes are activated (\fB-a\fIy\fR).
If it is possible technically, \fB-a\fIn\fR will leave the new Logical
Volume inactive. But for example, snapshots can only be created
in the active state so \fB\-a\fIn\fR cannot be used with \fB\-\-snapshot\fP.
-Normally the \fB\-\-zero n\fP argument has to be supplied too because
+Normally the \fB\-\-zero\fP \fIn\fP argument has to be supplied too because
zeroing (the default behaviour) also requires activation.
If autoactivation option is used (\fB\-a\fIay\fR), the logical volume is
-activated only if it matches an item in the activation/auto_activation_volume_list
-set in lvm.conf. For autoactivated logical volumes, \fB\-\-zero n\fP is
-always assumed and it can't be overridden. If clustered locking is enabled,
+activated only if it matches an item in the
+.B activation/auto_activation_volume_list
+set in \fBlvm.conf\fP(5).
+For autoactivated logical volumes, \fB\-\-zero\fP \fIn\fP is always assumed
+and it can't be overridden. If the clustered locking is enabled,
\fB\-a\fIey\fR will activate exclusively on one node and \fB\-a\fIly\fR will
activate only on the local node.
.TP
.BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
Gives the size of chunk for snapshot and thin pool logical volumes.
+Default unit is in kilobytes.
+.br
For snapshots the value must be power of 2 between 4KiB and 512KiB
and the default value is 4.
+.br
For thin pools the value must be between 64KiB and
1GiB and the default value starts with 64 and scales
-up to fit the pool metadata size within 128MB,
+up to fit the pool metadata size within 128MiB,
if the pool metadata size is not specified.
-Older dm thin pool target version (<1.4) requires the value to be power of 2.
-The newer version requires to be the multiple of 64KiB, however discard is
-not supported for non power of 2 values.
-Default unit is in kilobytes.
+Thin pool target version <1.4 requires the value to be a power of 2.
+The newer target version relaxes limitation to be a multiple of 64KiB.
+For target version <1.5 discard is not supported for non power of 2 values.
.TP
.BR \-C ", " \-\-contiguous " {" \fIy | \fIn }
Sets or resets the contiguous allocation policy for
@@ -144,7 +149,7 @@ logical volumes. Default is no contiguous allocation based
on a next free principle.
.TP
.BR \-\-discards " {" \fIignore | \fInopassdown | \fIpassdown }
-Set discards behavior for thin pool.
+Sets discards behavior for thin pool.
Default is \fIpassdown\fP.
.TP
.BR \-i ", " \-\-stripes " " \fIStripes
@@ -152,9 +157,10 @@ Gives the number of stripes.
This is equal to the number of physical volumes to scatter
the logical volume. When creating a RAID 4/5/6 logical volume,
the extra devices which are necessary for parity are
-internally accounted for. Specifying '\-i 3' would use 3 devices
-for striped logical volumes, 4 devices for RAID 4/5, and 5 devices
-for RAID 6.
+internally accounted for. Specifying
+.BI \-i 3
+would use 3 devices for striped logical volumes,
+4 devices for RAID 4/5, and 5 devices for RAID 6.
.TP
.BR \-I ", " \-\-stripesize " " \fIStripeSize
Gives the number of kilobytes for the granularity of the stripes.
@@ -163,6 +169,10 @@ StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
For metadata in LVM2 format, the stripe size may be a larger
power of 2 but must not exceed the physical extent size.
.TP
+.B \-\-ignoremonitoring
+Make no attempt to interact with dmeventd unless \fB\-\-monitor\fP
+is specified.
+.TP
.IR \fB\-l ", " \fB\-\-extents " " LogicalExtentsNumber [ % { VG | PVS | FREE | ORIGIN }]
Gives the number of logical extents to allocate for the new
logical volume.
@@ -182,84 +192,84 @@ or \fIE\fR for exabytes is optional.
.br
Default unit is megabytes.
.TP
-.B \-\-minor \fIminor
-Set the minor number.
-.TP
-.IR \fB\-M ", " \fB\-\-persistent " {" y | n }
-Set to y to make the minor number specified persistent.
-.TP
.BR \-m ", " \-\-mirrors " " \fIMirrors
-Creates a mirrored logical volume with Mirrors copies. For example,
-specifying "-m 1" would result in a mirror with two-sides; that is, a
-linear volume plus one copy.
+Creates a mirrored logical volume with \fIMirrors\fP copies.
+For example, specifying
+.BI -m 1
+would result in a mirror with two-sides; that is,
+a linear volume plus one copy.
-Specifying the optional argument --nosync will cause the creation
+Specifying the optional argument \fB\-\-nosync\fP will cause the creation
of the mirror to skip the initial resynchronization. Any data written
afterwards will be mirrored, but the original contents will not be
copied. This is useful for skipping a potentially long and resource
intensive initial sync of an empty device.
-The optional argument --mirrorlog specifies the type of log to be used.
-The default is disk, which is persistent and requires
+The optional argument \fB\-\-mirrorlog\fP specifies the type of log to be used.
+The default is \fIdisk\fP, which is persistent and requires
a small amount of storage space, usually on a separate device from the
-data being mirrored. Using core means the mirror is regenerated
+data being mirrored. Using \fIcore\fP means the mirror is regenerated
by copying the data from the first device again each time the
-device is activated, for example, after every reboot. Using "mirrored"
+device is activated, for example, after every reboot. Using \fImirrored\fP
will create a persistent log that is itself mirrored.
-The optional argument --corelog is equivalent to --mirrorlog core.
-
+The optional argument \fB\-\-corelog\fP is equivalent
+to \fB\-\-mirrorlog\fP \fIcore\fP.
+.TP
+.IR \fB\-M ", " \fB\-\-persistent " {" y | n }
+Set to \fIy\fP to make the minor number specified persistent.
+.TP
+.B \-\-minor \fIminor
+Sets the minor number.
+.TP
+.BR \-\-monitor " {" \fIy | \fIn }
+Starts or avoids monitoring a mirrored, snapshot or thin pool logical volume with
+dmeventd, if it is installed.
+If a device used by a monitored mirror reports an I/O error,
+the failure is handled according to
+.B activation/mirror_image_fault_policy
+and
+.B activation/mirror_log_fault_policy
+set in \fBlvm.conf\fP(5).
.TP
.IR \fB\-n ", " \fB\-\-name " " LogicalVolume { Name | Path }
-The name for the new logical volume.
+Sets the name for the new logical volume.
.br
-Without this option a default names of "lvol#" will be generated where
+Without this option a default name of "lvol#" will be generated where
# is the LVM internal number of the logical volume.
.TP
.B \-\-noudevsync
-Disable udev synchronisation. The
+Disables udev synchronisation. The
process will not wait for notification from udev.
It will continue irrespective of any possible udev processing
in the background. You should only use this if udev is not running
or has rules that ignore the devices LVM2 creates.
.TP
-.BR \-\-monitor " {" \fIy | \fIn }
-Start or avoid monitoring a mirrored or snapshot logical volume with
-dmeventd, if it is installed.
-If a device used by a monitored mirror reports an I/O error,
-the failure is handled according to
-\fBmirror_image_fault_policy\fP and \fBmirror_log_fault_policy\fP
-set in \fBlvm.conf\fP.
-.TP
-.B \-\-ignoremonitoring
-Make no attempt to interact with dmeventd unless \-\-monitor
-is specified.
-.TP
.BR \-p ", " \-\-permission " {" \fIr | \fIrw }
-Set access permissions to read only or read and write.
+Sets access permissions to read only (\fIr\fP) or read and write (\fIrw\fP).
.br
Default is read and write.
.TP
.IR \fB\-\-poolmetadatasize " " ThinPoolMetadataSize [ bBsSkKmMgG ]
-Set the size of thin pool's metadata logical volume.
-Supported value is in range between 2MiB and 16GiB.
+Sets the size of thin pool's metadata logical volume.
+Supported values are in range between 2MiB and 16GiB.
Default value is (Pool_LV_size / Pool_LV_chunk_size * 64b).
Default unit is megabytes.
.TP
.IR \fB\-r ", " \fB\-\-readahead " {" ReadAheadSectors | auto | none }
-Set read ahead sector count of this logical volume.
+Sets read ahead sector count of this logical volume.
For volume groups with metadata in lvm1 format, this must
be a value between 2 and 120.
-The default value is "auto" which allows the kernel to choose
+The default value is \fIauto\fP which allows the kernel to choose
a suitable value automatically.
-"None" is equivalent to specifying zero.
+\fINone\fP is equivalent to specifying zero.
.TP
.BR \-R ", " \-\-regionsize " " \fIMirrorLogRegionSize
-A mirror is divided into regions of this size (in MB), and the mirror log
+A mirror is divided into regions of this size (in MiB), and the mirror log
uses this granularity to track which regions are in sync.
.TP
.IR \fB\-s ", " \fB\-\-snapshot " " OriginalLogicalVolume { Name | Path }
-Create a snapshot logical volume (or snapshot) for an existing, so called
+Creates a snapshot logical volume (or snapshot) for an existing, so called
original logical volume (or origin).
Snapshots provide a 'frozen image' of the contents of the origin
while the origin can still be updated. They enable consistent
@@ -274,13 +284,13 @@ In case the snapshot runs out of storage, use
to grow it. Shrinking a snapshot is supported by
.BR lvreduce (8)
as well. Run
-.BR lvdisplay (8)
+.BR lvs (8)
on the snapshot in order to check how much data is allocated to it.
-Note that a small amount of the space you allocate to the snapshot is
+Note: a small amount of the space you allocate to the snapshot is
used to track the locations of the chunks of data, so you should
-allocate slightly more space than you actually need and monitor the
-rate at which the snapshot data is growing so you can avoid running out
-of space.
+allocate slightly more space than you actually need and monitor
+(\fB\-\-monitor\fP) the rate at which the snapshot data is growing
+so you can \fBavoid\fP running out of space.
.TP
.IR \fB\-T ", " \fB\-\-thin ", " \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
Creates thin pool or thin logical volume or both.
@@ -295,30 +305,44 @@ from kernel 3.2 or newer.
.TP
.B \-\-type \fISegmentType
Create a logical volume that uses the specified segment type
-(e.g. "raid5", "mirror", "snapshot", "thin", "thin-pool").
+(e.g.
+.IR mirror ( \fB\-m ),
+.IR raid5 ,
+.IR snapshot ( \fB\-s ),
+.IR thin ( \fB\-T ),
+.IR thin-pool ,\ ...).
Many segment types have a
commandline switch alias that will enable their use
-(\fB\-s\fP is an alias for \fB\-\-type snapshot\fP).
+(\fB\-s\fP is an alias for
+.B \-\-type \fIsnapshot\fP).
However, this argument must be used when no existing
commandline switch alias is available for the desired type,
as is the case with
-.IR error ", " zero ", " raid1 ", " raid10 ", " raid4 ", " raid5 " or " raid6 .
+.IR error ,
+.IR raid1 ,
+.IR raid4 ,
+.IR raid5 ,
+.IR raid6 ,
+.IR raid10
+or
+.IR zero .
.TP
.BR \-V ", " \-\-virtualsize " " \fIVirtualSize [ \fIbBsSkKmMgGtTpPeE ]
-Create a sparse device of the given size (in MB by default) using a snapshot
+Creates a sparse device of the given size (in MiB by default) using a snapshot
or thinly provisioned device when thin pool is specified.
Anything written to the device will be returned when reading from it.
Reading from other areas of the device will return blocks of zeros.
Virtual snapshot is implemented by creating a hidden virtual device of the
requested size using the zero target. A suffix of _vorigin is used for
-this device.
+this device. Note: using sparse snapshots is not efficient for larger
+device sizes (GiB), thin provisioning should be used for this case.
.TP
.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
-Controls zeroing of the first KB of data in the new logical volume.
+Controls zeroing of the first KiB of data in the new logical volume.
.br
-Default is yes.
+Default is \fIy\fPes.
.br
-Volume will not be zeroed if read only flag is set.
+Volume will not be zeroed if the read only flag is set.
.br
Snapshot volumes are zeroed always.
@@ -326,15 +350,16 @@ Snapshot volumes are zeroed always.
Warning: trying to mount an unzeroed logical volume can cause the system to
hang.
.SH Examples
-Creates a striped logical volume with 3 stripes, a stripesize of 8KB
-and a size of 100MB in the volume group named vg00.
+Creates a striped logical volume with 3 stripes, a stripe size of 8KiB
+and a size of 100MiB in the volume group named vg00.
The logical volume name will be chosen by lvcreate:
.sp
.B lvcreate \-i 3 \-I 8 \-L 100M vg00
Creates a mirror logical volume with 2 sides with a useable size of 500 MiB.
-This operation would require 3 devices (or option --alloc anywhere) - two
-for the mirror devices and one for the disk log:
+This operation would require 3 devices (or option
+.BI \-\-alloc \ anywhere
+) - two for the mirror devices and one for the disk log:
.sp
.B lvcreate \-m1 \-L 500M vg00
@@ -368,10 +393,11 @@ a parity drive for a total of 4 devices) and a stripesize of 64KiB:
.B lvcreate \-\-type raid5 \-L 5G \-i 3 \-I 64 \-n my_lv vg00
Creates a 5GiB RAID10 logical volume "vg00/my_lv", with 2 stripes on
-2 2-way mirrors. Note that the '-i' and '-m' arguments behave differently.
-The '-i' specifies the number of stripes. The '-m' specifies the number of
-.B additional
-copies.
+2 2-way mirrors. Note that the \fB-i\fP and \fB-m\fP arguments behave differently.
+The \fB-i\fP specifies the number of stripes.
+The \fB-m\fP specifies the number of
+.B additional
+copies:
.sp
.B lvcreate \-\-type raid10 \-L 5G \-i 2 \-m 1 \-n my_lv vg00
@@ -383,11 +409,12 @@ build with 2 stripes 64KiB and chunk size 256KiB together with
.SH SEE ALSO
.BR lvm (8),
-.BR vgcreate (8),
+.BR lvm.conf (5),
.BR lvchange (8),
-.BR lvremove (8),
-.BR lvrename (8)
.BR lvextend (8),
.BR lvreduce (8),
-.BR lvdisplay (8),
-.BR lvscan (8)
+.BR lvremove (8),
+.BR lvrename (8)
+.BR lvs (8),
+.BR lvscan (8),
+.BR vgcreate (8)
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 2ce0065..d15e86b 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -21,6 +21,8 @@ that command.
On invocation, \fBlvm\fP requires that only the standard file descriptors
stdin, stdout and stderr are available. If others are found, they
get closed and messages are issued warning about the leak.
+This warning can be suppressed by setting enviromental variable
+.B LVM_SUPPRESS_FD_WARNINGS\fP.
.LP
Where commands take VG or LV names as arguments, the full path name is
optional. An LV called "lvol0" in a VG called "vg0" can be specified
@@ -150,7 +152,7 @@ The following options are available for many of the commands.
They are implemented generically and documented here rather
than repeated on individual manual pages.
.TP
-.BR \-h ", " \-\-help
+.BR \-h ", " \-? ", " \-\-help
Display the help text.
.TP
.B \-\-version
@@ -235,15 +237,9 @@ and as of version 2.02.78 the following characters are also accepted:
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.
.TP
-.B \-\-alloc \fIAllocationPolicy
-The allocation policy to use:
-.IR contiguous ,
-.IR cling ,
-.IR normal ,
-.IR anywhere " or"
-.IR inherit .
-When a command needs to allocate Physical Extents from the Volume Group,
-the allocation policy controls how they are chosen.
+.IR \fB\-\-alloc \ { anywhere | contiguous | cling | inherit | normal }
+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 \fInormal\fP which applies
common-sense rules such as not placing parallel stripes on the same
@@ -269,6 +265,10 @@ shell is invoked.
Directory containing \fBlvm.conf\fP(5) and other LVM system files.
Defaults to "#DEFAULT_SYS_DIR#".
.TP
+.B LVM_SUPPRESS_FD_WARNINGS
+Suppress warnings about openned file descriptors, when lvm command
+is executed.
+.TP
.B LVM_VG_NAME
The Volume Group name that is assumed for
any reference to a Logical Volume that doesn't specify a path.
@@ -351,7 +351,7 @@ restrictions described above applied to each step leave the tools no
discretion over the layout.
To view the way the allocation process currently works in any specific
-case, read the debug logging output, for example by adding \-vvvv to
+case, read the debug logging output, for example by adding \fB\-vvvv\fP to
a command.
.SH DIAGNOSTICS
All tools return a status code of zero on success or non-zero on failure.
@@ -360,6 +360,7 @@ All tools return a status code of zero on success or non-zero on failure.
.br
.I $HOME/.lvm_history
.SH SEE ALSO
+.BR lvm.conf (5),
.BR clvmd (8),
.BR lvchange (8),
.BR lvcreate (8),
@@ -398,5 +399,4 @@ All tools return a status code of zero on success or non-zero on failure.
.BR vgs (8),
.BR vgscan (8),
.BR vgsplit (8),
-.BR readline (3),
-.BR lvm.conf (5)
+.BR readline (3)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=72921d79225bb822…
Commit: 72921d79225bb822f156212177253ac2a0cb8082
Parent: 95372a852bbcacc9f194324832b94fcf1493f7c5
Author: Petr Rockai <prockai(a)redhat.com>
AuthorDate: Wed Apr 3 22:08:46 2013 +0200
Committer: Petr Rockai <prockai(a)redhat.com>
CommitterDate: Wed Apr 3 22:08:46 2013 +0200
test: Invalidate .cache after vgimportclone.
---
test/shell/vgimportclone.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/shell/vgimportclone.sh b/test/shell/vgimportclone.sh
index 9b1c121..0a476ec 100644
--- a/test/shell/vgimportclone.sh
+++ b/test/shell/vgimportclone.sh
@@ -31,6 +31,7 @@ vgimportclone --basevgname $vg2 "$dev2"
# concerned, can only live on a single device. With the last pvscan, we told it
# that PV from $dev1 now lives on $dev2, but in fact this is not true anymore,
# since we wrote a different PV over $dev2.
+rm $TESTDIR/etc/.cache
aux notify_lvmetad "$dev2"
aux notify_lvmetad "$dev1"