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 2/2] always align rootdisk size to 4 MiB
Date: Thu, 22 Jun 2023 16:18:34 +0200	[thread overview]
Message-ID: <20230622141834.57197-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230622141834.57197-1-f.ebner@proxmox.com>

While this was already done in the $rest < 48 GiB cases, it wasn't yet
done for the else branch and also not if $maxroot_mb was assigned,
because of being smaller.

Second and last 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 root LV (the one for metadata was
already handled in the previous commit).

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

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

I think it'd be possible to drop the alignments in the branches now,
but let's fix the issue for now and tackle improving/reworking the
logic more for later.

 Proxmox/Install.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index c2c014d..25031f8 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -435,6 +435,7 @@ sub create_lvm_volumes {
 
 	$rootsize_mb = $maxroot_mb if $rootsize_mb > $maxroot_mb;
 	$rootsize = int($rootsize_mb * 1024);
+	$rootsize &= ~0xFFF; # align down to 4 MB boundaries
 
 	$rest -= $rootsize; # in KB
 
-- 
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 [pve-devel] [PATCH installer 1/2] align metadatasize " Fiona Ebner
2023-06-22 14:18 ` Fiona Ebner [this message]
2023-06-22 14:29 ` [pve-devel] applied: " 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-2-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