]> git.proxmox.com Git - pve-installer.git/commitdiff
lvm create: leave 4 MB space unallocated space for small disks too
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Nov 2022 06:15:11 +0000 (07:15 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 29 Nov 2022 06:18:02 +0000 (07:18 +0100)
Leave 4MiB of space left over to avoid aligning issues in some edge
cases

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxinstall

index 980c0fc980c7e95ee43b8b1402cea8091fc5c52f..832d7968ef8342bdeeb2a8647fdfd1c445194e1b 100755 (executable)
@@ -1105,8 +1105,10 @@ sub create_lvm_volumes {
        die "unable to create volume group '$vgname'\n";
 
     my $hdgb = int($os_size / (1024 * 1024));
-    # FIXME: drop odd by-default unallocated space?
-    my $space = $hdgb <= 32 ? 0 : (($hdgb > 128 ? 16 : $hdgb / 8) * 1024 * 1024);
+
+    # always leave some space at the end to avoid roudning issues with LVM's physical extent (PE)
+    # size of 4 MB.
+    my $space = $hdgb <= 32 ? 4 * 1024 : (($hdgb > 128 ? 16 : $hdgb / 8) * 1024 * 1024);
 
     my $rootsize;
     my $datasize = 0;