summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2013-08-26 16:36:30 -0500
committerJonathan Brassow <jbrassow@redhat.com>2013-08-26 16:36:30 -0500
commit2ef48b91ed74f732b6150a9492da624d204b331d (patch)
tree20f90ce37659177d5a3e608e2095ee7eb7cea2d1
parentcaa77b33f2d5e59f2906b9f08f59ac2e64b14682 (diff)
downloadlvm2-2ef48b91ed74f732b6150a9492da624d204b331d.tar.gz
pvmove: Allow moving snapshot/origin. Disallow converting and merging LVs
The patch allows the user to also pvmove snapshots and origin logical volumes. This means pvmove should be able to move all segment types. I have, however, disallowed moving converting or merging logical volumes.
-rw-r--r--WHATS_NEW2
-rw-r--r--man/pvmove.8.in5
-rw-r--r--tools/pvmove.c12
3 files changed, 9 insertions, 10 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 069c3c23a..29af78da1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.101 -
===================================
+ Disable pvmove of merging or converting logical volumes.
+ Enable pvmove of snapshots and snapshot origins.
Fix inability to specify LV name when pvmove'ing a RAID, mirror, or thin-LV.
Inform lvmetad about any lost PV label to make it in sync with system state.
Support most of lvchange operations on stacked thin pool meta/data LVs.
diff --git a/man/pvmove.8.in b/man/pvmove.8.in
index ba6ea1e87..79ccf1cbe 100644
--- a/man/pvmove.8.in
+++ b/man/pvmove.8.in
@@ -75,9 +75,6 @@ is updated so that the Logical Volumes 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).
-N.B. The moving of non-thinly provisioned snapshots and their
-origins is not supported.
-
.SH OPTIONS
See \fBlvm\fP(8) for common options.
.TP
@@ -110,8 +107,6 @@ To move all Physical Extents that are used by simple Logical Volumes on
.sp
.B pvmove /dev/sdb1
.P
-Any non-thinly provisioned snapshots and their origins are left unchanged.
-.P
Additionally, a specific destination device /dev/sdc1
can be specified like this:
.sp
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 286829030..10073702e 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -295,6 +295,13 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
if (!lv_is_on_pvs(lv, source_pvl))
continue;
+ if (lv->status & (CONVERTING | MERGING)) {
+ log_error("Unable to pvmove when %s volumes are present",
+ (lv->status & CONVERTING) ?
+ "converting" : "merging");
+ return NULL;
+ }
+
if (seg_is_raid(first_seg(lv)) ||
seg_is_mirrored(first_seg(lv))) {
dm_list_init(&trim_list);
@@ -327,11 +334,6 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
if (!lv_is_on_pvs(lv, source_pvl))
continue;
- if (lv_is_origin(lv) || lv_is_cow(lv)) {
- lv_skipped = 1;
- log_print_unless_silent("Skipping snapshot-related LV %s", lv->name);
- continue;
- }
seg = first_seg(lv);
if (seg_is_raid(seg) || seg_is_mirrored(seg) ||
lv_is_thin_volume(lv) || lv_is_thin_pool(lv)) {