public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW man/lvconvert.8 man/lvcreate. ...
@ 2007-08-30 19:34 agk
  0 siblings, 0 replies; 3+ messages in thread
From: agk @ 2007-08-30 19:34 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-08-30 19:34:19

Modified files:
	.              : WHATS_NEW 
	man            : lvconvert.8 lvcreate.8 
	tools          : lvconvert.c lvcreate.c 

Log message:
	Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
	Correct --mirrorlog argument name in man pages (not --log).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.699&r2=1.700
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvconvert.8.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvcreate.8.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.143&r2=1.144

--- LVM2/WHATS_NEW	2007/08/30 18:53:32	1.699
+++ LVM2/WHATS_NEW	2007/08/30 19:34:18	1.700
@@ -1,6 +1,8 @@
 Version 2.02.29 -
 ==================================
-  Clear MIRROR_NOTSYNCED lv flag when converting from mirror to linear.
+  Avoid error when --corelog is provided without --mirrorlog. (2.02.28)
+  Correct --mirrorlog argument name in man pages (not --log).
+  Clear MIRROR_NOTSYNCED LV flag when converting from mirror to linear.
   Modify lvremove to prompt for removal if LV active on other cluster nodes.
   Add '-f' to vgremove to force removal of VG even if LVs exist.
   
--- LVM2/man/lvconvert.8	2007/08/24 21:01:52	1.8
+++ LVM2/man/lvconvert.8	2007/08/30 19:34:19	1.9
@@ -47,7 +47,7 @@
 time the device is activated - perhaps, for example, after every reboot.
 .TP
 .I \-\-corelog
-The optional argument "--corelog" is the same as specifying "--log core".
+The optional argument "--corelog" is the same as specifying "--mirrorlog core".
 .TP
 .I \-R, \-\-regionsize MirrorLogRegionSize
 A mirror is divided into regions of this size (in MB), and the mirror log
@@ -71,12 +71,12 @@
 converts the linear logical volume "vg00/lvol1" to
 a two-way mirror logical volume.
 
-"lvconvert --log core vg00/lvol1"
+"lvconvert --mirrorlog core vg00/lvol1"
 .br
 converts a mirror with a disk log to a
 mirror with an in-memory log.
 
-"lvconvert --log disk vg00/lvol1"
+"lvconvert --mirrorlog disk vg00/lvol1"
 .br
 converts a mirror with an in-memory log
 to a mirror with a disk log.
--- LVM2/man/lvcreate.8	2007/08/24 21:01:52	1.17
+++ LVM2/man/lvcreate.8	2007/08/30 19:34:19	1.18
@@ -102,7 +102,7 @@
 by copying the data from the first device again each time the
 device is activated, for example, after every reboot.
 
-The optional argument --corelog is equivalent to --log core.
+The optional argument --corelog is equivalent to --mirrorlog core.
 
 .TP
 .I \-n, \-\-name LogicalVolumeName
@@ -161,7 +161,7 @@
 require 3 devices - two for the mirror devices and one for the disk
 log.
 
-"lvcreate -m1 --log core -L 500M vg00" tries to create a mirror logical volume
+"lvcreate -m1 --mirrorlog core -L 500M vg00" tries to create a mirror logical volume
 with 2 sides with a useable size of 500 MiB.  This operation would
 require 2 devices - the log is "in-memory".
 
--- LVM2/tools/lvconvert.c	2007/08/29 20:19:11	1.39
+++ LVM2/tools/lvconvert.c	2007/08/30 19:34:19	1.40
@@ -275,7 +275,8 @@
 	if (arg_count(cmd, corelog_ARG))
 		corelog = 1;
 
-	mirrorlog = arg_str_value(cmd, mirrorlog_ARG, DEFAULT_MIRRORLOG);
+	mirrorlog = arg_str_value(cmd, mirrorlog_ARG,
+				  corelog ? "core" : DEFAULT_MIRRORLOG);
 	if (!strcmp("disk", mirrorlog)) {
 		if (corelog) {
 			log_error("--mirrorlog disk and --corelog "
--- LVM2/tools/lvcreate.c	2007/08/22 14:38:18	1.143
+++ LVM2/tools/lvcreate.c	2007/08/30 19:34:19	1.144
@@ -288,7 +288,9 @@
 	if (arg_count(cmd, corelog_ARG))
 		lp->corelog = 1;
 
-	mirrorlog = arg_str_value(cmd, mirrorlog_ARG, DEFAULT_MIRRORLOG);
+	mirrorlog = arg_str_value(cmd, mirrorlog_ARG,
+				  lp->corelog ? "core" : DEFAULT_MIRRORLOG);
+
 	if (!strcmp("disk", mirrorlog)) {
 		if (lp->corelog) {
 			log_error("--mirrorlog disk and --corelog "


^ permalink raw reply	[flat|nested] 3+ messages in thread

* LVM2 ./WHATS_NEW man/lvconvert.8 man/lvcreate. ...
@ 2007-08-01 21:01 jbrassow
  0 siblings, 0 replies; 3+ messages in thread
From: jbrassow @ 2007-08-01 21:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2007-08-01 21:01:06

Modified files:
	.              : WHATS_NEW 
	man            : lvconvert.8 lvcreate.8 
	tools          : args.h commands.h lvconvert.c lvcreate.c 

Log message:
	This patch changes the arguments that specify the mirror
	log type.  Previously, we had a '--corelog' argument that
	would change the default type from 'disk' to 'core'.  I
	think that creates too much confusion - especially when
	doing conversions on mirrors.
	
	The new argument '--log' takes either "disk" or "core"
	as a parameter.  This could be expanded in the future
	for additional logging types as well.
	
	Examples:
	# Creating a 2-way mirror
	$> lvcreate -m1 ... # implicitly use default disk logging
	$> lvcreate -m1 --log disk ... # explicit disk logging
	$> lvcreate -m1 --log core ... # specify core logging
	$> lvcreate -m1 --corelog ... # old way still works
	
	# Conversion examples
	$> lvconvert --log core ... # convert to core logging
	$> lvconvert --log disk ... # convert to disk logging
	$> lvconvert -mX --corelog ... # old way still works
	$> lvconvert -mX ... # old way of converting to disk logging still works
	
	Changes are reflected in the man pages.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.675&r2=1.676
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvconvert.8.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvcreate.8.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/args.h.diff?cvsroot=lvm2&r1=1.50&r2=1.51
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.97&r2=1.98
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.138&r2=1.139

--- LVM2/WHATS_NEW	2007/08/01 20:29:07	1.675
+++ LVM2/WHATS_NEW	2007/08/01 21:01:06	1.676
@@ -1,5 +1,6 @@
 Version 2.02.28 -
 ================================
+  Add --log argument to specify log type for mirrors.
   Don't try to monitor devices which we failed to create.
   Don't leak a file descriptor in fcntl_lock_file(), when fcntl fails.
   Remove create_dir function; use now-equivalent dm_create_dir instead
--- LVM2/man/lvconvert.8	2007/01/10 19:56:38	1.5
+++ LVM2/man/lvconvert.8	2007/08/01 21:01:06	1.6
@@ -3,7 +3,7 @@
 lvconvert \- convert a logical volume from linear to mirror or snapshot
 .SH SYNOPSIS
 .B lvconvert
-\-m/\-\-mirrors Mirrors [\-\-corelog] [\-R/\-\-regionsize MirrorLogRegionSize]
+\-m/\-\-mirrors Mirrors [\-\-log {disk|core}] [\-R/\-\-regionsize MirrorLogRegionSize]
 [\-A/\-\-alloc AllocationPolicy]
 [\-h/\-?/\-\-help]
 [\-v/\-\-verbose]
@@ -37,12 +37,10 @@
 volume to a mirror volume with 2-sides; that is, a
 linear volume plus one copy.
 .TP
-.I \-\-corelog
-This optional argument tells lvconvert to switch the
-mirror from using a disk-based (persistent) log to
-an in-memory log.  You may only specify this option
-when the \-\-mirror argument is the same degree of
-the mirror you are changing.
+.I \-\-log disk/core
+This optional argument gives the ability to switch the
+logging type that is used by a mirror.  The logging type
+can be either "disk" (persistent) or "core" (non-persistent).
 .TP
 .I \-R, \-\-regionsize MirrorLogRegionSize
 A mirror is divided into regions of this size (in MB), and the mirror log
@@ -64,14 +62,17 @@
 "lvconvert -m1 vg00/lvol1"
 .br
 converts the linear logical volume "vg00/lvol1" to
-a mirror logical volume.  This command could also
-be used to convert a two-way mirror with an
-in-memory log to a two-way mirror with a disk log.
+a two-legged mirror logical volume.
 
-"lvconvert -m1 --corelog vg00/lvol1"
+"lvconvert --log core vg00/lvol1"
 .br
-converts a two-way mirror with a disk log to a
-two-way mirror with an in-memory log.
+converts a mirror with a disk log to a
+mirror with an in-memory log.
+
+"lvconvert --log disk vg00/lvol1"
+.br
+converts a mirror with an in-memory log
+to a mirror with a disk log.
 
 "lvconvert -m0 vg00/lvol1"
 .br
--- LVM2/man/lvcreate.8	2007/01/10 14:13:46	1.14
+++ LVM2/man/lvcreate.8	2007/08/01 21:01:06	1.15
@@ -11,7 +11,7 @@
 {\-l/\-\-extents LogicalExtentsNumber[%{VG|FREE}] |
  \-L/\-\-size LogicalVolumeSize[kKmMgGtT]}
 [\-M/\-\-persistent y/n] [\-\-minor minor]
-[\-m/\-\-mirrors Mirrors [\-\-nosync] [\-\-corelog]
+[\-m/\-\-mirrors Mirrors [\-\-nosync] [\-\-log {disk|log}]
 [\-R/\-\-regionsize MirrorLogRegionSize]]
 [\-n/\-\-name LogicalVolumeName]
 [\-p/\-\-permission r/rw] [\-r/\-\-readahead ReadAheadSectors]
@@ -95,11 +95,13 @@
 copied.  This is useful for skipping a potentially long and resource
 intensive initial sync.
 
-Specifying the optional argument "--corelog" will create a mirror with
-an in-memory log verses a disk-based (persistent) log.  While this
-removes the need for an extra log device and *may* be slightly faster,
-it requires that the entire mirror be resynchronized upon each
-instantiation (e.g. a reboot).
+The optional argument "--log" gives the ability to specify the type
+of mirror log to be used.  The available types are "disk" and "core",
+where "disk" is the default.  The "disk" log is persistent and requires
+a small amount of storage space - usually on a separate device from the
+mirror legs.  While the "disk" log may cause the mirror to be slightly
+slower during writes, it prevents the need to completely resynchronize
+the mirror upon each instantiation (e.g. a reboot).
 .TP
 .I \-n, \-\-name LogicalVolumeName
 The name for the new logical volume.
@@ -157,6 +159,10 @@
 require 3 devices - two for the mirror devices and one for the disk
 log.
 
+"lvcreate -m1 --log core -L 500M vg00" tries to create a mirror logical volume
+with 2 sides with a useable size of 500 MiB.  This operation would
+require 2 devices - the log is "in-memory".
+
 "lvcreate --size 100m --snapshot --name snap /dev/vg00/lvol1"
 .br
 creates a snapshot logical volume named /dev/vg00/snap which has access to the
--- LVM2/tools/args.h	2007/06/18 14:14:33	1.50
+++ LVM2/tools/args.h	2007/08/01 21:01:06	1.51
@@ -48,6 +48,7 @@
 arg(nosync_ARG, '\0', "nosync", NULL)
 arg(resync_ARG, '\0', "resync", NULL)
 arg(corelog_ARG, '\0', "corelog", NULL)
+arg(log_ARG, '\0', "log", string_arg)
 arg(monitor_ARG, '\0', "monitor", yes_no_arg)
 arg(config_ARG, '\0', "config", string_arg)
 arg(trustcache_ARG, '\0', "trustcache", NULL)
--- LVM2/tools/commands.h	2007/06/18 14:14:33	1.97
+++ LVM2/tools/commands.h	2007/08/01 21:01:06	1.98
@@ -88,7 +88,7 @@
 xx(lvconvert,
    "Change logical volume layout",
    "lvconvert "
-   "[-m|--mirrors Mirrors [--corelog]]\n"
+   "[-m|--mirrors Mirrors [--log {disk|core}]]\n"
    "\t[-R|--regionsize MirrorLogRegionSize]\n"
    "\t[--alloc AllocationPolicy]\n"
    "\t[-d|--debug]\n"
@@ -107,8 +107,8 @@
    "\t[--version]" "\n"
    "\tOriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]\n",
 
-   alloc_ARG, chunksize_ARG, mirrors_ARG, corelog_ARG, regionsize_ARG,
-   snapshot_ARG, test_ARG, zero_ARG)
+   alloc_ARG, chunksize_ARG, mirrors_ARG, corelog_ARG, log_ARG,
+   regionsize_ARG, snapshot_ARG, test_ARG, zero_ARG)
 
 xx(lvcreate,
    "Create a logical volume",
@@ -123,7 +123,7 @@
    "\t{-l|--extents LogicalExtentsNumber |\n"
    "\t -L|--size LogicalVolumeSize[kKmMgGtTpPeE]}\n"
    "\t[-M|--persistent {y|n}] [--major major] [--minor minor]\n"
-   "\t[-m|--mirrors Mirrors [--nosync] [--corelog]]\n"
+   "\t[-m|--mirrors Mirrors [--nosync] [--log {disk|core}]]\n"
    "\t[-n|--name LogicalVolumeName]\n"
    "\t[-p|--permission {r|rw}]\n"
    "\t[-r|--readahead ReadAheadSectors]\n"
@@ -156,7 +156,7 @@
    "\tOriginalLogicalVolume[Path] [PhysicalVolumePath...]\n\n",
 
    addtag_ARG, alloc_ARG, autobackup_ARG, chunksize_ARG, contiguous_ARG,
-   corelog_ARG, extents_ARG, major_ARG, minor_ARG, mirrors_ARG, name_ARG,
+   corelog_ARG, log_ARG, extents_ARG, major_ARG, minor_ARG, mirrors_ARG, name_ARG,
    nosync_ARG, permission_ARG, persistent_ARG, readahead_ARG, regionsize_ARG,
    size_ARG, snapshot_ARG, stripes_ARG, stripesize_ARG, test_ARG, type_ARG,
    zero_ARG)
--- LVM2/tools/lvconvert.c	2007/08/01 20:54:28	1.30
+++ LVM2/tools/lvconvert.c	2007/08/01 21:01:06	1.31
@@ -101,14 +101,31 @@
 static int _read_params(struct lvconvert_params *lp, struct cmd_context *cmd,
 			int argc, char **argv)
 {
+	int count;
 	int region_size;
 	int pagesize = lvm_getpagesize();
 
 	memset(lp, 0, sizeof(*lp));
 
-	if (arg_count(cmd, mirrors_ARG) + arg_count(cmd, snapshot_ARG) != 1) {
-		log_error("Exactly one of --mirrors or --snapshot arguments "
-			  "required.");
+	if (arg_count(cmd, log_ARG) > 1) {
+		log_error("Too many --log arguments supplied.");
+		return 0;
+	}
+	if (arg_count(cmd, mirrors_ARG) > 1) {
+		log_error("Too many --mirrors arguments supplied.");
+		return 0;
+	}
+	if (arg_count(cmd, snapshot_ARG) > 1) {
+		log_error("Too many --snapshot arguments supplied.");
+		return 0;
+	}
+	if (arg_count(cmd, log_ARG) || arg_count(cmd, mirrors_ARG))
+		count = 1;
+	count += arg_count(cmd, snapshot_ARG);
+
+	if (count != 1) {
+		log_error("--snapshots argument cannot be mixed "
+			  "with --mirrors or --log");
 		return 0;
 	}
 
@@ -237,6 +254,8 @@
 	struct list *parallel_areas;
 	struct segment_type *segtype;  /* FIXME: could I just use lp->segtype */
 	float sync_percent;
+	const char *log_arg;
+	int corelog = 0;
 
 	seg = first_seg(lv);
 	existing_mirrors = seg->area_count;
@@ -267,6 +286,31 @@
 		return 0;
 	}
 
+	/*
+	 * Adjust log type
+	 */
+	if (arg_count(cmd, corelog_ARG)) {
+		log_verbose("Setting logging type to \"core\"");
+		corelog = 1;
+	}
+
+	if (arg_count(cmd, log_ARG)) {
+		log_arg = arg_str_value(cmd, log_ARG, "disk");
+		if (!strcmp("disk", log_arg)) {
+			log_verbose("Setting logging type to \"disk\"");
+			corelog = 0;
+		} else if (!strcmp("core", log_arg)) {
+			log_verbose("Setting logging type to \"core\"");
+			corelog = 1;
+		} else {
+			log_error("Unknown logging type, \"%s\"", log_arg);
+			return 0;
+		}
+	}
+
+	/*
+	 * Region size must not change on existing mirrors
+	 */
 	if (arg_count(cmd, regionsize_ARG) && (lv->status & MIRRORED) &&
 	    (lp->region_size != seg->region_size)) {
 		log_error("Mirror log region size cannot be changed on "
@@ -309,7 +353,7 @@
 
 		if (!(ah = allocate_extents(lv->vg, NULL, lp->segtype,
 					    1, lp->mirrors - 1,
-					    arg_count(cmd, corelog_ARG) ? 0 : 1,
+					    corelog ? 0 : 1,
 					    lv->le_count * (lp->mirrors - 1),
 					    NULL, 0, 0, lp->pvh,
 					    lp->alloc,
@@ -321,7 +365,7 @@
 							      lp->region_size);
 
 		log_lv = NULL;
-		if (!arg_count(cmd, corelog_ARG) &&
+		if (!corelog &&
 		    !(log_lv = create_mirror_log(cmd, lv->vg, ah,
 						 lp->alloc,
 						 lv->name, 0, &lv->tags))) {
@@ -348,7 +392,7 @@
 	}
 
 	if (lp->mirrors == existing_mirrors) {
-		if (!seg->log_lv && !arg_count(cmd, corelog_ARG)) {
+		if (!seg->log_lv && !corelog) {
 			/* No disk log present, add one. */
 			if (!(parallel_areas = build_parallel_areas_from_lv(cmd, lv)))
 				return_0;
@@ -383,7 +427,7 @@
 			seg->log_lv = log_lv;
 			log_lv->status |= MIRROR_LOG;
 			first_seg(log_lv)->mirror_seg = seg;
-		} else if (seg->log_lv && arg_count(cmd, corelog_ARG)) {
+		} else if (seg->log_lv && corelog) {
 			/* Had disk log, switch to core. */
 			if (!lv_mirror_percent(cmd, lv, 0, &sync_percent, NULL)) {
 				log_error("Unable to determine mirror sync status.");
@@ -543,7 +587,8 @@
 		return ECMD_FAILED;
 	}
 
-	if (arg_count(cmd, mirrors_ARG)) {
+	if (arg_count(cmd, mirrors_ARG) ||
+	    ((lv->status & MIRRORED) && arg_count(cmd, log_ARG))) {
 		if (!archive(lv->vg))
 			return ECMD_FAILED;
 		if (!lvconvert_mirrors(cmd, lv, lp))
--- LVM2/tools/lvcreate.c	2007/07/17 16:13:12	1.138
+++ LVM2/tools/lvcreate.c	2007/08/01 21:01:06	1.139
@@ -241,6 +241,7 @@
 	int argc = *pargc;
 	int region_size;
 	int pagesize = lvm_getpagesize();
+	const char *log_arg;
 
 	if (argc && (unsigned) argc < lp->mirrors) {
 		log_error("Too few physical volumes on "
@@ -284,7 +285,25 @@
 		return 0;
 	}
 
-	lp->corelog = arg_count(cmd, corelog_ARG) ? 1 : 0;
+	if (arg_count(cmd, corelog_ARG)) {
+		log_verbose("Setting logging type to \"core\"");
+		lp->corelog = 1;
+	}
+
+	if (arg_count(cmd, log_ARG)) {
+		log_arg = arg_str_value(cmd, log_ARG, "disk");
+		if (!strcmp("disk", log_arg)) {
+			log_verbose("Setting logging type to \"disk\"");
+			lp->corelog = 0;
+		} else if (!strcmp("core", log_arg)) {
+			log_verbose("Setting logging type to \"core\"");
+			lp->corelog = 1;
+		} else {
+			log_error("Unknown logging type, \"%s\"", log_arg);
+			return 0;
+		}
+	}
+
 	lp->nosync = arg_count(cmd, nosync_ARG) ? 1 : 0;
 
 	return 1;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* LVM2 ./WHATS_NEW man/lvconvert.8 man/lvcreate. ...
@ 2007-01-10 14:13 mbroz
  0 siblings, 0 replies; 3+ messages in thread
From: mbroz @ 2007-01-10 14:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2007-01-10 14:13:46

Modified files:
	.              : WHATS_NEW 
	man            : lvconvert.8 lvcreate.8 
	tools          : lvconvert.c lvcreate.c 

Log message:
	Print warning instead of error message if cannot zero volume
	Update lvconvert man page (snapshot option)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.532&r2=1.533
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvconvert.8.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvcreate.8.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.131&r2=1.132

--- LVM2/WHATS_NEW	2007/01/09 23:22:31	1.532
+++ LVM2/WHATS_NEW	2007/01/10 14:13:46	1.533
@@ -1,5 +1,7 @@
 Version 2.02.18 -
 ====================================
+  Print warning instead of error message if cannot zero volume
+  Update lvconvert man page (snapshot option)
   dumpconfig accepts a list of configuration variables to display.
   Change dumpconfig to use --file to redirect output to a file.
   Avoid vgreduce error when mirror code removes the log LV.
--- LVM2/man/lvconvert.8	2006/10/07 10:47:05	1.3
+++ LVM2/man/lvconvert.8	2007/01/10 14:13:46	1.4
@@ -1,20 +1,35 @@
 .TH LVCONVERT 8 "LVM TOOLS" "Red Hat, Inc" \" -*- nroff -*-
 .SH NAME
-lvconvert \- convert a logical volume between linear and mirror
+lvconvert \- convert a logical volume from linear to mirror or snapshot
 .SH SYNOPSIS
 .B lvconvert
-[\-m/\-\-mirrors Mirrors [\-\-corelog] [\-R/\-\-regionsize MirrorLogRegionSize]]
+\-m/\-\-mirrors Mirrors [\-\-corelog] [\-R/\-\-regionsize MirrorLogRegionSize]
 [\-A/\-\-alloc AllocationPolicy]
 [\-h/\-?/\-\-help]
 [\-v/\-\-verbose]
 [\-\-version]
+.br
 LogicalVolume[Path] [PhysicalVolume[Path]...]
+.br
+
+.br
+.B lvconvert
+\-s/\-\-snapshot [\-c/\-\-chunksize ChunkSize]
+[\-h/\-?/\-\-help]
+[\-v/\-\-verbose]
+[\-Z/\-\-zero y/n]
+[\-\-version]
+.br
+OriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]
 .SH DESCRIPTION
 lvconvert will change a linear logical volume to a mirror
-logical volume or vis versa.  It is also used to add and
-remove disk logs from mirror devices.
+logical volume or to a snapshot of linear volume and vice versa.
+It is also used to add and remove disk logs from mirror devices.
 .SH OPTIONS
 See \fBlvm\fP for common options.
+.br
+Exactly one of \-\-mirrors or \-\-snapshot arguments required.
+.br
 .TP
 .I \-m, \-\-mirrors Mirrors
 Specifies the degree of the mirror you wish to create.
@@ -32,6 +47,19 @@
 .I \-R, \-\-regionsize MirrorLogRegionSize
 A mirror is divided into regions of this size (in MB), and the mirror log
 uses this granularity to track which regions are in sync.
+.br
+.TP
+.I \-s, \-\-snapshot
+Create a snapshot from existing logical volume using another
+existing logical volume as its origin.
+.TP
+.I \-c, \-\-chunksize ChunkSize
+Power of 2 chunk size for the snapshot logical volume between 4k and 512k.
+.TP
+.I \-Z, \-\-zero y/n
+Controls zeroing of the first KB of data in the snapshot.
+If the volume is read only snapshot will not be zeroed.
+.br
 .SH Examples
 "lvconvert -m1 vg00/lvol1"
 .br
@@ -49,6 +77,12 @@
 .br
 converts a mirror logical volume to a linear logical
 volume.
+.br
+
+.br
+"lvconvert -s vg00/lvol1 vg00/lvol2"
+.br
+converts logical volume "vg00/lvol2" to snapshot of original volume "vg00/lvol1"
 
 .SH SEE ALSO
 .BR lvm (8),
--- LVM2/man/lvcreate.8	2006/11/10 18:24:11	1.13
+++ LVM2/man/lvcreate.8	2007/01/10 14:13:46	1.14
@@ -139,6 +139,10 @@
 Controls zeroing of the first KB of data in the new logical volume.
 .br
 Default is yes.
+.br
+Volume will not be zeroed if read only flag is set.
+.br
+Snapshot volumes are zeroed always.
 
 .br
 Warning: trying to mount an unzeroed logical volume can cause the system to
--- LVM2/tools/lvconvert.c	2006/12/13 03:39:58	1.24
+++ LVM2/tools/lvconvert.c	2007/01/10 14:13:46	1.25
@@ -446,8 +446,8 @@
 		return 0;
 	}
 
-	if (!lp->zero)
-		log_error("WARNING: \"%s\" not zeroed", lv->name);
+	if (!lp->zero || !(lv->status & LVM_WRITE))
+		log_print("WARNING: \"%s\" not zeroed", lv->name);
 	else if (!set_lv(cmd, lv, 0, 0)) {
 			log_error("Aborting. Failed to wipe snapshot "
 				  "exception store.");
--- LVM2/tools/lvcreate.c	2006/11/10 18:24:11	1.131
+++ LVM2/tools/lvcreate.c	2007/01/10 14:13:46	1.132
@@ -434,6 +434,10 @@
 	else
 		lp->permission = LVM_READ | LVM_WRITE;
 
+	/* Must not zero read only volume */
+	if (!(lp->permission & LVM_WRITE))
+		lp->zero = 0;
+
 	lp->minor = arg_int_value(cmd, minor_ARG, -1);
 	lp->major = arg_int_value(cmd, major_ARG, -1);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-30 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-30 19:34 LVM2 ./WHATS_NEW man/lvconvert.8 man/lvcreate. agk
  -- strict thread matches above, loose matches on Subject: below --
2007-08-01 21:01 jbrassow
2007-01-10 14:13 mbroz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).