Bug 236344

Summary: lvextend -h shows mirror option
Product: Red Hat Enterprise Linux 5 Reporter: masanari iida <masanari_iida>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED NOTABUG QA Contact: Corey Marthaler <cmarthal>
Severity: low Docs Contact:
Priority: medium    
Version: 5.0CC: agk, dwysocha, jbrassow, mbroz, prockai, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-19 12:18:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description masanari iida 2007-04-13 11:31:27 UTC
Description of problem:
lvextend -h shows mirror options [-m|--mirrors Mirrors]
But in order to convert single logical volume to mirrored,
we use "lvconvert" instead.

Man for lvextend doesn't include -m option for lvextend.
But only  lvextend -h shows that "-m" option.
This is confusing.

Version-Release number of selected component (if applicable):
lvm2-2.02.16-3.el5

How reproducible:
Always

Steps to Reproduce:
1. Install lvm2 rpm.
2. /usr/sbin/lvextend -h
  
Actual results:

# /usr/sbin/lvextend -h
  lvextend: Add space to a logical volume

lvextend
        [-A|--autobackup y|n]
        [--alloc AllocationPolicy]
        [-d|--debug]
        [-h|--help]
        [-i|--stripes Stripes [-I|--stripesize StripeSize]]
        {-l|--extents [+]LogicalExtentsNumber[%{VG|FREE}] |
         -L|--size [+]LogicalVolumeSize[kKmMgGtTpPeE]}
        [-m|--mirrors Mirrors]                                  <==
        [-n|--nofsck]
        [-r|--resizefs]
        [-t|--test]
        [--type VolumeType]
        [-v|--verbose]
        [--version]
        LogicalVolume[Path] [ PhysicalVolumePath... ]



Expected results:

# /usr/sbin/lvextend -h
  lvextend: Add space to a logical volume

lvextend
        [-A|--autobackup y|n]
        [--alloc AllocationPolicy]
        [-d|--debug]
        [-h|--help]
        [-i|--stripes Stripes [-I|--stripesize StripeSize]]
        {-l|--extents [+]LogicalExtentsNumber[%{VG|FREE}] |
         -L|--size [+]LogicalVolumeSize[kKmMgGtTpPeE]}
        [-n|--nofsck]
        [-r|--resizefs]
        [-t|--test]
        [--type VolumeType]
        [-v|--verbose]
        [--version]
        LogicalVolume[Path] [ PhysicalVolumePath... ]


Additional info:
Those who used to use LVM on HP-UX, at first, 
we try to use lvextend -m 1 to create a mirror.
Then we can find an error message that we failed to
extend the lvol to mirroring. 
And that is our starting point to investigate 
how to extend lvol to mirroring.
In that case, online manual of lvextend and 
"lvextend -h" output should be in sync.

Comment 1 Alasdair Kergon 2007-04-20 20:29:08 UTC
Hmmm.  lvextend -m in lvm2 means 'append to the LV a new section that is
mirrored'.  This is different from 'lvconvert -m'.

We can cover this with a special lvextend error message, because our lvextend
requires a size to be specified whereas - I presume (please check) - hpux
version doesn't.

Comment 2 Milan Broz 2008-12-19 12:18:19 UTC
lvconvert -m1 : converts to mirror with 2 images

lvextend -m1 : adds (append) to existing LV new segment of specified size (here mirror of 2 images)

(currently mirror doesn't support some types of operation)

# lvextend -m 1 vg_test/mirr
  Please specify either size or extents but not both.
  Run `lvextend --help' for more information.

# lvextend -m 1 -l +1 vg_test/mirr
  Extending logical volume mirr to 8.00 MB
  Logical volume mirr successfully resized

# lvextend -l +1 vg_test/mirr
  Extending 2 mirror images.
  Extending logical volume mirr to 12.00 MB
  Logical volume mirr successfully resized

# lvextend -m0 -l +1 vg_test/mirr
  Cannot vary number of mirrors in LV yet.
  Run `lvextend --help' for more information.

So I think it works as expected, just the command usage differs from HP-UX LVM.
Here, "extend" always means add space, "convert" changes volume layout.

(And -m option will be documented in man page when mirror will support multiple segment types, it has no use today I think.)