[linux-lvm] is it right to specify '-l' with all the free PE in VG when creating a thin pool?
zkabelac at redhat.com
Fri Mar 10 09:07:06 UTC 2017
Dne 10.3.2017 v 02:39 Eric Ren napsal(a):
> On 03/09/2017 07:46 PM, Zdenek Kabelac wrote:
>>> while it works when specifying '-l' this way:
>>> # lvcreate -l 100%FREE --thinpool thinpool0 vgtest
>>> Logical volume "thinpool0" created.
>>> Is this something by design? or something may be wrong?
>>> I can replicate this on both:
>> Yes this is by DESIGN
>> When you specify '-l|-L' you specify size of 'dataLV' (logical size)
>> But then you need some more space for 'metadata' LVs (_tmeta & _pmspare)
>> -l100%FREE figure this automagically and reduces size a bit to fit in
>> metadata LV.
>> Some 'future' version of lvm2 may support something like '--physicalsize'
>> which will be 'a total size used for every allocation made by command).
> Hi Zdenek,
> Thanks a lot for your clarification!
> Looks some changes to thin-pool feature make it behave differently since a
> certain version.
> It worked on lvm2-2.02.98 (sles12) by specifying '-l' with all the free PE.
> Anyway, '-l 100%FREE'
> looks more reasonable in such case:)
Well I'm pretty much sure it has never ever had different logic for this
allocation (yep it's been me doing this and there is also large regression
test suite running behind all the time...)) - you could have get success only
by having some 'spare room' on different PV.
But as already mentioned you are not the only one who would like to have
control over 'total allocated size' so there is already a BZ about this and
something will be implemented - thought it's not as easy as it may sound...
(-l100%FREE is quite a cheating piece of code ;))
More information about the linux-lvm