All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Usable space in PV
@ 2015-09-30 15:28 Timofey Koolin
  2015-10-01 11:26 ` Zdenek Kabelac
  0 siblings, 1 reply; 3+ messages in thread
From: Timofey Koolin @ 2015-09-30 15:28 UTC (permalink / raw)
  To: linux-lvm

Task: calc usable space of PV before create PV and before create 
partition for PV.

In my experiments usable space in PV = PVSize / ExtentSize * ExtentSize 
with integer operations.
But when Metadata may be large - when LVM have a lot of logical volumes 
and it can take more space.

I found in /etc/lvm/lvm.conf parameter pvmetadatasize = 255 secotors 
(default).
What will if metadata will grow to more then 255 sectors?

-- 
Timofey Koolin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Usable space in PV
  2015-09-30 15:28 [linux-lvm] Usable space in PV Timofey Koolin
@ 2015-10-01 11:26 ` Zdenek Kabelac
  2015-10-01 16:10   ` Timofey Koolin
  0 siblings, 1 reply; 3+ messages in thread
From: Zdenek Kabelac @ 2015-10-01 11:26 UTC (permalink / raw)
  To: LVM general discussion and development

Dne 30.9.2015 v 17:28 Timofey Koolin napsal(a):
> Task: calc usable space of PV before create PV and before create partition for
> PV.
>
> In my experiments usable space in PV = PVSize / ExtentSize * ExtentSize with
> integer operations.
> But when Metadata may be large - when LVM have a lot of logical volumes and it
> can take more space.
>
> I found in /etc/lvm/lvm.conf parameter pvmetadatasize = 255 secotors (default).
> What will if metadata will grow to more then 255 sectors?
>


If you plan to host lots of LVs within a single VG (in range of hundreds)
use i.e. 'pvcreate --metadatasize 5M'
(i.e. ~7000 linear single segment LVs  takes around 2.2MB and you need space 
for at least 2 metadatas to fit in)

What I'm not quite sure is your 'task' - what's the purpose ?
Do you want to do some 'sector' precise emulation of what lvm2 is doing by 
watching resuls of couple command with just subset of it's options ?

Isn't better to read man pages ?

Zdenek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-lvm] Usable space in PV
  2015-10-01 11:26 ` Zdenek Kabelac
@ 2015-10-01 16:10   ` Timofey Koolin
  0 siblings, 0 replies; 3+ messages in thread
From: Timofey Koolin @ 2015-10-01 16:10 UTC (permalink / raw)
  To: LVM general discussion and development

Task - problem.
I make universal extender of filesystem (for example extend fs in 
virtual computer after resize disk or add space to filesystem in hosting 
server, etc.). Before extend volume group and filesystem I want to make 
plan of extends. For plan I need to know how many bytes it can add to VG 
from disk/partition. I know size of disk, partition, free space - and I 
have to know free space after create PV on free space of disk.
I don't know how many LV will be on target system (system, which run 
fsextender), I don't know fragmentation of it and etc.
Is any way to know how many space take metadata and how many space will 
be usable?

On 01.10.2015 14:26, Zdenek Kabelac wrote:
> Dne 30.9.2015 v 17:28 Timofey Koolin napsal(a):
>> Task: calc usable space of PV before create PV and before create 
>> partition for
>> PV.
>>
>> In my experiments usable space in PV = PVSize / ExtentSize * 
>> ExtentSize with
>> integer operations.
>> But when Metadata may be large - when LVM have a lot of logical 
>> volumes and it
>> can take more space.
>>
>> I found in /etc/lvm/lvm.conf parameter pvmetadatasize = 255 secotors 
>> (default).
>> What will if metadata will grow to more then 255 sectors?
>>
>
>
> If you plan to host lots of LVs within a single VG (in range of hundreds)
> use i.e. 'pvcreate --metadatasize 5M'
> (i.e. ~7000 linear single segment LVs  takes around 2.2MB and you need 
> space for at least 2 metadatas to fit in)
>
> What I'm not quite sure is your 'task' - what's the purpose ?
> Do you want to do some 'sector' precise emulation of what lvm2 is 
> doing by watching resuls of couple command with just subset of it's 
> options ?
>
> Isn't better to read man pages ?
>
> Zdenek
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

-- 
Timofey Koolin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-01 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 15:28 [linux-lvm] Usable space in PV Timofey Koolin
2015-10-01 11:26 ` Zdenek Kabelac
2015-10-01 16:10   ` Timofey Koolin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.