Bug 429122

Summary: lvextend should default to the size of the pv + current size of lv
Product: Red Hat Enterprise Linux 5 Reporter: Milan Broz <mbroz>
Component: lvm2Assignee: Dave Wysochanski <dwysocha>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: medium Docs Contact:
Priority: low    
Version: 5.2CC: agk, dwysocha, heinzm, jbrassow, mbroz, prockai, pvrabec, shillman
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0378 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 15:39:51 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 Milan Broz 2008-01-17 14:36:14 UTC
+++ This bug was initially created as a clone of Bug #154691 +++
RHEL5 clone

Description of problem:
With computers now days, one shouldn't have to do any math in their head. :)
Since I can add a PV to a VG without any size option, I should be able to do the
 same when adding a PV to a LV, or better yet, if I already added the PV to the
VG, the lv should be able to extend out to the full size of the VG by default.
 

Version-Release number of selected component (if applicable):
[root@tank-03 ~]# rpm -qa | grep lvm2
lvm2-2.01.08-1.0.RHEL4
lvm2-cluster-2.01.09-1.1.RHEL4


The following should "just work":
[root@tank-03 ~]# lvextend /dev/grow/grow /dev/sda3 
  Please specify either size or extents (not both)
  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 |
         -L|--size [+]LogicalVolumeSize[kKmMgGtT]}
        [-n|--nofsck]
        [-r|--resizefs]
        [-t|--test]
        [--type VolumeType]
        [-v|--verbose]
        [--version]
        LogicalVolume[Path] [ PhysicalVolumePath... ]

but instead I have to do math and figure out the size to extend out too:
[root@tank-03 ~]# lvextend -L 274.06G /dev/grow/grow /dev/sda3
  Rounding up size to full physical extent 274.06 GB
  Extending logical volume grow to 274.06 GB
  Logical volume grow successfully resized

...
-- Additional comment from dwysocha on 2007-09-20 17:49 EST --
Patch in #14 with slight modifications committed to upstream CVS and should be
pulled into next release.

Comment 2 RHEL Program Management 2008-01-17 14:45:57 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 3 Milan Broz 2008-01-18 00:23:40 UTC
In lvm2-2.02.30-1.el5.

Comment 5 Corey Marthaler 2008-03-31 16:06:03 UTC
Fix verified in lvm2-2.02.32-2.el5.

[root@hayes-03 ~]# lvs -a -o +devices
  LV       VG         Attr   LSize  Origin Snap%  Move Log Copy%  Convert Devices
  lv       corey      -wi-a-  6.34T                                      
/dev/etherd/e1.1p1(0)
  lv       corey      -wi-a-  6.34T                                      
/dev/etherd/e1.1p2(0)
  lv       corey      -wi-a-  6.34T                                      
/dev/etherd/e1.1p3(0)
  lv       corey      -wi-a-  6.34T                                      
/dev/etherd/e1.1p4(0)
  lv       corey      -wi-a-  6.34T                                      
/dev/etherd/e1.1p5(0)
[root@hayes-03 ~]# vgextend corey /dev/etherd/e1.1p6
  Volume group "corey" successfully extended
[root@hayes-03 ~]# lvextend /dev/corey/lv /dev/etherd/e1.1p6
  Extending logical volume lv to 7.60 TB
  Logical volume lv successfully resized


Comment 7 errata-xmlrpc 2008-05-21 15:39:51 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0378.html