]> git.proxmox.com Git - pve-installer.git/commitdiff
always align rootdisk size to 4 MiB
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 22 Jun 2023 14:18:34 +0000 (16:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Jun 2023 14:26:49 +0000 (16:26 +0200)
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>
Proxmox/Install.pm

index c2c014d83f926e4bf8d7703434f3f884426c457e..25031f8bb01acff3f07722977ce3c0acc2c30333 100644 (file)
@@ -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