[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel][PATCH] Add escape sequence for ':' in command's PV list



On Fri, 2009-05-15 at 08:07 -0400, Dave Wysochanski wrote:
> On Thu, 2009-05-14 at 15:25 -0400, Dave Wysochanski wrote:
> > On Thu, 2009-05-14 at 11:33 +0200, Peter Rajnoha wrote: 
> > > On 05/13/2009 09:43 PM, Dave Wysochanski wrote:
> > > > I know, it does not make sense to specify a pe range
> > > > for pvcreate or vgcreate.  But shouldn't we be consistent, or at least
> > > > very much clarify the arguments are different?  I can just imagine
> > > > someone scripting something and then being surprised when they needed to
> > > > quote only for lvcreate, pvmove, etc.
> > > 
> > > Hmm, then the question is, what should we do with single unescaped ':' if
> > > it appears in pvcreate, vgcreate, e.g. "pvcreate /dev/a::b:c" -- the first
> > > double one is OK, but what about the second single one? Should it be considered
> > > as an input error then? (...probably giving the user a message like
> > > "PE range definition not allowed here.")
> > > 
> > 
> > At this point I'd lean towards just clarifing the difference in the
> > arguments for the commands (e.g. in man pages, etc).  See attached patch
> > for a stab at updating the man pages.  If we go this route, then your
> > patch is fine as is IMO.
> > 
> > Also, on IRC yesterday, Alasdair suggested a new built-in command to
> > escape names such as this 
> > 17:01:40 < deepthot> agk_: on the escaping, you mean someone would do something like: lvcreate -L 16M -n lvname vgname `lvmescape /dev/pname`?
> > 17:05:07 < agk_> almost:   lvmescape /dev/path   then they can append :4-10 on it
> > 
> > IMO, this is a good idea.  However, in the spirit of not getting too
> > sidetracked, I think if we add proper explanation, we can probably defer
> > adding the built-in command, which probably requires some design thought
> > (for example, how to specify whether it is a pvname, vgname, etc - they
> > may have different characters to escape, etc).  If you want to tackle
> > that too though, go for it.
> > 
> 
> Upon further thought, I agree with you Peter - let's reject the ":" in
> pvcreate/vgcreate commands and print a message about pe range not
> allowed in these commands.  This way the commands are all consistent -
> require a "::" if any pvname contains a ":" in any of the commands.
> 

Updated man page patch is attached.
>From 5d372d11973857b83f1fff9f29908160119a1e24 Mon Sep 17 00:00:00 2001
From: Dave Wysochanski <dwysocha redhat com>
Date: Thu, 14 May 2009 15:21:11 -0400
Subject: [PATCH] Update man pages to clarify usage of PE ranges, and usage of ":" in pvname.

This patch should go with peterr's fix for handling ":"'s in PV names.

Signed-off-by: Dave Wysochanski <dwysocha redhat com>
---
 man/lvconvert.8.in |    8 +++++++-
 man/lvcreate.8.in  |   15 ++++++++++++++-
 man/lvextend.8.in  |    9 ++++++++-
 man/lvm.8.in       |    6 +++++-
 man/lvresize.8.in  |    9 ++++++++-
 5 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/man/lvconvert.8.in b/man/lvconvert.8.in
index 6c9a2ce..61d2e81 100644
--- a/man/lvconvert.8.in
+++ b/man/lvconvert.8.in
@@ -10,7 +10,7 @@ lvconvert \- convert a logical volume from linear to mirror or snapshot
 [\-v|\-\-verbose]
 [\-\-version]
 .br
-LogicalVolume[Path] [PhysicalVolume[Path]...]
+LogicalVolume[Path] [PhysicalVolumePath[:PE[-PE]]...]
 .br
 
 .br
@@ -105,6 +105,12 @@ volume.
 .br
 converts logical volume "vg00/lvol2" to snapshot of original volume "vg00/lvol1"
 
+.br
+"lvconvert -m1 vg00/lvol1 vg00/lvol2 /dev/sda:0-15 /dev/sdb:4-19"
+.br
+converts linear logical volume "vg00/lvol1" to a two-way mirror, using physical
+extents /dev/sda:0-15 and /dev/sdb:4-19 for allocation of new extents.
+
 .SH SEE ALSO
 .BR lvm (8),
 .BR vgcreate (8),
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 1e5322b..6a8bcbc 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -17,7 +17,7 @@ lvcreate \- create a logical volume in an existing volume group
 [\-p|\-\-permission r|rw] [\-r|\-\-readahead ReadAheadSectors|auto|none]
 [\-t|\-\-test]
 [\-v|\-\-verbose] [\-Z|\-\-zero y|n]
-VolumeGroupName [PhysicalVolumePath...]
+VolumeGroupName [PhysicalVolumePath[:PE[-PE]]...]
 .br
 
 .br
@@ -199,6 +199,19 @@ a backup while the original filesystem continues to get updated.
 .br
 creates a sparse device named /dev/vg1/sparse of size 1TB with space for just
 under 100MB of actual data on it.
+.br
+"lvcreate -L 64M -n lvol1 vg00 /dev/sda:0-15 /dev/sdb:4-19"
+.br
+creates a linear logical volume "vg00/lvol1" using physical extents
+/dev/sda:0-15 and /dev/sdb:4-19 for allocation of extents.
+
+.br
+"lvcreate -L 64M -n lvol1 vg00 /dev/8::1:0-15"
+.br
+creates a linear logical volume "vg00/lvol1" using physical extents
+0-15 from device /dev/8:1.  The escaped "::" is required to distinguish
+between the ":" in the device name and the PE range.
+
 
 .SH SEE ALSO
 .BR lvm (8), 
diff --git a/man/lvextend.8.in b/man/lvextend.8.in
index a97d359..aa582f8 100644
--- a/man/lvextend.8.in
+++ b/man/lvextend.8.in
@@ -9,7 +9,7 @@ lvextend \- extend the size of a logical volume
 {\-l|\-\-extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] |
 \-L|\-\-size [+]LogicalVolumeSize[kKmMgGtT]}
 [\-t|\-\-test]
-[\-v|\-\-verbose] LogicalVolumePath [PhysicalVolumePath...]
+[\-v|\-\-verbose] LogicalVolumePath [PhysicalVolumePath[:PE[-PE]]...]
 .SH DESCRIPTION
 lvextend allows you to extend the size of a logical volume.
 Extension of snapshot logical volumes (see
@@ -60,6 +60,13 @@ there are enough free physical extents in it.
 "lvextend /dev/vg01/lvol01 /dev/sdk3" tries to extend the size of that
 logical volume by the amount of free space on physical volume /dev/sdk3.
 This is equivalent to specifying "-l +100%PVS" on the command line.
+
+.br
+"lvextend -L+16M vg00/lvol1 /dev/sda:0-15 /dev/sdb:4-19"
+.br
+tries to extend a logical volume "vg00/lvol1" by 16MB using physical extents
+/dev/sda:0-15 and /dev/sdb:4-19 for allocation of extents.
+
 .SH SEE ALSO
 .BR lvm (8), 
 .BR lvcreate (8), 
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 6bad5fc..9b5d5b6 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -269,7 +269,11 @@ VG and LV names cannot begin with a hyphen.
 There are also various reserved names that are used internally by lvm that can not be used as LV or VG names.
 A VG cannot be called anything that exists in /dev/ at the time of creation, nor can it be called '.' or '..'.
 A LV cannot be called '.' '..' 'snapshot' or 'pvmove'. The LV name may also not contain the strings '_mlog' or '_mimage'
-
+.LP
+A PV name may contain a ":".  However, if the PV name contains a ":", you must
+add the escape sequence "::" in the PV name to distinguish between the name
+and a possible PE range.  The escape sequence is required in all commands,
+even though the command may not take a PE range.
 
 .SH DIAGNOSTICS
 All tools return a status code of zero on success or non-zero on failure.
diff --git a/man/lvresize.8.in b/man/lvresize.8.in
index 961d430..1f2ca95 100644
--- a/man/lvresize.8.in
+++ b/man/lvresize.8.in
@@ -9,7 +9,7 @@ lvresize \- resize a logical volume
 {\-l|\-\-extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE}] |
 \-L|\-\-size [+]LogicalVolumeSize[kKmMgGtT]}
 [\-t|\-\-test]
-[\-v|\-\-verbose] LogicalVolumePath [PhysicalVolumePath...]
+[\-v|\-\-verbose] LogicalVolumePath [PhysicalVolumePath[:PE[-PE]]...]
 .SH DESCRIPTION
 lvresize allows you to resize a logical volume.
 Be careful when reducing a logical volume's size, because data in the reduced
@@ -58,6 +58,13 @@ Not applicable to LVs using the original metadata LVM format, which
 must use a single value throughout.
 .br
 StripeSize must be 2^n (n = 2 to 9)
+.SH Examples
+.br
+"lvresize -L+16M vg00/lvol1 /dev/sda:0-15 /dev/sdb:4-19"
+.br
+tries to extend a logical volume "vg00/lvol1" by 16MB using physical extents
+/dev/sda:0-15 and /dev/sdb:4-19 for allocation of extents.
+
 .SH SEE ALSO
 .BR lvm (8), 
 .BR lvconvert (8),
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]