]> git.proxmox.com Git - pve-installer.git/commitdiff
clear zpool labels on selected disks' partitions
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 2 Jul 2019 14:44:31 +0000 (16:44 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Jul 2019 04:28:54 +0000 (06:28 +0200)
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

index e6a29b3e86046bf4b054b9809ea3e14d814b6d58..5f4544a0ff7a598bd367cbb3e7e65977409208c3 100755 (executable)
@@ -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"); };
     }
 };