linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: Tilman Vogel <tilman.vogel@gmail.com>, linux-lvm@lists.linux.dev
Subject: Re: pvresize after pvcreate changes PV size: expected?
Date: Mon, 13 Jan 2025 14:46:53 +0100	[thread overview]
Message-ID: <47cbadf5-fa07-4e9d-8bd2-9cf969777f4e@gmail.com> (raw)
In-Reply-To: <CAAbQbbCN-=DDSerkOoKHCHxwA9gu32HvsCezOHU4NhR0cByKpA@mail.gmail.com>

Dne 11. 01. 25 v 23:21 Tilman Vogel napsal(a):
> Hi!
> 
> I just encountered the following and do not understand it. The confusing part 
> is that when I run pvresize without size parameter directly after pvcreate, 
> the size still seems to change even though pvcreate of course also uses the 
> underlying device size just as pvresize should.
> 
> I am attaching the test.sh for your reference.
> 
> What am I missing?
> 

Hi

You are missing that the actual size of usable count of PV extents  is not 
changed by a single bit.

The surrounding accounting changes with the lvm2 metadata content size accounting.

For a user of a PV it's important there is 24 free extents of 4MiB each in 
this case and this gives a usable size for LVs.

Rest is either unused alignment space or space dedicated to PV header & lvm2 
metadata.  This space is accounted a  bit differently when you create a new PV
or you work with already existing PV with already existing lvm2 metadata area.
Yeah - it might be possibly 'addressed' better and PV could be readjusted 
after initial create - but it's not a bug - so it avoids 'extra' clutering
of PV header space when it's not really necessary  (as unlike lvm2 metadata, 
PV header space is not using any backups - so the less it's touched, the 
better....)

Regards

Zdenek


PS: for small PV sizes like in this case - using smaller  extent size  (i.e. 
256K, and reducing metadata size to i.e. 192K) may  'boost' usable  space for LVs.


  reply	other threads:[~2025-01-13 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-11 22:21 pvresize after pvcreate changes PV size: expected? Tilman Vogel
2025-01-13 13:46 ` Zdenek Kabelac [this message]
     [not found]   ` <CAAbQbbDGW=Q-NBVdgKqt272VYdYdd_i7Cr8qPLJiS2moSjQMAg@mail.gmail.com>
2025-01-13 16:20     ` Fwd: " Tilman Vogel
2025-01-13 17:43       ` Stuart D Gathman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47cbadf5-fa07-4e9d-8bd2-9cf969777f4e@gmail.com \
    --to=zdenek.kabelac@gmail.com \
    --cc=linux-lvm@lists.linux.dev \
    --cc=tilman.vogel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).