public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer 1/2] align metadatasize to 4 MiB
Date: Thu, 22 Jun 2023 16:18:33 +0200	[thread overview]
Message-ID: <20230622141834.57197-1-f.ebner@proxmox.com> (raw)

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





             reply	other threads:[~2023-06-22 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 14:18 Fiona Ebner [this message]
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

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=20230622141834.57197-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal