[pve-devel] [PATCH installer 2/2] always align rootdisk size to 4 MiB

Fiona Ebner f.ebner at proxmox.com
Thu Jun 22 16:18:34 CEST 2023


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 at 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






More information about the pve-devel mailing list