Skip to contentSkip to conversation

master - lvconvert: Implement --splitsnapshot.

PATCH Alasdair Kergon 1 participant 1 message Dec 4, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7b65363bf781cd58d45e2d9f12fdfed59b9dee55
Commit:        7b65363bf781cd58d45e2d9f12fdfed59b9dee55
Parent:        ff769ecfe7cdd704ee1e11aa9b6b7a92f932a0c1
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Wed Dec 4 02:09:37 2013 +0000
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Wed Dec 4 02:09:37 2013 +0000

lvconvert: Implement --splitsnapshot.

---
 WHATS_NEW          |    1 +
 man/lvconvert.8.in |   21 +++++++-
 tools/args.h       |    1 +
 tools/commands.h   |   15 ++++-
 tools/lvconvert.c  |  142 ++++++++++++++++++++++++++++++++++++++++++++-------
 5 files changed, 155 insertions(+), 25 deletions(-)
WHATS_NEW +1 -0
index c96acce..553edfd 100644
@@ -1,5 +1,6 @@
 Version 2.02.105 -
 =====================================
+  Add --splitsnapshot to lvconvert to separate out cow LV.
   Reinstate origin reload to complete lvconvert -s with active LVs. (2.02.98)
   Select only active volume groups if vgdisplay -A is used.
   Add -p and LVM_LVMETAD_PID env var to lvmetad to change pid file.
man/lvconvert.8.in +19 -2
index 0fe5ab3..30e9809 100644
@@ -38,6 +38,14 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot
 .RI [ SplittablePhysicalVolume [ Path ][ :PE [ -PE ]]...]
 .sp
 .B lvconvert
+.BR \-\-splitsnapshot
+.RB [ \-h | \-? | \-\-help ]
+.RB [ \-\-noudevsync ]
+.RB [ \-v | \-\-verbose ]
+.RB [ \-\-version ]
+.IR SnapshotLogicalVolume [ Path ]
+.sp
+.B lvconvert
 .BR \-s | \-\-snapshot
 .RB [ \-c | \-\-chunksize
 .IR ChunkSize [ bBsSkK ]]
@@ -128,6 +136,7 @@ Exactly one of
 .BR \-\-mirrors ,
 .BR \-\-repair ,
 .BR \-\-replace ,
+.BR \-\-splitsnapshot ,
 .BR \-\-snapshot ,
 .BR \-\-splitmirrors
 or
@@ -200,9 +209,17 @@ the data changed get resynchronized.
 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 \-\-splitsnapshot
+Separates SnapshotLogicalVolume from its origin.
+The volume that is split off contains the chunks that differ from the origin
+along with the metadata describing them.  This volume can be wiped and then
+destroyed with lvremove.
+The inverse of \-\-snapshot.
+.TP
 .B \-s, \-\-snapshot
-Creates a snapshot from existing logical volume using another
-existing logical volume as its origin.
+Recreates a snapshot from constituent logical volumes (or copies of them) after
+having been separated using \-\-splitsnapshot.  For this to work correctly, no
+changes may be made to the contents of either volume after the split.
 .TP
 .BR \-c ", " \-\-chunksize " " \fIChunkSize [ \fIbBsSkKmMgG ]
 Gives the size of chunk for snapshot and thin pool logical volumes.
tools/args.h +1 -0
index 8ca73a3..1207189 100644
@@ -101,6 +101,7 @@ arg(profile_ARG, '\0', "profile", string_arg, 0)
 arg(detachprofile_ARG, '\0', "detachprofile", NULL, 0)
 arg(mergedconfig_ARG, '\0', "mergedconfig", NULL, 0)
 arg(ignoreskippedcluster_ARG, '\0', "ignoreskippedcluster", NULL, 0)
+arg(splitsnapshot_ARG, '\0', "splitsnapshot", NULL, 0)
 
 /* Allow some variations */
 arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0)
tools/commands.h +12 -3
index c54e812..938898b 100644
@@ -172,6 +172,15 @@ xx(lvconvert,
    "\tLogicalVolume[Path] [SplittablePhysicalVolume[Path]...]\n\n"
 
    "lvconvert "
+   "--splitsnapshot\n"
+   "\t[-d|--debug]\n"
+   "\t[-h|-?|--help]\n"
+   "\t[--noudevsync]\n"
+   "\t[-v|--verbose]\n"
+   "\t[--version]" "\n"
+   "\tSnapshotLogicalVolume[Path]\n\n"
+   
+   "lvconvert "
    "[-s|--snapshot]\n"
    "\t[-c|--chunksize]\n"
    "\t[-d|--debug]\n"
@@ -209,9 +218,9 @@ xx(lvconvert,
    force_ARG, interval_ARG, merge_ARG, mirrorlog_ARG, mirrors_ARG, name_ARG,
    noudevsync_ARG, originname_ARG, poolmetadata_ARG, poolmetadatasize_ARG,
    poolmetadataspare_ARG, readahead_ARG, regionsize_ARG, repair_ARG,
-   replace_ARG, snapshot_ARG, splitmirrors_ARG, stripes_long_ARG,
-   stripesize_ARG, test_ARG, thin_ARG, thinpool_ARG, trackchanges_ARG,
-   type_ARG, use_policies_ARG, zero_ARG)
+   replace_ARG, snapshot_ARG, splitmirrors_ARG, splitsnapshot_ARG,
+   stripes_long_ARG, stripesize_ARG, test_ARG, thin_ARG, thinpool_ARG,
+   trackchanges_ARG, type_ARG, use_policies_ARG, zero_ARG)
 
 xx(lvcreate,
    "Create a logical volume",
tools/lvconvert.c +122 -20

266 lines not on this page · raw message