public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH installer 1/2] align metadatasize to 4 MiB
@ 2023-06-22 14:18 Fiona Ebner
  2023-06-22 14:18 ` [pve-devel] [PATCH installer 2/2] always align rootdisk size " Fiona Ebner
  2023-06-22 14:29 ` [pve-devel] applied: [PATCH installer 1/2] align metadatasize " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2023-06-22 14:18 UTC (permalink / raw)
  To: pve-devel

First step towards fixing an issue reported in the community forum [0]
where using 250.00 hdsize, 250 maxroot and 0 minfree would fail.

Turns out two extents would be missing because of lvcreate implicitly
rounding up, one of them for the metadata.

[0]: https://forum.proxmox.com/threads/129320/post-566375

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 Proxmox/Install.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index 7970f83..c2c014d 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -469,9 +469,10 @@ sub create_lvm_volumes {
 	die "unable to create root volume\n";
 
     if ($datasize > 4 * 1024 * 1024) {
-	my $metadatasize = $datasize/100; # default 1% of data
+	my $metadatasize = int($datasize/100); # default 1% of data
 	$metadatasize = 1024*1024 if $metadatasize < 1024*1024; # but at least 1G
 	$metadatasize = 16*1024*1024 if $metadatasize > 16*1024*1024; # but at most 16G
+	$metadatasize &= ~0xFFF; # align down to 4 MB boundaries
 
 	# otherwise the metadata is taken out of $minfree
 	$datasize -= 2 * $metadatasize;
-- 
2.39.2





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

end of thread, other threads:[~2023-06-22 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-22 14:18 [pve-devel] [PATCH installer 1/2] align metadatasize to 4 MiB Fiona Ebner
2023-06-22 14:18 ` [pve-devel] [PATCH installer 2/2] always align rootdisk size " Fiona Ebner
2023-06-22 14:29 ` [pve-devel] applied: [PATCH installer 1/2] align metadatasize " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal