]> sourceware.org Git - lvm2.git/commitdiff
Print warning instead of error message if cannot zero volume
authorMilan Broz <mbroz@redhat.com>
Wed, 10 Jan 2007 14:13:46 +0000 (14:13 +0000)
committerMilan Broz <mbroz@redhat.com>
Wed, 10 Jan 2007 14:13:46 +0000 (14:13 +0000)
Update lvconvert man page (snapshot option)

WHATS_NEW
man/lvconvert.8
man/lvcreate.8
tools/lvconvert.c
tools/lvcreate.c

index fbfe4ac0d6b5b597e4b71091edae1cfd7171a730..80781968c53bda001abc53641a33d02be15aef30 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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.
index 9ac0afc4a994e6c816642b6dfce4366d03c0f326..8efde5991654ce34d26eeca450e0ac79fb39eaab 100644 (file)
@@ -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 @@ the mirror you are changing.
 .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 @@ two-way mirror with an in-memory log.
 .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),
index 3cafb5c1f9661c18ca55f700177580712814225a..b9541f5bdfd3b738fb886144353cf5eab525115a 100644 (file)
@@ -139,6 +139,10 @@ on the snapshot in order to check how much data is allocated to it.
 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
index 43e2bf6a2a4f441f6fa271e2d908982eaf03f0e9..61703348b758a1684280dc2f6bcfb7fbcb1a5fb7 100644 (file)
@@ -446,8 +446,8 @@ static int lvconvert_snapshot(struct cmd_context *cmd,
                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.");
index d2de870a60611b55839546b3a05f806bfc5a5d79..20ffba4d5e7658b43eef6d064bc645cdb04a9b58 100644 (file)
@@ -434,6 +434,10 @@ static int _lvcreate_params(struct lvcreate_params *lp, struct cmd_context *cmd,
        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);
 
This page took 0.046407 seconds and 5 git commands to generate.