[pve-devel] [PATCH installer v2 5/6] wipe partitiontable after early exits
Stoiko Ivanov
s.ivanov at proxmox.com
Wed Nov 27 17:06:58 CET 2019
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 <s.ivanov at proxmox.com>
---
proxinstall | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
--
2.20.1
More information about the pve-devel
mailing list