]> git.proxmox.com Git - pve-installer.git/commitdiff
fix space calculation for small disks for pve product
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 22 Jun 2023 13:57:13 +0000 (15:57 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Jun 2023 14:26:49 +0000 (16:26 +0200)
The convoluted calculation logic in case the disks is 8GB leads to
datasize becoming 16EiB further down:
* after calculating and removing the rootsize from $rest, $rest becomes
  smaller than $space (which should be the minimal non-used space in the
  volume-group) - this leads to a negative value, which overflows in
  the `& ~0xFFF` opration.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Proxmox/Install.pm

index 25031f8bb01acff3f07722977ce3c0acc2c30333..f115fbdba1bb040948ccedaa3e6f79313ea99d23 100644 (file)
@@ -425,7 +425,7 @@ sub create_lvm_volumes {
        my $rootsize_mb;
        if ($rest_mb < 12 * 1024) {
            # no point in wasting space, try to get us actually installed and align down to 4 MB
-           $rootsize_mb = ($rest_mb - 0.1) & ~3;
+           $rootsize_mb = ($rest_mb - 4) & ~3;
        } elsif ($rest_mb < 48 * 1024) {
            my $masked = int($rest_mb / 2) & ~3; # align down to 4 MB
            $rootsize_mb = $masked;