Bug 1017133 - Allocation issues when extending stripes with lower stripe number and using 100%FREE argument
Summary: Allocation issues when extending stripes with lower stripe number and using 1...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Alasdair Kergon
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-09 09:58 UTC by Nenad Peric
Modified: 2013-10-14 22:35 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-14 22:35:23 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Nenad Peric 2013-10-09 09:58:32 UTC
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 22:30:36 UTC
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.