* Question on Computing VG Capacity
[not found] <LV3PR21MB4252B491DCFB134F050577BEC12DA@LV3PR21MB4252.namprd21.prod.outlook.com>
@ 2025-08-06 21:49 ` Joshua Long
2025-08-07 17:46 ` David Teigland
0 siblings, 1 reply; 2+ messages in thread
From: Joshua Long @ 2025-08-06 21:49 UTC (permalink / raw)
To: linux-lvm@lists.linux.dev
Hi everyone,
I wanted to reach out with a question regarding how to compute the exact usable capacity of a volume group, based on the disks that will be used, without actually creating the VG or physical volumes.
Specifically, I am looking for a method or tool that can help me determine the capacity accurately beforehand.
For example, I have a VG with a single PV with a PE size of 4194304 B.
We have one disk with 1920383410176 B, which equals 457855.084 PE.
The capacity of the VG with this PV after creation is 1920378863616 B, equaling 457854 PE.
Is it always true that the total PEs in the VG will be the disk capacity divided by PE size, minus one? Or are there other factors or metadata overheads I should consider? Any guidance or suggestions would be greatly appreciated.
Thank you for your time and assistance!
Best regards,
Joshua Long
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question on Computing VG Capacity
2025-08-06 21:49 ` Question on Computing VG Capacity Joshua Long
@ 2025-08-07 17:46 ` David Teigland
0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2025-08-07 17:46 UTC (permalink / raw)
To: Joshua Long; +Cc: linux-lvm@lists.linux.dev
On Wed, Aug 06, 2025 at 09:49:53PM +0000, Joshua Long wrote:
> Hi everyone,
>
> I wanted to reach out with a question regarding how to compute the exact usable capacity of a volume group, based on the disks that will be used, without actually creating the VG or physical volumes.
>
> Specifically, I am looking for a method or tool that can help me determine the capacity accurately beforehand.
>
> For example, I have a VG with a single PV with a PE size of 4194304 B.
>
> We have one disk with 1920383410176 B, which equals 457855.084 PE.
>
> The capacity of the VG with this PV after creation is 1920378863616 B, equaling 457854 PE.
>
> Is it always true that the total PEs in the VG will be the disk capacity divided by PE size, minus one? Or are there other factors or metadata overheads I should consider? Any guidance or suggestions would be greatly appreciated.
Hi,
It would require some effort to track down all the factors in the code
that might come into play, so I can't immediately state a firm answer.
A few variables come to mind which might influence the result (basically
through attempts to align things nicely): the system's page size, the
device's minimum_io_size and optimal_io_size, and the device size being a
multiple of the extent size. The pvcreate man page explains some of this
under "Metadata location, size, and alignment". It also mentions command
options that you can use to control the end result. By using those
options, and rounding the device size, I expect you should be able to
predict the total PEs accurately.
Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-07 17:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <LV3PR21MB4252B491DCFB134F050577BEC12DA@LV3PR21MB4252.namprd21.prod.outlook.com>
2025-08-06 21:49 ` Question on Computing VG Capacity Joshua Long
2025-08-07 17:46 ` David Teigland
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).