This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1017133 - Allocation issues when extending stripes with lower stripe number and using 100%FREE argument
Allocation issues when extending stripes with lower stripe number and using 1...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.5
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Alasdair Kergon
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-09 05:58 EDT by Nenad Peric
Modified: 2013-10-14 18:35 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-14 18:35:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nenad Peric 2013-10-09 05:58:32 EDT
Description of problem:

If you try to extend a striped LV using a -l100% argument and a stripe argument whith different size than original LV (smaller), LV will get extended on disks which were maybe not expected. 


How reproducible:

Create LV  and then increase its size by stripe number that is lower:

vgcreate vg /dev/sd{a..c}1

lvcreate -i 3 -L1G -n stripe vg
lvextend -i 1 -l100%FREE vg/stripe

Extension will take other PV's as well, making more than one stripe. 
The %FREE calculation is taken into account before considering number of stripes, and the stripes are then doubled to accomodate the stripe size request:

Before extension:

[root@virt-011 ~]# pvs 
  PV         VG         Fmt  Attr PSize  PFree 
  /dev/sda1  vg         lvm2 a--   9.99g  9.66g
  /dev/sdb1  vg         lvm2 a--   9.99g  9.66g
  /dev/sdc1  vg         lvm2 a--   9.99g  9.66g

After extension:

[root@virt-011 ~]# lvextend -i 1 -l100%FREE vg/stripe
  Extending logical volume stripe to 28.97 GiB
  Logical volume stripe successfully resized
[root@virt-011 ~]# pvs 
  PV         VG         Fmt  Attr PSize  PFree 
  /dev/sda1  vg         lvm2 a--   9.99g     0 
  /dev/sdb1  vg         lvm2 a--   9.99g     0 
  /dev/sdc1  vg         lvm2 a--   9.99g  1.01g


Should a lvextend with smaller number of stripes take the rest of PVs (creating more stripe 'copies' spread out accross PVs in LV)?
Comment 3 Alasdair Kergon 2013-10-14 18:30:36 EDT
OK - this seems to work correctly for me.

Try -l+100%FREE

Without the + it takes the amount of free space then uses that as the absolute size the final volume should be - so you are left with 1G (the original size) unused.

More examples in the man pages perhaps!

Note You need to log in before you can comment on or make changes to this bug.