[pve-devel] [PATCH installer v2 6/6] use by-id paths for all vdevs on pool creation

Stoiko Ivanov s.ivanov at proxmox.com
Wed Nov 27 17:06:59 CET 2019


currently only the first vdev of a ZFS rpool gets created with the stable
/dev/by-id paths, all later vdevs (in a RAID0 or RAID10 setup) are left as
sdX.

By iterating over all disks in the pool and replacing their occurence with
their by-id path we get consistent and recommended names for all vdevs.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 proxinstall | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/proxinstall b/proxinstall
index 7873ace..b531619 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1354,6 +1354,13 @@ sub extract_data {
 		$vdev =~ s/ $devname/ $osdev/;
 	    }
 
+	    foreach my $hd (@$devlist) {
+		my $devname = @$hd[1];
+		my $by_id = find_stable_path ("/dev/disk/by-id", $devname);
+
+		$vdev =~ s/ $devname/ $by_id/;
+	    }
+
 	    zfs_create_rpool($vdev);
 
 	} else {
-- 
2.20.1





More information about the pve-devel mailing list