From: Stoiko Ivanov Date: Wed, 27 Nov 2019 16:06:58 +0000 (+0100) Subject: wipe partitiontable after early exits X-Git-Url: https://git.proxmox.com/?p=pve-installer.git;a=commitdiff_plain;h=34e44994194ce62fa8719e249bf16785628e44ec wipe partitiontable after early exits by wiping the partition table after the initial sanity checks regarding minimal size and blocksize of the device, no data is destroyed for an install that would fail in any case. Signed-off-by: Stoiko Ivanov --- diff --git a/proxinstall b/proxinstall index f8bef52..7873ace 100755 --- a/proxinstall +++ b/proxinstall @@ -937,7 +937,6 @@ sub partition_bootable_disk { die "unknown partition type '$ptype'" if !($ptype eq '8E00' || $ptype eq '8300' || $ptype eq 'BF01'); - syscmd("sgdisk -Z ${target_dev}"); my $hdsize = hd_size($target_dev); # size in KB (1024 bytes) my $restricted_hdsize_mb = 0; # 0 ==> end of partition @@ -952,6 +951,8 @@ sub partition_bootable_disk { my $hdgb = int($hdsize/(1024*1024)); die "hardisk '$target_dev' too small (${hdgb}GB)\n" if $hdgb < 8; + syscmd("sgdisk -Z ${target_dev}"); + # 1 - BIOS boot partition (Grub Stage2): first free 1M # 2 - EFI ESP: next free 512M # 3 - OS/Data partition: rest, up to $maxhdsize in MB