[pve-devel] [PATCH installer 1/2] clear zpool labels on selected disks' partitions

Stoiko Ivanov s.ivanov at proxmox.com
Tue Jul 2 16:44:31 CEST 2019


along with `pvremove -ff` and writing zeroes to the first 16M of all
partitions, which belong to disks selected in the installer run `zpool
labelclear`.

This prevents a failure to boot after installation, if the disks were
previously also used as a zpool called rpool, but in a different configuration
(e.g. installing a raidzX first and then changing to raid10).
---
 proxinstall | 1 +
 1 file changed, 1 insertion(+)

diff --git a/proxinstall b/proxinstall
index e6a29b3..5f4544a 100755
--- a/proxinstall
+++ b/proxinstall
@@ -900,6 +900,7 @@ my $clean_disk = sub {
 	next if $part eq $disk;
 	next if $part !~ /^\Q$disk\E/;
 	eval { syscmd("pvremove -ff -y $part"); };
+	eval { syscmd("zpool labelclear -f $part"); };
 	eval { syscmd("dd if=/dev/zero of=$part bs=1M count=16"); };
     }
 };
-- 
2.20.1





More information about the pve-devel mailing list