From e1b490865f750e08f6c9c6b7e162e7def9dcc411 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Wed, 27 Nov 2019 17:06:59 +0100 Subject: [PATCH] use by-id paths for all vdevs on pool creation 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 --- 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.39.2