From 5bf14d3400191ea949fdadd2ecbd47ed4566dfda Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 21 Oct 2009 11:38:51 -0700 Subject: [PATCH 1/2] Update zpool-configs to be udev aware. To simplify creation and management of test configurations the dragon and x4550 configureis have been integrated with udev. Our current best guess as to how we'll actually manage the disks in these systems is with a udev mapping scheme. The current leading scheme is to map each drive to a simpe id. In this mapping each CHANNEL is represented by the letters a-z, and the RANK is represented by the numbers 1-n. A CHANNEL should identify a group of RANKS which are all attached to a single controller, each RANK represents a disk. This provides a nice mechanism to locate a specific drive given a known hardware configuration. Various hardware vendors use a similar scheme. A nice side effect of these changes is it allowed me to make the raid0/raid10/raidz/raidz2 setup functions generic. This makes adding new test configs easy, you just need to create a udev rules file for your test config which conforms to the naming scheme. --- config/zfs-build.m4 | 1 + scripts/common.sh | 121 +++++++- scripts/udev-rules/99-zpool.rules.dragon | 331 +++++++++++++++++++++ scripts/udev-rules/99-zpool.rules.x4550 | 115 +++++++ scripts/zpool-config/dragon-raid0-1x120.sh | 26 -- scripts/zpool-config/dragon-raid0-1x70.sh | 20 ++ scripts/zpool-config/dragon-raid10-35x2.sh | 20 ++ scripts/zpool-config/dragon-raidz-15x8.sh | 46 --- scripts/zpool-config/dragon-raidz-7x10.sh | 20 ++ scripts/zpool-config/dragon-raidz2-15x8.sh | 46 --- scripts/zpool-config/dragon-raidz2-7x10.sh | 20 ++ scripts/zpool-config/file-raid0.sh | 4 +- scripts/zpool-config/file-raid10.sh | 4 +- scripts/zpool-config/file-raidz.sh | 4 +- scripts/zpool-config/file-raidz2.sh | 4 +- scripts/zpool-config/hda-raid0.sh | 4 +- scripts/zpool-config/lo-raid0.sh | 4 +- scripts/zpool-config/lo-raid10.sh | 4 +- scripts/zpool-config/lo-raidz.sh | 4 +- scripts/zpool-config/lo-raidz2.sh | 4 +- scripts/zpool-config/sda-raid0.sh | 4 +- scripts/zpool-config/x4550-raid0-1x48.sh | 20 ++ scripts/zpool-config/x4550-raid0.sh | 26 -- scripts/zpool-config/x4550-raid10-24x2.sh | 20 ++ scripts/zpool-config/x4550-raid10-2x24.sh | 53 ---- scripts/zpool-config/x4550-raid10-3x16.sh | 46 --- scripts/zpool-config/x4550-raid10-6x8.sh | 39 --- scripts/zpool-config/x4550-raidz-12x4.sh | 43 --- scripts/zpool-config/x4550-raidz-6x8.sh | 43 --- scripts/zpool-config/x4550-raidz-8x6.sh | 20 ++ scripts/zpool-config/x4550-raidz2-12x4.sh | 43 --- scripts/zpool-config/x4550-raidz2-6x8.sh | 43 --- scripts/zpool-config/x4550-raidz2-8x6.sh | 20 ++ scripts/zpool-create.sh | 8 +- 34 files changed, 751 insertions(+), 479 deletions(-) create mode 100644 scripts/udev-rules/99-zpool.rules.dragon create mode 100644 scripts/udev-rules/99-zpool.rules.x4550 delete mode 100644 scripts/zpool-config/dragon-raid0-1x120.sh create mode 100644 scripts/zpool-config/dragon-raid0-1x70.sh create mode 100644 scripts/zpool-config/dragon-raid10-35x2.sh delete mode 100644 scripts/zpool-config/dragon-raidz-15x8.sh create mode 100644 scripts/zpool-config/dragon-raidz-7x10.sh delete mode 100644 scripts/zpool-config/dragon-raidz2-15x8.sh create mode 100644 scripts/zpool-config/dragon-raidz2-7x10.sh create mode 100644 scripts/zpool-config/x4550-raid0-1x48.sh delete mode 100644 scripts/zpool-config/x4550-raid0.sh create mode 100644 scripts/zpool-config/x4550-raid10-24x2.sh delete mode 100644 scripts/zpool-config/x4550-raid10-2x24.sh delete mode 100644 scripts/zpool-config/x4550-raid10-3x16.sh delete mode 100644 scripts/zpool-config/x4550-raid10-6x8.sh delete mode 100644 scripts/zpool-config/x4550-raidz-12x4.sh delete mode 100644 scripts/zpool-config/x4550-raidz-6x8.sh create mode 100644 scripts/zpool-config/x4550-raidz-8x6.sh delete mode 100644 scripts/zpool-config/x4550-raidz2-12x4.sh delete mode 100644 scripts/zpool-config/x4550-raidz2-6x8.sh create mode 100644 scripts/zpool-config/x4550-raidz2-8x6.sh diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index f8ae21eeee..ccfd2eda22 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -52,6 +52,7 @@ LIBDIR=${LIBDIR} CMDDIR=${CMDDIR} MODDIR=${MODDIR} SCRIPTDIR=${SCRIPTDIR} +UDEVDIR=\${TOPDIR}/scripts/udev-rules ZPOOLDIR=\${TOPDIR}/scripts/zpool-config ZDB=\${CMDDIR}/zdb/zdb diff --git a/scripts/common.sh b/scripts/common.sh index 9548a97b10..a5cfb53804 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -15,9 +15,17 @@ fi PROG="" VERBOSE= VERBOSE_FLAG= +FORCE= +FORCE_FLAG= DUMP_LOG= ERROR= +UPATH="/dev/disk/zpool" +RAID0S=() +RAID10S=() +RAIDZS=() +RAIDZ2S=() +UDEVDIR=${UDEVDIR:-/usr/libexec/zfs/udev-rules} ZPOOLDIR=${ZPOOLDIR:-/usr/libexec/zfs/zpool-config} ZDB=${ZDB:-/usr/sbin/zdb} @@ -58,12 +66,12 @@ fail() { } spl_dump_log() { - ${SYSCTL} -w kernel.spl.debug.dump=1 &>/dev/null + ${SYSCTL} -w kernel.spl.debug.dump=1 &>/dev/null local NAME=`dmesg | tail -n 1 | cut -f5 -d' '` - ${SPLBUILD}/cmd/spl ${NAME} >${NAME}.log + ${SPLBUILD}/cmd/spl ${NAME} >${NAME}.log echo - echo "Dumped debug log: ${NAME}.log" - tail -n1 ${NAME}.log + echo "Dumped debug log: ${NAME}.log" + tail -n1 ${NAME}.log echo return 0 } @@ -184,3 +192,108 @@ unused_loop_device() { die "Error: Unable to find unused loopback device" } + +# +# The following udev helper functions assume that the provided +# udev rules file will create a /dev/disk/zpool/ +# disk mapping. In this mapping each CHANNEL is represented by +# the letters a-z, and the RANK is represented by the numbers +# 1-n. A CHANNEL should identify a group of RANKS which are all +# attached to a single controller, each RANK represents a disk. +# This provides a simply mechanism to locate a specific drive +# given a known hardware configuration. +# +udev_setup() { + local SRC_PATH=$1 + local DST_FILE=`basename ${SRC_PATH} | cut -f1-2 -d'.'` + local DST_PATH=/etc/udev/rules.d/${DST_FILE} + + cp -f ${SRC_PATH} ${DST_PATH} + + udevadm trigger + udevadm settle + + return 0 +} + +udev_cr2d() { + local CHANNEL=`echo "obase=16; $1+96" | bc` + local RANK=$2 + + printf "\x${CHANNEL}${RANK}" +} + +udev_raid0_setup() { + local RANKS=$1 + local CHANNELS=$2 + local IDX=0 + + RAID0S=() + for RANK in `seq 1 ${RANKS}`; do + for CHANNEL in `seq 1 ${CHANNELS}`; do + DISK=`udev_cr2d ${CHANNEL} ${RANK}` + RAID0S[${IDX}]="${UPATH}/${DISK}" + let IDX=IDX+1 + done + done + + return 0 +} + +udev_raid10_setup() { + local RANKS=$1 + local CHANNELS=$2 + local IDX=0 + + RAID10S=() + for RANK in `seq 1 ${RANKS}`; do + for CHANNEL1 in `seq 1 2 ${CHANNELS}`; do + let CHANNEL2=CHANNEL1+1 + DISK1=`udev_cr2d ${CHANNEL1} ${RANK}` + DISK2=`udev_cr2d ${CHANNEL2} ${RANK}` + GROUP="${UPATH}/${DISK1} ${UPATH}/${DISK2}" + RAID10S[${IDX}]="mirror ${GROUP}" + let IDX=IDX+1 + done + done + + return 0 +} + +udev_raidz_setup() { + local RANKS=$1 + local CHANNELS=$2 + + RAIDZS=() + for RANK in `seq 1 ${RANKS}`; do + RAIDZ=("raidz") + + for CHANNEL in `seq 1 ${CHANNELS}`; do + DISK=`udev_cr2d ${CHANNEL} ${RANK}` + RAIDZ[${CHANNEL}]="${UPATH}/${DISK}" + done + + RAIDZS[${RANK}]="${RAIDZ[*]}" + done + + return 0 +} + +udev_raidz2_setup() { + local RANKS=$1 + local CHANNELS=$2 + + RAIDZ2S=() + for RANK in `seq 1 ${RANKS}`; do + RAIDZ2=("raidz2") + + for CHANNEL in `seq 1 ${CHANNELS}`; do + DISK=`udev_cr2d ${CHANNEL} ${RANK}` + RAIDZ2[${CHANNEL}]="${UPATH}/${DISK}" + done + + RAIDZ2S[${RANK}]="${RAIDZ2[*]}" + done + + return 0 +} diff --git a/scripts/udev-rules/99-zpool.rules.dragon b/scripts/udev-rules/99-zpool.rules.dragon new file mode 100644 index 0000000000..7c589f595f --- /dev/null +++ b/scripts/udev-rules/99-zpool.rules.dragon @@ -0,0 +1,331 @@ +# +# /etc/udev/rules.d/99-zpool.rules +# + +ENV{DEVTYPE}=="disk", IMPORT{program}="path_id %p" + +# Full devices (*:pci*port:*:id*) +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:3*", SYMLINK+="disk/zpool/a1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:4*", SYMLINK+="disk/zpool/a2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:5*", SYMLINK+="disk/zpool/a3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:6*", SYMLINK+="disk/zpool/a4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:7*", SYMLINK+="disk/zpool/a5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:8*", SYMLINK+="disk/zpool/a6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:9*", SYMLINK+="disk/zpool/a7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:10*", SYMLINK+="disk/zpool/a8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:11*", SYMLINK+="disk/zpool/a9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:12*", SYMLINK+="disk/zpool/a10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:13*", SYMLINK+="disk/zpool/a11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:14*", SYMLINK+="disk/zpool/a12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:15*", SYMLINK+="disk/zpool/a13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:16*", SYMLINK+="disk/zpool/a14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:17*", SYMLINK+="disk/zpool/a15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:3*", SYMLINK+="disk/zpool/b1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:4*", SYMLINK+="disk/zpool/b2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:5*", SYMLINK+="disk/zpool/b3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:6*", SYMLINK+="disk/zpool/b4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:7*", SYMLINK+="disk/zpool/b5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:8*", SYMLINK+="disk/zpool/b6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:9*", SYMLINK+="disk/zpool/b7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:10*", SYMLINK+="disk/zpool/b8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:11*", SYMLINK+="disk/zpool/b9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:12*", SYMLINK+="disk/zpool/b10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:13*", SYMLINK+="disk/zpool/b11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:14*", SYMLINK+="disk/zpool/b12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:15*", SYMLINK+="disk/zpool/b13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:16*", SYMLINK+="disk/zpool/b14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*4:*:17*", SYMLINK+="disk/zpool/b15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:3*", SYMLINK+="disk/zpool/c1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:4*", SYMLINK+="disk/zpool/c2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:5*", SYMLINK+="disk/zpool/c3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:6*", SYMLINK+="disk/zpool/c4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:7*", SYMLINK+="disk/zpool/c5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:8*", SYMLINK+="disk/zpool/c6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:9*", SYMLINK+="disk/zpool/c7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:10*", SYMLINK+="disk/zpool/c8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:11*", SYMLINK+="disk/zpool/c9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:12*", SYMLINK+="disk/zpool/c10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:13*", SYMLINK+="disk/zpool/c11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:14*", SYMLINK+="disk/zpool/c12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:15*", SYMLINK+="disk/zpool/c13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:16*", SYMLINK+="disk/zpool/c14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:17*", SYMLINK+="disk/zpool/c15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:3*", SYMLINK+="disk/zpool/d1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:4*", SYMLINK+="disk/zpool/d2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:5*", SYMLINK+="disk/zpool/d3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:6*", SYMLINK+="disk/zpool/d4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:7*", SYMLINK+="disk/zpool/d5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:8*", SYMLINK+="disk/zpool/d6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:9*", SYMLINK+="disk/zpool/d7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:10*", SYMLINK+="disk/zpool/d8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:11*", SYMLINK+="disk/zpool/d9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:12*", SYMLINK+="disk/zpool/d10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:13*", SYMLINK+="disk/zpool/d11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:14*", SYMLINK+="disk/zpool/d12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:15*", SYMLINK+="disk/zpool/d13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:16*", SYMLINK+="disk/zpool/d14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*4:*:17*", SYMLINK+="disk/zpool/d15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:3*", SYMLINK+="disk/zpool/e1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:4*", SYMLINK+="disk/zpool/e2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:5*", SYMLINK+="disk/zpool/e3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:6*", SYMLINK+="disk/zpool/e4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:7*", SYMLINK+="disk/zpool/e5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:8*", SYMLINK+="disk/zpool/e6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:9*", SYMLINK+="disk/zpool/e7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:10*", SYMLINK+="disk/zpool/e8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:11*", SYMLINK+="disk/zpool/e9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:12*", SYMLINK+="disk/zpool/e10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:13*", SYMLINK+="disk/zpool/e11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:14*", SYMLINK+="disk/zpool/e12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:15*", SYMLINK+="disk/zpool/e13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:16*", SYMLINK+="disk/zpool/e14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*0:*:17*", SYMLINK+="disk/zpool/e15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:3*", SYMLINK+="disk/zpool/f1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:4*", SYMLINK+="disk/zpool/f2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:5*", SYMLINK+="disk/zpool/f3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:6*", SYMLINK+="disk/zpool/f4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:7*", SYMLINK+="disk/zpool/f5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:8*", SYMLINK+="disk/zpool/f6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:9*", SYMLINK+="disk/zpool/f7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:10*", SYMLINK+="disk/zpool/f8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:11*", SYMLINK+="disk/zpool/f9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:12*", SYMLINK+="disk/zpool/f10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:13*", SYMLINK+="disk/zpool/f11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:14*", SYMLINK+="disk/zpool/f12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:15*", SYMLINK+="disk/zpool/f13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:16*", SYMLINK+="disk/zpool/f14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:84:00.0*4:*:17*", SYMLINK+="disk/zpool/f15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:3*", SYMLINK+="disk/zpool/g1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:4*", SYMLINK+="disk/zpool/g2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:5*", SYMLINK+="disk/zpool/g3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:6*", SYMLINK+="disk/zpool/g4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:7*", SYMLINK+="disk/zpool/g5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:8*", SYMLINK+="disk/zpool/g6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:9*", SYMLINK+="disk/zpool/g7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:10*", SYMLINK+="disk/zpool/g8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:11*", SYMLINK+="disk/zpool/g9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:12*", SYMLINK+="disk/zpool/g10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:13*", SYMLINK+="disk/zpool/g11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:14*", SYMLINK+="disk/zpool/g12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:15*", SYMLINK+="disk/zpool/g13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:16*", SYMLINK+="disk/zpool/g14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*0:*:17*", SYMLINK+="disk/zpool/g15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:3*", SYMLINK+="disk/zpool/h1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:4*", SYMLINK+="disk/zpool/h2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:5*", SYMLINK+="disk/zpool/h3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:6*", SYMLINK+="disk/zpool/h4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:7*", SYMLINK+="disk/zpool/h5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:8*", SYMLINK+="disk/zpool/h6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:9*", SYMLINK+="disk/zpool/h7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:10*", SYMLINK+="disk/zpool/h8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:11*", SYMLINK+="disk/zpool/h9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:12*", SYMLINK+="disk/zpool/h10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:13*", SYMLINK+="disk/zpool/h11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:14*", SYMLINK+="disk/zpool/h12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:15*", SYMLINK+="disk/zpool/h13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:16*", SYMLINK+="disk/zpool/h14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:85:00.0*4:*:17*", SYMLINK+="disk/zpool/h15" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:0*", SYMLINK+="disk/zpool/i1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:1*", SYMLINK+="disk/zpool/i2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:2*", SYMLINK+="disk/zpool/i3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:3*", SYMLINK+="disk/zpool/i4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:4*", SYMLINK+="disk/zpool/i5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:5*", SYMLINK+="disk/zpool/i6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:6*", SYMLINK+="disk/zpool/i7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:7*", SYMLINK+="disk/zpool/i8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:8*", SYMLINK+="disk/zpool/i9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:9*", SYMLINK+="disk/zpool/i10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:10*", SYMLINK+="disk/zpool/i11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:11*", SYMLINK+="disk/zpool/i12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:12*", SYMLINK+="disk/zpool/i13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:13*", SYMLINK+="disk/zpool/i14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:14*", SYMLINK+="disk/zpool/i15" +#ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*0:*:15*", SYMLINK+="disk/zpool/i16" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:0*", SYMLINK+="disk/zpool/j1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:1*", SYMLINK+="disk/zpool/j2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:2*", SYMLINK+="disk/zpool/j3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:3*", SYMLINK+="disk/zpool/j4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:4*", SYMLINK+="disk/zpool/j5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:5*", SYMLINK+="disk/zpool/j6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:6*", SYMLINK+="disk/zpool/j7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:7*", SYMLINK+="disk/zpool/j8" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:8*", SYMLINK+="disk/zpool/j9" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:9*", SYMLINK+="disk/zpool/j10" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:10*", SYMLINK+="disk/zpool/j11" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:11*", SYMLINK+="disk/zpool/j12" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:12*", SYMLINK+="disk/zpool/j13" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:13*", SYMLINK+="disk/zpool/j14" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:14*", SYMLINK+="disk/zpool/j15" +#ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:83:00.0*4:*:15*", SYMLINK+="disk/zpool/j16" + +# Partitions (*:pci*port:*:id*) +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:3*", SYMLINK+="disk/zpool/a1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:4*", SYMLINK+="disk/zpool/a2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:5*", SYMLINK+="disk/zpool/a3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:6*", SYMLINK+="disk/zpool/a4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:7*", SYMLINK+="disk/zpool/a5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:8*", SYMLINK+="disk/zpool/a6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:9*", SYMLINK+="disk/zpool/a7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:10*", SYMLINK+="disk/zpool/a8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:11*", SYMLINK+="disk/zpool/a9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:12*", SYMLINK+="disk/zpool/a10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:13*", SYMLINK+="disk/zpool/a11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:14*", SYMLINK+="disk/zpool/a12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:15*", SYMLINK+="disk/zpool/a13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:16*", SYMLINK+="disk/zpool/a14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:17*", SYMLINK+="disk/zpool/a15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:3*", SYMLINK+="disk/zpool/b1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:4*", SYMLINK+="disk/zpool/b2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:5*", SYMLINK+="disk/zpool/b3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:6*", SYMLINK+="disk/zpool/b4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:7*", SYMLINK+="disk/zpool/b5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:8*", SYMLINK+="disk/zpool/b6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:9*", SYMLINK+="disk/zpool/b7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:10*", SYMLINK+="disk/zpool/b8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:11*", SYMLINK+="disk/zpool/b9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:12*", SYMLINK+="disk/zpool/b10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:13*", SYMLINK+="disk/zpool/b11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:14*", SYMLINK+="disk/zpool/b12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:15*", SYMLINK+="disk/zpool/b13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:16*", SYMLINK+="disk/zpool/b14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*4:*:17*", SYMLINK+="disk/zpool/b15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:3*", SYMLINK+="disk/zpool/c1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:4*", SYMLINK+="disk/zpool/c2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:5*", SYMLINK+="disk/zpool/c3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:6*", SYMLINK+="disk/zpool/c4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:7*", SYMLINK+="disk/zpool/c5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:8*", SYMLINK+="disk/zpool/c6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:9*", SYMLINK+="disk/zpool/c7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:10*", SYMLINK+="disk/zpool/c8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:11*", SYMLINK+="disk/zpool/c9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:12*", SYMLINK+="disk/zpool/c10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:13*", SYMLINK+="disk/zpool/c11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:14*", SYMLINK+="disk/zpool/c12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:15*", SYMLINK+="disk/zpool/c13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:16*", SYMLINK+="disk/zpool/c14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:17*", SYMLINK+="disk/zpool/c15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:3*", SYMLINK+="disk/zpool/d1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:4*", SYMLINK+="disk/zpool/d2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:5*", SYMLINK+="disk/zpool/d3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:6*", SYMLINK+="disk/zpool/d4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:7*", SYMLINK+="disk/zpool/d5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:8*", SYMLINK+="disk/zpool/d6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:9*", SYMLINK+="disk/zpool/d7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:10*", SYMLINK+="disk/zpool/d8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:11*", SYMLINK+="disk/zpool/d9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:12*", SYMLINK+="disk/zpool/d10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:13*", SYMLINK+="disk/zpool/d11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:14*", SYMLINK+="disk/zpool/d12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:15*", SYMLINK+="disk/zpool/d13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:16*", SYMLINK+="disk/zpool/d14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*4:*:17*", SYMLINK+="disk/zpool/d15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:3*", SYMLINK+="disk/zpool/e1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:4*", SYMLINK+="disk/zpool/e2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:5*", SYMLINK+="disk/zpool/e3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:6*", SYMLINK+="disk/zpool/e4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:7*", SYMLINK+="disk/zpool/e5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:8*", SYMLINK+="disk/zpool/e6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:9*", SYMLINK+="disk/zpool/e7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:10*", SYMLINK+="disk/zpool/e8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:11*", SYMLINK+="disk/zpool/e9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:12*", SYMLINK+="disk/zpool/e10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:13*", SYMLINK+="disk/zpool/e11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:14*", SYMLINK+="disk/zpool/e12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:15*", SYMLINK+="disk/zpool/e13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:16*", SYMLINK+="disk/zpool/e14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*0:*:17*", SYMLINK+="disk/zpool/e15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:3*", SYMLINK+="disk/zpool/f1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:4*", SYMLINK+="disk/zpool/f2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:5*", SYMLINK+="disk/zpool/f3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:6*", SYMLINK+="disk/zpool/f4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:7*", SYMLINK+="disk/zpool/f5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:8*", SYMLINK+="disk/zpool/f6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:9*", SYMLINK+="disk/zpool/f7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:10*", SYMLINK+="disk/zpool/f8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:11*", SYMLINK+="disk/zpool/f9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:12*", SYMLINK+="disk/zpool/f10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:13*", SYMLINK+="disk/zpool/f11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:14*", SYMLINK+="disk/zpool/f12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:15*", SYMLINK+="disk/zpool/f13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:16*", SYMLINK+="disk/zpool/f14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:84:00.0*4:*:17*", SYMLINK+="disk/zpool/f15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:3*", SYMLINK+="disk/zpool/g1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:4*", SYMLINK+="disk/zpool/g2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:5*", SYMLINK+="disk/zpool/g3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:6*", SYMLINK+="disk/zpool/g4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:7*", SYMLINK+="disk/zpool/g5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:8*", SYMLINK+="disk/zpool/g6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:9*", SYMLINK+="disk/zpool/g7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:10*", SYMLINK+="disk/zpool/g8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:11*", SYMLINK+="disk/zpool/g9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:12*", SYMLINK+="disk/zpool/g10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:13*", SYMLINK+="disk/zpool/g11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:14*", SYMLINK+="disk/zpool/g12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:15*", SYMLINK+="disk/zpool/g13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:16*", SYMLINK+="disk/zpool/g14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*0:*:17*", SYMLINK+="disk/zpool/g15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:3*", SYMLINK+="disk/zpool/h1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:4*", SYMLINK+="disk/zpool/h2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:5*", SYMLINK+="disk/zpool/h3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:6*", SYMLINK+="disk/zpool/h4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:7*", SYMLINK+="disk/zpool/h5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:8*", SYMLINK+="disk/zpool/h6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:9*", SYMLINK+="disk/zpool/h7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:10*", SYMLINK+="disk/zpool/h8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:11*", SYMLINK+="disk/zpool/h9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:12*", SYMLINK+="disk/zpool/h10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:13*", SYMLINK+="disk/zpool/h11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:14*", SYMLINK+="disk/zpool/h12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:15*", SYMLINK+="disk/zpool/h13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:16*", SYMLINK+="disk/zpool/h14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:85:00.0*4:*:17*", SYMLINK+="disk/zpool/h15-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:0*", SYMLINK+="disk/zpool/i1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:1*", SYMLINK+="disk/zpool/i2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:2*", SYMLINK+="disk/zpool/i3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:3*", SYMLINK+="disk/zpool/i4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:4*", SYMLINK+="disk/zpool/i5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:5*", SYMLINK+="disk/zpool/i6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:6*", SYMLINK+="disk/zpool/i7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:7*", SYMLINK+="disk/zpool/i8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:8*", SYMLINK+="disk/zpool/i9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:9*", SYMLINK+="disk/zpool/i10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:10*", SYMLINK+="disk/zpool/i11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:11*", SYMLINK+="disk/zpool/i12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:12*", SYMLINK+="disk/zpool/i13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:13*", SYMLINK+="disk/zpool/i14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:14*", SYMLINK+="disk/zpool/i15-part%n" +#ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*0:*:15*", SYMLINK+="disk/zpool/i16-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:0*", SYMLINK+="disk/zpool/j1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:1*", SYMLINK+="disk/zpool/j2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:2*", SYMLINK+="disk/zpool/j3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:3*", SYMLINK+="disk/zpool/j4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:4*", SYMLINK+="disk/zpool/j5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:5*", SYMLINK+="disk/zpool/j6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:6*", SYMLINK+="disk/zpool/j7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:7*", SYMLINK+="disk/zpool/j8-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:8*", SYMLINK+="disk/zpool/j9-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:9*", SYMLINK+="disk/zpool/j10-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:10*", SYMLINK+="disk/zpool/j11-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:11*", SYMLINK+="disk/zpool/j12-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:12*", SYMLINK+="disk/zpool/j13-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:13*", SYMLINK+="disk/zpool/j14-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:14*", SYMLINK+="disk/zpool/j15-part%n" +#ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:83:00.0*4:*:15*", SYMLINK+="disk/zpool/j16-part%n" diff --git a/scripts/udev-rules/99-zpool.rules.x4550 b/scripts/udev-rules/99-zpool.rules.x4550 new file mode 100644 index 0000000000..b2b99513d3 --- /dev/null +++ b/scripts/udev-rules/99-zpool.rules.x4550 @@ -0,0 +1,115 @@ +# +# /etc/udev/rules.d/99-zpool.rules +# + +ENV{DEVTYPE}=="disk", IMPORT{program}="path_id %p" + +# Full devices (*:pci*port:*:id*) +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:0*", SYMLINK+="disk/zpool/a1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:1*", SYMLINK+="disk/zpool/a2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:2*", SYMLINK+="disk/zpool/a3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:3*", SYMLINK+="disk/zpool/a4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:4*", SYMLINK+="disk/zpool/a5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:5*", SYMLINK+="disk/zpool/a6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:6*", SYMLINK+="disk/zpool/a7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:02:00.0*0:*:7*", SYMLINK+="disk/zpool/a8" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:0*", SYMLINK+="disk/zpool/b1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:1*", SYMLINK+="disk/zpool/b2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:2*", SYMLINK+="disk/zpool/b3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:3*", SYMLINK+="disk/zpool/b4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:4*", SYMLINK+="disk/zpool/b5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:5*", SYMLINK+="disk/zpool/b6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:6*", SYMLINK+="disk/zpool/b7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:03:00.0*0:*:7*", SYMLINK+="disk/zpool/b8" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:0*", SYMLINK+="disk/zpool/c1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:1*", SYMLINK+="disk/zpool/c2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:2*", SYMLINK+="disk/zpool/c3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:3*", SYMLINK+="disk/zpool/c4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:4*", SYMLINK+="disk/zpool/c5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:5*", SYMLINK+="disk/zpool/c6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:6*", SYMLINK+="disk/zpool/c7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:04:00.0*0:*:7*", SYMLINK+="disk/zpool/c8" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:0*", SYMLINK+="disk/zpool/d1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:1*", SYMLINK+="disk/zpool/d2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:2*", SYMLINK+="disk/zpool/d3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:3*", SYMLINK+="disk/zpool/d4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:4*", SYMLINK+="disk/zpool/d5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:5*", SYMLINK+="disk/zpool/d6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:6*", SYMLINK+="disk/zpool/d7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:41:00.0*0:*:7*", SYMLINK+="disk/zpool/d8" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:0*", SYMLINK+="disk/zpool/e1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:1*", SYMLINK+="disk/zpool/e2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:2*", SYMLINK+="disk/zpool/e3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:3*", SYMLINK+="disk/zpool/e4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:4*", SYMLINK+="disk/zpool/e5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:5*", SYMLINK+="disk/zpool/e6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:6*", SYMLINK+="disk/zpool/e7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:42:00.0*0:*:7*", SYMLINK+="disk/zpool/e8" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:0*", SYMLINK+="disk/zpool/f1" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:1*", SYMLINK+="disk/zpool/f2" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:2*", SYMLINK+="disk/zpool/f3" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:3*", SYMLINK+="disk/zpool/f4" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:4*", SYMLINK+="disk/zpool/f5" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:5*", SYMLINK+="disk/zpool/f6" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:6*", SYMLINK+="disk/zpool/f7" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="*:43:00.0*0:*:7*", SYMLINK+="disk/zpool/f8" + +# Partitions (*:pci*port:*:id*) +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:0*", SYMLINK+="disk/zpool/a1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:1*", SYMLINK+="disk/zpool/a2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:2*", SYMLINK+="disk/zpool/a3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:3*", SYMLINK+="disk/zpool/a4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:4*", SYMLINK+="disk/zpool/a5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:5*", SYMLINK+="disk/zpool/a6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:6*", SYMLINK+="disk/zpool/a7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:02:00.0*0:*:7*", SYMLINK+="disk/zpool/a8-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:0*", SYMLINK+="disk/zpool/b1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:1*", SYMLINK+="disk/zpool/b2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:2*", SYMLINK+="disk/zpool/b3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:3*", SYMLINK+="disk/zpool/b4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:4*", SYMLINK+="disk/zpool/b5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:5*", SYMLINK+="disk/zpool/b6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:6*", SYMLINK+="disk/zpool/b7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:03:00.0*0:*:7*", SYMLINK+="disk/zpool/b8-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:0*", SYMLINK+="disk/zpool/c1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:1*", SYMLINK+="disk/zpool/c2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:2*", SYMLINK+="disk/zpool/c3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:3*", SYMLINK+="disk/zpool/c4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:4*", SYMLINK+="disk/zpool/c5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:5*", SYMLINK+="disk/zpool/c6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:6*", SYMLINK+="disk/zpool/c7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:04:00.0*0:*:7*", SYMLINK+="disk/zpool/c8-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:0*", SYMLINK+="disk/zpool/d1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:1*", SYMLINK+="disk/zpool/d2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:2*", SYMLINK+="disk/zpool/d3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:3*", SYMLINK+="disk/zpool/d4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:4*", SYMLINK+="disk/zpool/d5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:5*", SYMLINK+="disk/zpool/d6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:6*", SYMLINK+="disk/zpool/d7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:41:00.0*0:*:7*", SYMLINK+="disk/zpool/d8-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:0*", SYMLINK+="disk/zpool/e1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:1*", SYMLINK+="disk/zpool/e2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:2*", SYMLINK+="disk/zpool/e3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:3*", SYMLINK+="disk/zpool/e4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:4*", SYMLINK+="disk/zpool/e5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:5*", SYMLINK+="disk/zpool/e6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:6*", SYMLINK+="disk/zpool/e7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:42:00.0*0:*:7*", SYMLINK+="disk/zpool/e8-part%n" + +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:0*", SYMLINK+="disk/zpool/f1-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:1*", SYMLINK+="disk/zpool/f2-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:2*", SYMLINK+="disk/zpool/f3-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:3*", SYMLINK+="disk/zpool/f4-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:4*", SYMLINK+="disk/zpool/f5-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:5*", SYMLINK+="disk/zpool/f6-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:6*", SYMLINK+="disk/zpool/f7-part%n" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="*:43:00.0*0:*:7*", SYMLINK+="disk/zpool/f8-part%n" diff --git a/scripts/zpool-config/dragon-raid0-1x120.sh b/scripts/zpool-config/dragon-raid0-1x120.sh deleted file mode 100644 index 5b9475166a..0000000000 --- a/scripts/zpool-config/dragon-raid0-1x120.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# Dragon (White Box) Raid-0 Configuration (1x120) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) - -S_IDX=0 -STRIPES=() - -zpool_create() { - - while [ ${S_IDX} -lt ${#DEVICES[@]} ]; do - STRIPE=`readlink -f ${DEVICES[${S_IDX}]}` - STRIPES[${S_IDX}]="${STRIPE}" - let S_IDX=S_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${STRIPES[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${STRIPES[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/dragon-raid0-1x70.sh b/scripts/zpool-config/dragon-raid0-1x70.sh new file mode 100644 index 0000000000..8caffc4c4e --- /dev/null +++ b/scripts/zpool-config/dragon-raid0-1x70.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Dragon (White Box) Raid-0 Configuration (1x70) +# + +RANKS=7 +CHANNELS=10 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.dragon + udev_raid0_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID0S[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID0S[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/dragon-raid10-35x2.sh b/scripts/zpool-config/dragon-raid10-35x2.sh new file mode 100644 index 0000000000..f197136fe5 --- /dev/null +++ b/scripts/zpool-config/dragon-raid10-35x2.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Dragon (White Box) Raid-10 Configuration (35x2(1+1)) +# + +RANKS=7 +CHANNELS=10 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.dragon + udev_raid10_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID10S[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID10S[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/dragon-raidz-15x8.sh b/scripts/zpool-config/dragon-raidz-15x8.sh deleted file mode 100644 index 04c17e05fa..0000000000 --- a/scripts/zpool-config/dragon-raidz-15x8.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Dragon (White Box) Raid-Z Configuration (15x8 stripes) -# - -DEVICES_A=(`ls /dev/disk/by-path/* | grep pci-0000\:03 | head -15`) -DEVICES_B=(`ls /dev/disk/by-path/* | grep pci-0000\:03 | tail -15`) -DEVICES_C=(`ls /dev/disk/by-path/* | grep pci-0000\:04 | head -15`) -DEVICES_D=(`ls /dev/disk/by-path/* | grep pci-0000\:04 | tail -15`) -DEVICES_E=(`ls /dev/disk/by-path/* | grep pci-0000\:83 | head -15`) -DEVICES_F=(`ls /dev/disk/by-path/* | grep pci-0000\:83 | tail -15`) -DEVICES_G=(`ls /dev/disk/by-path/* | grep pci-0000\:84 | head -15`) -DEVICES_H=(`ls /dev/disk/by-path/* | grep pci-0000\:84 | tail -15`) - -DEVICES_PER_CTRL=1 -RAIDZ_GROUPS=15 -RAIDZS=() -Z_IDX=0 - -zpool_create() { - D_IDX=0 - for i in `seq 1 ${RAIDZ_GROUPS}`; do - RAIDZ="" - for IDX in `seq 1 ${DEVICES_PER_CTRL}`; do - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_A[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_B[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_C[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_D[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_E[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_F[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_G[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_H[${D_IDX}]}`" - let D_IDX=D_IDX+1 - done - RAIDZS[${Z_IDX}]="raidz ${RAIDZ}" - let Z_IDX=Z_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZS[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZS[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/dragon-raidz-7x10.sh b/scripts/zpool-config/dragon-raidz-7x10.sh new file mode 100644 index 0000000000..e7d793d3c3 --- /dev/null +++ b/scripts/zpool-config/dragon-raidz-7x10.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Dragon (White Box) Raid-Z Configuration (7x10(9+1)) +# + +RANKS=7 +CHANNELS=10 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.dragon + udev_raidz_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZS[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZS[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/dragon-raidz2-15x8.sh b/scripts/zpool-config/dragon-raidz2-15x8.sh deleted file mode 100644 index cc3800e7b4..0000000000 --- a/scripts/zpool-config/dragon-raidz2-15x8.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Dragon (White Box) Raid-Z2 Configuration (15x8 stripes) -# - -DEVICES_A=(`ls /dev/disk/by-path/* | grep pci-0000\:03 | head -15`) -DEVICES_B=(`ls /dev/disk/by-path/* | grep pci-0000\:03 | tail -15`) -DEVICES_C=(`ls /dev/disk/by-path/* | grep pci-0000\:04 | head -15`) -DEVICES_D=(`ls /dev/disk/by-path/* | grep pci-0000\:04 | tail -15`) -DEVICES_E=(`ls /dev/disk/by-path/* | grep pci-0000\:83 | head -15`) -DEVICES_F=(`ls /dev/disk/by-path/* | grep pci-0000\:83 | tail -15`) -DEVICES_G=(`ls /dev/disk/by-path/* | grep pci-0000\:84 | head -15`) -DEVICES_H=(`ls /dev/disk/by-path/* | grep pci-0000\:84 | tail -15`) - -DEVICES_PER_CTRL=1 -RAIDZ2_GROUPS=15 -RAIDZ2S=() -Z_IDX=0 - -zpool_create() { - D_IDX=0 - for i in `seq 1 ${RAIDZ2_GROUPS}`; do - RAIDZ2="" - for IDX in `seq 1 ${DEVICES_PER_CTRL}`; do - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_A[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_B[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_C[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_D[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_E[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_F[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_G[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_H[${D_IDX}]}`" - let D_IDX=D_IDX+1 - done - RAIDZ2S[${Z_IDX}]="raidz2 ${RAIDZ2}" - let Z_IDX=Z_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZ2S[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZ2S[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/dragon-raidz2-7x10.sh b/scripts/zpool-config/dragon-raidz2-7x10.sh new file mode 100644 index 0000000000..a3a2ef58ba --- /dev/null +++ b/scripts/zpool-config/dragon-raidz2-7x10.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Dragon (White Box) Raid-Z2 Configuration (7x10(8+2)) +# + +RANKS=7 +CHANNELS=10 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.dragon + udev_raidz2_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZ2S[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZ2S[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/file-raid0.sh b/scripts/zpool-config/file-raid0.sh index 67f85d7515..14429c43d9 100644 --- a/scripts/zpool-config/file-raid0.sh +++ b/scripts/zpool-config/file-raid0.sh @@ -16,8 +16,8 @@ zpool_create() { die "Error $? creating ${FILE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} ${FILES} - ${ZPOOL} create ${ZPOOL_NAME} ${FILES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${FILES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/file-raid10.sh b/scripts/zpool-config/file-raid10.sh index ad635f597e..a632a4f4cd 100644 --- a/scripts/zpool-config/file-raid10.sh +++ b/scripts/zpool-config/file-raid10.sh @@ -17,9 +17,9 @@ zpool_create() { die "Error $? creating ${FILE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} \ + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} \ mirror ${FILES_M1} mirror ${FILES_M2} - ${ZPOOL} create ${ZPOOL_NAME} \ + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} \ mirror ${FILES_M1} mirror ${FILES_M2} || exit 1 } diff --git a/scripts/zpool-config/file-raidz.sh b/scripts/zpool-config/file-raidz.sh index 8689f323a9..9302c85e97 100644 --- a/scripts/zpool-config/file-raidz.sh +++ b/scripts/zpool-config/file-raidz.sh @@ -16,8 +16,8 @@ zpool_create() { die "Error $? creating ${FILE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} raidz ${FILES} - ${ZPOOL} create ${ZPOOL_NAME} raidz ${FILES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz ${FILES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz ${FILES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/file-raidz2.sh b/scripts/zpool-config/file-raidz2.sh index 8a78e9e7e4..681352783c 100644 --- a/scripts/zpool-config/file-raidz2.sh +++ b/scripts/zpool-config/file-raidz2.sh @@ -16,8 +16,8 @@ zpool_create() { die "Error $? creating ${FILE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} raidz2 ${FILES} - ${ZPOOL} create ${ZPOOL_NAME} raidz2 ${FILES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz2 ${FILES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz2 ${FILES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/hda-raid0.sh b/scripts/zpool-config/hda-raid0.sh index 70b631e566..fb743fae57 100644 --- a/scripts/zpool-config/hda-raid0.sh +++ b/scripts/zpool-config/hda-raid0.sh @@ -6,8 +6,8 @@ DEVICES="/dev/hda" zpool_create() { - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${DEVICES} - ${ZPOOL} create -f ${ZPOOL_NAME} ${DEVICES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${DEVICES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${DEVICES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/lo-raid0.sh b/scripts/zpool-config/lo-raid0.sh index 3270469bb6..d37d5138f7 100644 --- a/scripts/zpool-config/lo-raid0.sh +++ b/scripts/zpool-config/lo-raid0.sh @@ -21,8 +21,8 @@ zpool_create() { DEVICES="${DEVICES} ${DEVICE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} ${DEVICES} - ${ZPOOL} create ${ZPOOL_NAME} ${DEVICES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${DEVICES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${DEVICES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/lo-raid10.sh b/scripts/zpool-config/lo-raid10.sh index 9215eb8e07..8d3672dd1b 100644 --- a/scripts/zpool-config/lo-raid10.sh +++ b/scripts/zpool-config/lo-raid10.sh @@ -34,9 +34,9 @@ zpool_create() { DEVICES_M2="${DEVICES_M2} ${DEVICE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} \ + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} \ mirror ${DEVICES_M1} mirror ${DEVICES_M2} - ${ZPOOL} create ${ZPOOL_NAME} \ + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} \ mirror ${DEVICES_M1} mirror ${DEVICES_M2} } diff --git a/scripts/zpool-config/lo-raidz.sh b/scripts/zpool-config/lo-raidz.sh index 5f968d4b5f..6efcd1041a 100644 --- a/scripts/zpool-config/lo-raidz.sh +++ b/scripts/zpool-config/lo-raidz.sh @@ -21,8 +21,8 @@ zpool_create() { DEVICES="${DEVICES} ${DEVICE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} raidz ${DEVICES} - ${ZPOOL} create ${ZPOOL_NAME} raidz ${DEVICES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz ${DEVICES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz ${DEVICES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/lo-raidz2.sh b/scripts/zpool-config/lo-raidz2.sh index f6a5127b56..f59c7f2d65 100644 --- a/scripts/zpool-config/lo-raidz2.sh +++ b/scripts/zpool-config/lo-raidz2.sh @@ -21,8 +21,8 @@ zpool_create() { DEVICES="${DEVICES} ${DEVICE}" done - msg ${ZPOOL} create ${ZPOOL_NAME} raidz2 ${DEVICES} - ${ZPOOL} create ${ZPOOL_NAME} raidz2 ${DEVICES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz2 ${DEVICES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} raidz2 ${DEVICES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/sda-raid0.sh b/scripts/zpool-config/sda-raid0.sh index 8ca58b129a..b110924660 100644 --- a/scripts/zpool-config/sda-raid0.sh +++ b/scripts/zpool-config/sda-raid0.sh @@ -6,8 +6,8 @@ DEVICES="/dev/sda" zpool_create() { - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${DEVICES} - ${ZPOOL} create -f ${ZPOOL_NAME} ${DEVICES} || exit 1 + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${DEVICES} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${DEVICES} || exit 1 } zpool_destroy() { diff --git a/scripts/zpool-config/x4550-raid0-1x48.sh b/scripts/zpool-config/x4550-raid0-1x48.sh new file mode 100644 index 0000000000..8082fea204 --- /dev/null +++ b/scripts/zpool-config/x4550-raid0-1x48.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Sun Fire x4550 (Thumper/Thor) Raid-0 Configuration (1x48) +# + +RANKS=8 +CHANNELS=6 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.x4550 + udev_raid0_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID0S[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID0S[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/x4550-raid0.sh b/scripts/zpool-config/x4550-raid0.sh deleted file mode 100644 index 7bb87bc07c..0000000000 --- a/scripts/zpool-config/x4550-raid0.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-0 Configuration -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) - -S_IDX=0 -STRIPES=() - -zpool_create() { - - while [ ${S_IDX} -lt ${#DEVICES[@]} ]; do - STRIPE=`readlink -f ${DEVICES[${S_IDX}]}` - STRIPES[${S_IDX}]="${STRIPE}" - let S_IDX=S_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${STRIPES[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${STRIPES[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raid10-24x2.sh b/scripts/zpool-config/x4550-raid10-24x2.sh new file mode 100644 index 0000000000..fb323716d6 --- /dev/null +++ b/scripts/zpool-config/x4550-raid10-24x2.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Sun Fire x4550 (Thumper/Thor) Raid-10 Configuration (24x2(1+1)) +# + +RANKS=8 +CHANNELS=6 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.x4550 + udev_raid10_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID10S[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAID10S[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/x4550-raid10-2x24.sh b/scripts/zpool-config/x4550-raid10-2x24.sh deleted file mode 100644 index 678880424f..0000000000 --- a/scripts/zpool-config/x4550-raid10-2x24.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-10 Configuration (2x24 mirror) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -M_IDX=0 -MIRRORS=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - MIRROR1=`readlink -f ${DEVICES_02[${D_IDX}]}` - MIRROR2=`readlink -f ${DEVICES_41[${D_IDX}]}` - MIRRORS[${M_IDX}]="mirror ${MIRROR1} ${MIRROR2}" - let D_IDX=D_IDX+1 - let M_IDX=M_IDX+1 - done - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_03[@]} ]; do - MIRROR1=`readlink -f ${DEVICES_03[${D_IDX}]}` - MIRROR2=`readlink -f ${DEVICES_42[${D_IDX}]}` - MIRRORS[${M_IDX}]="mirror ${MIRROR1} ${MIRROR2}" - let D_IDX=D_IDX+1 - let M_IDX=M_IDX+1 - done - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_04[@]} ]; do - MIRROR1=`readlink -f ${DEVICES_04[${D_IDX}]}` - MIRROR2=`readlink -f ${DEVICES_43[${D_IDX}]}` - MIRRORS[${M_IDX}]="mirror ${MIRROR1} ${MIRROR2}" - let D_IDX=D_IDX+1 - let M_IDX=M_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${MIRRORS[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${MIRRORS[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raid10-3x16.sh b/scripts/zpool-config/x4550-raid10-3x16.sh deleted file mode 100644 index 799aef2c4e..0000000000 --- a/scripts/zpool-config/x4550-raid10-3x16.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-10 Configuration (3x16 mirror) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -M_IDX=0 -MIRRORS=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - MIRROR1=`readlink -f ${DEVICES_02[${D_IDX}]}` - MIRROR2=`readlink -f ${DEVICES_03[${D_IDX}]}` - MIRROR3=`readlink -f ${DEVICES_04[${D_IDX}]}` - MIRRORS[${M_IDX}]="mirror ${MIRROR1} ${MIRROR2} ${MIRROR3}" - let D_IDX=D_IDX+1 - let M_IDX=M_IDX+1 - done - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_03[@]} ]; do - MIRROR1=`readlink -f ${DEVICES_41[${D_IDX}]}` - MIRROR2=`readlink -f ${DEVICES_42[${D_IDX}]}` - MIRROR3=`readlink -f ${DEVICES_43[${D_IDX}]}` - MIRRORS[${M_IDX}]="mirror ${MIRROR1} ${MIRROR2} ${MIRROR3}" - let D_IDX=D_IDX+1 - let M_IDX=M_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${MIRRORS[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${MIRRORS[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raid10-6x8.sh b/scripts/zpool-config/x4550-raid10-6x8.sh deleted file mode 100644 index d8050727f6..0000000000 --- a/scripts/zpool-config/x4550-raid10-6x8.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-10 Configuration (6x8 mirror) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -M_IDX=0 -MIRRORS=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - MIRROR1=`readlink -f ${DEVICES_02[${D_IDX}]}` - MIRROR2=`readlink -f ${DEVICES_03[${D_IDX}]}` - MIRROR3=`readlink -f ${DEVICES_04[${D_IDX}]}` - MIRROR4=`readlink -f ${DEVICES_41[${D_IDX}]}` - MIRROR5=`readlink -f ${DEVICES_42[${D_IDX}]}` - MIRROR6=`readlink -f ${DEVICES_43[${D_IDX}]}` - MIRRORS[${M_IDX}]="mirror ${MIRROR1} ${MIRROR2} ${MIRROR3} ${MIRROR4} ${MIRROR5} ${MIRROR6}" - let D_IDX=D_IDX+1 - let M_IDX=M_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${MIRRORS[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${MIRRORS[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raidz-12x4.sh b/scripts/zpool-config/x4550-raidz-12x4.sh deleted file mode 100644 index fd6ea8f0de..0000000000 --- a/scripts/zpool-config/x4550-raidz-12x4.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-Z Configuration (12x4 stripe) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -DEVICES_PER_CTRL=2 -Z_IDX=0 -RAIDZS=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - RAIDZ="" - for IDX in `seq 1 ${DEVICES_PER_CTRL}`; do - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_02[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_03[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_04[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_41[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_42[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_43[${D_IDX}]}`" - let D_IDX=D_IDX+1 - done - RAIDZS[${Z_IDX}]="raidz ${RAIDZ}" - let Z_IDX=Z_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZS[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZS[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raidz-6x8.sh b/scripts/zpool-config/x4550-raidz-6x8.sh deleted file mode 100644 index 67f67df732..0000000000 --- a/scripts/zpool-config/x4550-raidz-6x8.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-Z Configuration (6x8 stripe) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -DEVICES_PER_CTRL=1 -Z_IDX=0 -RAIDZS=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - RAIDZ="" - for IDX in `seq 1 ${DEVICES_PER_CTRL}`; do - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_02[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_03[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_04[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_41[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_42[${D_IDX}]}`" - RAIDZ="${RAIDZ} `readlink -f ${DEVICES_43[${D_IDX}]}`" - let D_IDX=D_IDX+1 - done - RAIDZS[${Z_IDX}]="raidz ${RAIDZ}" - let Z_IDX=Z_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZS[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZS[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raidz-8x6.sh b/scripts/zpool-config/x4550-raidz-8x6.sh new file mode 100644 index 0000000000..d92974cff4 --- /dev/null +++ b/scripts/zpool-config/x4550-raidz-8x6.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Sun Fire x4550 (Thumper/Thor) Raid-Z Configuration (8x6(5+1)) +# + +RANKS=8 +CHANNELS=6 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.x4550 + udev_raidz_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZS[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZS[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-config/x4550-raidz2-12x4.sh b/scripts/zpool-config/x4550-raidz2-12x4.sh deleted file mode 100644 index 2af7cccf2d..0000000000 --- a/scripts/zpool-config/x4550-raidz2-12x4.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-Z2 Configuration (12x4 stripe) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -DEVICES_PER_CTRL=2 -Z_IDX=0 -RAIDZ2S=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - RAIDZ2="" - for IDX in `seq 1 ${DEVICES_PER_CTRL}`; do - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_02[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_03[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_04[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_41[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_42[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_43[${D_IDX}]}`" - let D_IDX=D_IDX+1 - done - RAIDZ2S[${Z_IDX}]="raidz2 ${RAIDZ2}" - let Z_IDX=Z_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZ2S[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZ2S[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raidz2-6x8.sh b/scripts/zpool-config/x4550-raidz2-6x8.sh deleted file mode 100644 index f45a496e9f..0000000000 --- a/scripts/zpool-config/x4550-raidz2-6x8.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# -# Sun Fire x4550 (Thumper) Raid-Z2 Configuration (6x8 stripe) -# - -DEVICES=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000`) -DEVICES_02=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:02`) -DEVICES_03=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:03`) -DEVICES_04=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:04`) -DEVICES_41=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:41`) -DEVICES_42=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:42`) -DEVICES_43=(`ls /dev/disk/by-path/* | grep -v part | grep pci-0000\:43`) - -DEVICES_PER_CTRL=1 -Z_IDX=0 -RAIDZ2S=() - -zpool_create() { - - D_IDX=0 - while [ ${D_IDX} -lt ${#DEVICES_02[@]} ]; do - RAIDZ2="" - for IDX in `seq 1 ${DEVICES_PER_CTRL}`; do - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_02[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_03[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_04[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_41[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_42[${D_IDX}]}`" - RAIDZ2="${RAIDZ2} `readlink -f ${DEVICES_43[${D_IDX}]}`" - let D_IDX=D_IDX+1 - done - RAIDZ2S[${Z_IDX}]="raidz2 ${RAIDZ2}" - let Z_IDX=Z_IDX+1 - done - - msg ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZ2S[*]} - ${ZPOOL} create -f ${ZPOOL_NAME} ${RAIDZ2S[*]} || exit 1 -} - -zpool_destroy() { - msg ${ZPOOL} destroy ${ZPOOL_NAME} - ${ZPOOL} destroy ${ZPOOL_NAME} -} diff --git a/scripts/zpool-config/x4550-raidz2-8x6.sh b/scripts/zpool-config/x4550-raidz2-8x6.sh new file mode 100644 index 0000000000..4b75ba222b --- /dev/null +++ b/scripts/zpool-config/x4550-raidz2-8x6.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Sun Fire x4550 (Thumper/Thor) Raid-Z Configuration (8x6(4+2)) +# + +RANKS=8 +CHANNELS=6 + +zpool_create() { + udev_setup ${UDEVDIR}/99-zpool.rules.x4550 + udev_raidz2_setup ${RANKS} ${CHANNELS} + + msg ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZ2S[*]} + ${ZPOOL} create ${FORCE_FLAG} ${ZPOOL_NAME} ${RAIDZ2S[*]} || exit 1 +} + +zpool_destroy() { + msg ${ZPOOL} destroy ${ZPOOL_NAME} + ${ZPOOL} destroy ${ZPOOL_NAME} +} diff --git a/scripts/zpool-create.sh b/scripts/zpool-create.sh index 16f829cf6a..2853f7d4e2 100755 --- a/scripts/zpool-create.sh +++ b/scripts/zpool-create.sh @@ -25,6 +25,7 @@ OPTIONS: -c Configuration for zpool -p Name for zpool -d Destroy zpool (default create) + -f Force everything -l Additional zpool options -s Additional zfs options @@ -54,7 +55,7 @@ ZPOOL_DESTROY= ZPOOL_OPTIONS="" ZFS_OPTIONS="" -while getopts 'hvc:p:dl:s:' OPTION; do +while getopts 'hvfc:p:dl:s:' OPTION; do case $OPTION in h) usage @@ -62,6 +63,11 @@ while getopts 'hvc:p:dl:s:' OPTION; do ;; v) VERBOSE=1 + VERBOSE_FLAG="-v" + ;; + f) + FORCE=1 + FORCE_FLAG="-f" ;; c) ZPOOL_CONFIG=${ZPOOLDIR}/${OPTARG}.sh From aec988734baf9065839833bcc6cb112f4a17f4f3 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 21 Oct 2009 11:50:42 -0700 Subject: [PATCH 2/2] Command 'zpool create' needs to wait on correct partition names. When creating partition tables we always need to wait until not only the /dev/ device appears. But just as importantly if we were originally given a udev path we need to wait for the /dev/disk/*/-part symlink to be created. However, since the partition naming convention differs between /dev/ and /dev/disk we determine based on the path which convention to expect and then wait (for a few seconds) for the device to be created. Based on my experience with udev on my test nodes it takes about 300ms for the devices to be created after being prompted by the kernel. This time will vary somehwat based on how complicated your udev rules are, so for safety I threw in a factor of 10. We wait 3 seconds for the devices to appears before erroring out with a failure. An additional minor fix includes checking the force flag in the EFI_GPT_PRIMARY_CORRUPT case. This allows you to force the update even in the corrupt partition case. Finally, since these are Linux only changes I've dropped the devid code entirely here because I still can't think of why we would need or want it on a Linux system. --- cmd/zpool/zpool_vdev.c | 57 ++++++++++++------------------------- lib/libzfs/include/libzfs.h | 3 ++ lib/libzfs/libzfs_pool.c | 54 ++++++++++++++++++++++------------- 3 files changed, 55 insertions(+), 59 deletions(-) diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 661946cef2..7d4d87ede8 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -279,7 +279,7 @@ check_disk(const char *path, blkid_cache cache, int force, * label at the end of the device is intact. Rather than use this * label we should play it safe and treat this as a non efi device. */ - if (vtoc->efi_flags & EFI_GPT_PRIMARY_CORRUPT) { + if (!force && vtoc->efi_flags & EFI_GPT_PRIMARY_CORRUPT) { vdev_error(gettext( "%s contains a corrupt primary efi partition table. " "If you are\nsure you want to use this device use " @@ -938,12 +938,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv) char *type, *path, *diskname; char buf[MAXPATHLEN]; uint64_t wholedisk; - int fd; int ret; -#if defined(__sun__) || defined(__sun) - ddi_devid_t devid; - char *minor = NULL, *devid_str = NULL; -#endif verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0); @@ -983,50 +978,34 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv) return (-1); /* - * Fill in the devid, now that we've labeled the disk. We - * attempt to open the new zfs slice first by appending the - * slice number. If that fails this may be a Linux udev - * path in which case the -part# convention is tried. + * Now the we've labeled the disk and the partitions have + * been created. We still need to wait for udev to create + * the symlinks to those partitions. If we are accessing + * the devices via a udev disk path, /dev/disk, then wait + * for *-part# to be created. Otherwise just use the normal + * syntax for devices in /dev. */ - (void) snprintf(buf, sizeof (buf), "%s%s", path, FIRST_SLICE); - if ((fd = open(buf, O_RDONLY)) < 0) { + if (strncmp(path, UDISK_ROOT, strlen(UDISK_ROOT)) == 0) + (void) snprintf(buf, sizeof (buf), + "%s%s%s", path, "-part", FIRST_SLICE); + else + (void) snprintf(buf, sizeof (buf), + "%s%s", path, FIRST_SLICE); - (void) snprintf(buf, sizeof (buf), "%s%s%s", - path, "-part", FIRST_SLICE); - if ((fd = open(buf, O_RDONLY)) < 0) { - (void) fprintf(stderr, - gettext("cannot open '%s': %s\n"), - buf, strerror(errno)); - return (-1); - } + if ((ret = zpool_label_disk_wait(buf, 1000)) != 0) { + (void) fprintf(stderr, + gettext( "cannot resolve path '%s'\n"), buf); + return (-1); } -#if defined(__sun__) || defined(__sun) - if (devid_get(fd, &devid) == 0) { - if (devid_get_minor_name(fd, &minor) == 0 && - (devid_str = devid_str_encode(devid, minor)) != - NULL) { - verify(nvlist_add_string(nv, - ZPOOL_CONFIG_DEVID, devid_str) == 0); - } - if (devid_str != NULL) - devid_str_free(devid_str); - if (minor != NULL) - devid_str_free(minor); - devid_free(devid); - } -#endif - /* - * Update the path to refer to the 's0' slice. The presence of + * Update the path to refer to FIRST_SLICE. The presence of * the 'whole_disk' field indicates to the CLI that we should * chop off the slice number when displaying the device in * future output. */ verify(nvlist_add_string(nv, ZPOOL_CONFIG_PATH, buf) == 0); - (void) close(fd); - /* Just in case this partition already existed. */ (void) zero_label(buf); diff --git a/lib/libzfs/include/libzfs.h b/lib/libzfs/include/libzfs.h index fc32086ae5..21e0fdc5c6 100644 --- a/lib/libzfs/include/libzfs.h +++ b/lib/libzfs/include/libzfs.h @@ -56,6 +56,7 @@ extern "C" { #if defined(__sun__) || defined(__sun) #define DISK_ROOT "/dev/dsk" #define RDISK_ROOT "/dev/rdsk" +#define UDISK_ROOT RDISK_ROOT #define FIRST_SLICE "s0" #define BACKUP_SLICE "s2" #endif @@ -63,6 +64,7 @@ extern "C" { #ifdef __linux__ #define DISK_ROOT "/dev" #define RDISK_ROOT DISK_ROOT +#define UDISK_ROOT "/dev/disk" #define FIRST_SLICE "1" #define BACKUP_SLICE "" #endif @@ -253,6 +255,7 @@ extern nvlist_t *zpool_find_vdev(zpool_handle_t *, const char *, boolean_t *, boolean_t *, boolean_t *); extern nvlist_t *zpool_find_vdev_by_physpath(zpool_handle_t *, const char *, boolean_t *, boolean_t *, boolean_t *); +extern int zpool_label_disk_wait(char *, int); extern int zpool_label_disk(libzfs_handle_t *, zpool_handle_t *, char *); /* diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 9bb85824dd..a3d083efcc 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -3116,6 +3116,33 @@ find_start_block(nvlist_t *config) return (MAXOFFSET_T); } +int +zpool_label_disk_wait(char *path, int timeout) +{ +#if defined(__linux__) + struct stat64 statbuf; + int i; + + /* + * Wait timeout miliseconds for a newly created device to be available + * from the given path. There is a small window when a /dev/ device + * will exist and the udev link will not, so we must wait for the + * symlink. Depending on the udev rules this may take a few seconds. + */ + for (i = 0; i < timeout; i++) { + usleep(1000); + + errno = 0; + if ((stat64(path, &statbuf) == 0) && (errno == 0)) + return (0); + } + + return (ENOENT); +#else + return (0); +#endif +} + /* * Label an individual disk. The name provided is the short name, * stripped of any leading /dev path. @@ -3130,10 +3157,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name) uint64_t slice_size; diskaddr_t start_block; char errbuf[1024]; -#if defined(__linux__) - struct stat64 statbuf; - int i; -#endif + /* prepare an error message just in case */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot label '%s'"), name); @@ -3233,23 +3257,13 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name) efi_free(vtoc); #if defined(__linux__) - /* - * The efi partition table has been successfully written and the - * kernel notified. However, it still may take a moment for udev - * to notice the devfs update and properly populate /dev/. We will - * wait up to 3 seconds which is far far far longer than needed. - */ - (void) snprintf(path, sizeof (path), "%s/%s%s", RDISK_ROOT, name, - FIRST_SLICE); - for (i = 0; i < 3000; i++) { - if (stat64(path, &statbuf) == 0 || errno != ENOENT) - break; - - usleep(1000); - } -#endif - + /* Wait for the first expected slice to appear */ + (void) snprintf(path, sizeof (path), "%s/%s%s", + DISK_ROOT, name, FIRST_SLICE); + return zpool_label_disk_wait(path, 3000); +#else return (0); +#endif } static boolean_t