3 # vdev_id: udev helper to generate user-friendly names for JBOD disks
5 # This script parses the file /etc/zfs/vdev_id.conf to map a
6 # physical path in a storage topology to a channel name. The
7 # channel name is combined with a disk enclosure slot number to
8 # create an alias that reflects the physical location of the drive.
9 # This is particularly helpful when it comes to tasks like replacing
10 # failed drives. Slot numbers may also be re-mapped in case the
11 # default numbering is unsatisfactory. The drive aliases will be
12 # created as symbolic links in /dev/disk/by-vdev.
14 # The currently supported topologies are sas_direct and sas_switch.
15 # A multipath mode is supported in which dm-mpath devices are
16 # handled by examining the first-listed running component disk. In
17 # multipath mode the configuration file should contain a channel
18 # definition with the same name for each path to a given enclosure.
20 # The alias keyword provides a simple way to map already-existing
21 # device symlinks to more convenient names. It is suitable for
22 # small, static configurations or for sites that have some automated
23 # way to generate the mapping file.
26 # Some example configuration files are given below.
29 # # Example vdev_id.conf - sas_direct.
37 # # PCI_ID HBA PORT CHANNEL NAME
43 # # Custom mapping for Channel A
52 # # Default mapping for B, C, and D
59 # # Example vdev_id.conf - sas_switch
64 # # SWITCH PORT CHANNEL NAME
71 # # Example vdev_id.conf - multipath
76 # # PCI_ID HBA PORT CHANNEL NAME
83 # # Example vdev_id.conf - multipath / multijbod-daisychaining
89 # # PCI_ID HBA PORT CHANNEL NAME
96 # # Example vdev_id.conf - multipath / mixed
102 # # PCI_ID HBA PORT CHANNEL NAME
103 # channel 85:00.0 3 A
104 # channel 85:00.0 2 B
105 # channel 86:00.0 3 A
106 # channel 86:00.0 2 B
107 # channel af:00.0 0 C
108 # channel af:00.0 1 C
111 # # Example vdev_id.conf - alias
115 # # name fully qualified or base name of device link
116 # alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca
117 # alias d2 wwn-0x5000c5002def789e
119 PATH
=/bin
:/sbin
:/usr
/bin
:/usr
/sbin
120 CONFIG
=/etc
/zfs
/vdev_id.conf
132 vdev_id <-d device> [-c config_file] [-p phys_per_port]
133 [-g sas_direct|sas_switch|scsi] [-m]
135 -c specify name of an alternative config file [default=$CONFIG]
136 -d specify basename of device (i.e. sda)
137 -e Create enclose device symlinks only (/dev/by-enclosure)
138 -g Storage network topology [default="$TOPOLOGY"]
139 -m Run in multipath mode
140 -j Run in multijbod mode
141 -p number of phy's per switch port [default=$PHYS_PER_PORT]
145 # exit with error to avoid processing usage message by a udev rule
152 MAPPED_SLOT
=$
(awk -v linux_slot
="$LINUX_SLOT" -v channel
="$CHANNEL" \
153 '$1 == "slot" && $2 == linux_slot && \
154 ($4 ~ "^"channel"$" || $4 ~ /^$/) { print $3; exit}' $CONFIG)
155 if [ -z "$MAPPED_SLOT" ] ; then
156 MAPPED_SLOT
=$LINUX_SLOT
158 printf "%0${ZPAD}d" "${MAPPED_SLOT}"
168 MAPPED_CHAN
=$
(awk -v port
="$PORT" \
169 '$1 == "channel" && $2 == port \
170 { print $3; exit }' $CONFIG)
173 MAPPED_CHAN
=$
(awk -v pciID
="$PCI_ID" -v port
="$PORT" \
174 '$1 == "channel" && $2 == pciID && $3 == port \
178 printf "%s" "${MAPPED_CHAN}"
186 while [ $i -le $count ] ; do
187 d
=$
(eval echo '$'{$i})
188 id
=$
(cat "/sys/class/enclosure/${d}/id")
189 ENCL_ID
="${ENCL_ID} $id"
195 for uuid
in ${ENCL_ID}; do
198 for count
in ${UNIQ_ENCL_ID}; do
199 if [ $count = $uuid ]; then
205 if [ $found -eq 0 ]; then
206 UNIQ_ENCL_ID
="${UNIQ_ENCL_ID} $uuid"
211 # map_jbod explainer: The bsg driver knows the difference between a SAS
212 # expander and fanout expander. Use hostX instance along with top-level
213 # (whole enclosure) expander instances in /sys/class/enclosure and
214 # matching a field in an array of expanders, using the index of the
215 # matched array field as the enclosure instance, thereby making jbod IDs
216 # dynamic. Avoids reliance on high overhead userspace commands like
217 # multipath and lsscsi and instead uses existing sysfs data. $HOSTCHAN
218 # variable derived from devpath gymnastics in sas_handler() function.
220 DEVEXP
=$
(ls -l "/sys/block/$DEV/device/" |
grep enclos |
awk -F/ '{print $(NF-1) }')
223 # Use "set --" to create index values (Arrays)
224 set -- $
(ls -l /sys
/class
/enclosure |
grep -v "^total" |
awk '{print $9}')
225 # Get count of total elements
229 # Build JBODs (enclosure) id from sys/class/enclosure/<dev>/id
230 get_encl_id
"$JBOD_ITEM"
231 # Different expander instances for each paths.
232 # Filter out and keep only unique id.
235 # Identify final 'mapped jbod'
237 for count
in ${UNIQ_ENCL_ID}; do
240 while [ $i -le $JBOD_COUNT ] ; do
241 d
=$
(eval echo '$'{$i})
242 id
=$
(cat "/sys/class/enclosure/${d}/id")
243 if [ "$d" = "$DEVEXP" ] && [ $id = $count ] ; then
251 printf "%d" "${MAPPED_JBOD}"
255 if [ -z "$PHYS_PER_PORT" ] ; then
256 PHYS_PER_PORT
=$
(awk '$1 == "phys_per_port" \
257 {print $2; exit}' $CONFIG)
259 PHYS_PER_PORT
=${PHYS_PER_PORT:-4}
261 if ! echo "$PHYS_PER_PORT" |
grep -q -E '^[0-9]+$' ; then
262 echo "Error: phys_per_port value $PHYS_PER_PORT is non-numeric"
266 if [ -z "$MULTIPATH_MODE" ] ; then
267 MULTIPATH_MODE
=$
(awk '$1 == "multipath" \
268 {print $2; exit}' $CONFIG)
271 if [ -z "$MULTIJBOD_MODE" ] ; then
272 MULTIJBOD_MODE
=$
(awk '$1 == "multijbod" \
273 {print $2; exit}' $CONFIG)
276 # Use first running component device if we're handling a dm-mpath device
277 if [ "$MULTIPATH_MODE" = "yes" ] ; then
278 # If udev didn't tell us the UUID via DM_NAME, check /dev/mapper
279 if [ -z "$DM_NAME" ] ; then
280 DM_NAME
=$
(ls -l --full-time /dev
/mapper |
281 grep "$DEV"$ |
awk '{print $9}')
284 # For raw disks udev exports DEVTYPE=partition when
285 # handling partitions, and the rules can be written to
286 # take advantage of this to append a -part suffix. For
287 # dm devices we get DEVTYPE=disk even for partitions so
288 # we have to append the -part suffix directly in the
290 if [ "$DEVTYPE" != "partition" ] ; then
291 # Match p[number], remove the 'p' and prepend "-part"
292 PART
=$
(echo "$DM_NAME" |
293 awk 'match($0,/p[0-9]+$/) {print "-part"substr($0,RSTART+1,RLENGTH-1)}')
296 # Strip off partition information.
297 DM_NAME
=$
(echo "$DM_NAME" |
sed 's/p[0-9][0-9]*$//')
298 if [ -z "$DM_NAME" ] ; then
302 # Utilize DM device name to gather subordinate block devices
303 # using sysfs to avoid userspace utilities
305 # If our DEVNAME is something like /dev/dm-177, then we may be
306 # able to get our DMDEV from it.
307 DMDEV
=$
(echo $DEVNAME |
sed 's;/dev/;;g')
308 if [ ! -e /sys
/block
/$DMDEV/slaves
/* ] ; then
309 # It's not there, try looking in /dev/mapper
310 DMDEV
=$
(ls -l --full-time /dev
/mapper |
grep $DM_NAME |
311 awk '{gsub("../", " "); print $NF}')
314 # Use sysfs pointers in /sys/block/dm-X/slaves because using
315 # userspace tools creates lots of overhead and should be avoided
316 # whenever possible. Use awk to isolate lowest instance of
317 # sd device member in dm device group regardless of string
319 DEV
=$
(ls "/sys/block/$DMDEV/slaves" |
awk '
320 { len=sprintf ("%20s",length($0)); gsub(/ /,0,str); a[NR]=len "_" $0; }
323 print substr(a[1],22)
326 if [ -z "$DEV" ] ; then
331 if echo "$DEV" |
grep -q ^
/devices
/ ; then
334 sys_path
=$
(udevadm info
-q path
-p "/sys/block/$DEV" 2>/dev
/null
)
337 # Use positional parameters as an ad-hoc array
338 set -- $
(echo "$sys_path" |
tr / ' ')
342 # Get path up to /sys/.../hostX
345 while [ $i -le "$num_dirs" ] ; do
346 d
=$
(eval echo '$'{$i})
347 scsi_host_dir
="$scsi_host_dir/$d"
348 echo "$d" |
grep -q -E '^host[0-9]+$' && break
352 # Lets grab the SAS host channel number and save it for JBOD sorting later
353 HOSTCHAN
=$
(echo "$d" |
awk -F/ '{ gsub("host","",$NF); print $NF}')
355 if [ $i = "$num_dirs" ] ; then
359 PCI_ID
=$
(eval echo '$'{$
((i
-1))} |
awk -F: '{print $2":"$3}')
361 # In sas_switch mode, the directory four levels beneath
362 # /sys/.../hostX contains symlinks to phy devices that reveal
363 # the switch port number. In sas_direct mode, the phy links one
364 # directory down reveal the HBA port.
365 port_dir
=$scsi_host_dir
368 "sas_switch") j
=$
((i
+ 4)) ;;
369 "sas_direct") j
=$
((i
+ 1)) ;;
374 while [ $i -le $j ] ; do
375 port_dir
="$port_dir/$(eval echo '$'{$i})"
379 PHY
=$
(ls -vd "$port_dir"/phy
* 2>/dev
/null |
head -1 |
awk -F: '{print $NF}')
380 if [ -z "$PHY" ] ; then
383 PORT
=$
((PHY
/ PHYS_PER_PORT
))
385 # Look in /sys/.../sas_device/end_device-X for the bay_identifier
387 end_device_dir
=$port_dir
389 while [ $i -lt "$num_dirs" ] ; do
390 d
=$
(eval echo '$'{$i})
391 end_device_dir
="$end_device_dir/$d"
392 if echo "$d" |
grep -q '^end_device' ; then
393 end_device_dir
="$end_device_dir/sas_device/$d"
399 # Add 'mix' slot type for environments where dm-multipath devices
400 # include end-devices connected via SAS expanders or direct connection
401 # to SAS HBA. A mixed connectivity environment such as pool devices
402 # contained in a SAS JBOD and spare drives or log devices directly
403 # connected in a server backplane without expanders in the I/O path.
408 SLOT
=$
(cat "$end_device_dir/bay_identifier" 2>/dev
/null
)
411 if [ $
(cat "$end_device_dir/bay_identifier" 2>/dev
/null
) ] ; then
412 SLOT
=$
(cat "$end_device_dir/bay_identifier" 2>/dev
/null
)
414 SLOT
=$
(cat "$end_device_dir/phy_identifier" 2>/dev
/null
)
418 SLOT
=$
(cat "$end_device_dir/phy_identifier" 2>/dev
/null
)
421 d
=$
(eval echo '$'{$i})
422 SLOT
=$
(echo "$d" |
sed -e 's/^.*://')
426 d
=$
(eval echo '$'{$i})
427 SLOT
=$
(echo "$d" |
sed -e 's/^.*://')
431 d
=$
(eval echo '$'{$i})
432 SLOT
=$
(echo "$d" |
sed -e 's/^.*://')
435 # Like 'bay' but with the LUN number appened. Added for SAS
436 # multi-actuator HDDs, where one physical drive has multiple
437 # LUNs, thus multiple logical drives share the same bay number
439 d
=$
(eval echo '$'{$i})
440 LUN
="-lun$(echo "$d" | sed -e 's/^.*://')"
441 SLOT
=$
(cat "$end_device_dir/bay_identifier" 2>/dev
/null
)
444 # look for this SAS path in all SCSI Enclosure Services
446 sas_address
=$
(cat "$end_device_dir/sas_address" 2>/dev
/null
)
447 enclosures
=$
(lsscsi
-g | \
448 sed -n -e '/enclosu/s/^.* \([^ ][^ ]*\) *$/\1/p')
449 for enclosure
in $enclosures; do
450 set -- $
(sg_ses
-p aes
"$enclosure" | \
451 awk "/device slot number:/{slot=\$12} \
452 /SAS address: $sas_address/\
455 if [ -n "$SLOT" ] ; then
461 if [ -z "$SLOT" ] ; then
465 if [ "$MULTIJBOD_MODE" = "yes" ] ; then
466 CHAN
=$
(map_channel
"$PCI_ID" "$PORT")
467 SLOT
=$
(map_slot
"$SLOT" "$CHAN")
468 JBOD
=$
(map_jbod
"$DEV")
470 if [ -z "$CHAN" ] ; then
473 echo "${CHAN}"-"${JBOD}"-"${SLOT}${LUN}${PART}"
475 CHAN
=$
(map_channel
"$PCI_ID" "$PORT")
476 SLOT
=$
(map_slot
"$SLOT" "$CHAN")
478 if [ -z "$CHAN" ] ; then
481 echo "${CHAN}${SLOT}${LUN}${PART}"
486 if [ -z "$FIRST_BAY_NUMBER" ] ; then
487 FIRST_BAY_NUMBER
=$
(awk '$1 == "first_bay_number" \
488 {print $2; exit}' $CONFIG)
490 FIRST_BAY_NUMBER
=${FIRST_BAY_NUMBER:-0}
492 if [ -z "$PHYS_PER_PORT" ] ; then
493 PHYS_PER_PORT
=$
(awk '$1 == "phys_per_port" \
494 {print $2; exit}' $CONFIG)
496 PHYS_PER_PORT
=${PHYS_PER_PORT:-4}
498 if ! echo "$PHYS_PER_PORT" |
grep -q -E '^[0-9]+$' ; then
499 echo "Error: phys_per_port value $PHYS_PER_PORT is non-numeric"
503 if [ -z "$MULTIPATH_MODE" ] ; then
504 MULTIPATH_MODE
=$
(awk '$1 == "multipath" \
505 {print $2; exit}' $CONFIG)
508 # Use first running component device if we're handling a dm-mpath device
509 if [ "$MULTIPATH_MODE" = "yes" ] ; then
510 # If udev didn't tell us the UUID via DM_NAME, check /dev/mapper
511 if [ -z "$DM_NAME" ] ; then
512 DM_NAME
=$
(ls -l --full-time /dev
/mapper |
513 grep "$DEV"$ |
awk '{print $9}')
516 # For raw disks udev exports DEVTYPE=partition when
517 # handling partitions, and the rules can be written to
518 # take advantage of this to append a -part suffix. For
519 # dm devices we get DEVTYPE=disk even for partitions so
520 # we have to append the -part suffix directly in the
522 if [ "$DEVTYPE" != "partition" ] ; then
523 # Match p[number], remove the 'p' and prepend "-part"
524 PART
=$
(echo "$DM_NAME" |
525 awk 'match($0,/p[0-9]+$/) {print "-part"substr($0,RSTART+1,RLENGTH-1)}')
528 # Strip off partition information.
529 DM_NAME
=$
(echo "$DM_NAME" |
sed 's/p[0-9][0-9]*$//')
530 if [ -z "$DM_NAME" ] ; then
534 # Get the raw scsi device name from multipath -ll. Strip off
535 # leading pipe symbols to make field numbering consistent.
536 DEV
=$
(multipath
-ll "$DM_NAME" |
537 awk '/running/{gsub("^[|]"," "); print $3 ; exit}')
538 if [ -z "$DEV" ] ; then
543 if echo "$DEV" |
grep -q ^
/devices
/ ; then
546 sys_path
=$
(udevadm info
-q path
-p "/sys/block/$DEV" 2>/dev
/null
)
549 # expect sys_path like this, for example:
550 # /devices/pci0000:00/0000:00:0b.0/0000:09:00.0/0000:0a:05.0/0000:0c:00.0/host3/target3:1:0/3:1:0:21/block/sdv
552 # Use positional parameters as an ad-hoc array
553 set -- $
(echo "$sys_path" |
tr / ' ')
557 # Get path up to /sys/.../hostX
560 while [ $i -le "$num_dirs" ] ; do
561 d
=$
(eval echo '$'{$i})
562 scsi_host_dir
="$scsi_host_dir/$d"
564 echo "$d" |
grep -q -E '^host[0-9]+$' && break
568 if [ $i = "$num_dirs" ] ; then
572 PCI_ID
=$
(eval echo '$'{$
((i
-1))} |
awk -F: '{print $2":"$3}')
574 # In scsi mode, the directory two levels beneath
575 # /sys/.../hostX reveals the port and slot.
576 port_dir
=$scsi_host_dir
580 while [ $i -le $j ] ; do
581 port_dir
="$port_dir/$(eval echo '$'{$i})"
585 set -- $
(echo "$port_dir" |
sed -e 's/^.*:\([^:]*\):\([^:]*\)$/\1 \2/')
587 SLOT
=$
(($2 + FIRST_BAY_NUMBER
))
589 if [ -z "$SLOT" ] ; then
593 CHAN
=$
(map_channel
"$PCI_ID" "$PORT")
594 SLOT
=$
(map_slot
"$SLOT" "$CHAN")
596 if [ -z "$CHAN" ] ; then
599 echo "${CHAN}${SLOT}${PART}"
602 # Figure out the name for the enclosure symlink
603 enclosure_handler
() {
604 # We get all the info we need from udev's DEVPATH variable:
606 # DEVPATH=/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0/host0/subsystem/devices/0:0:0:0/scsi_generic/sg0
608 # Get the enclosure ID ("0:0:0:0")
612 if [ ! -d "/sys/class/enclosure/$ENC" ] ; then
613 # Not an enclosure, bail out
617 # Get the long sysfs device path to our enclosure. Looks like:
618 # /devices/pci0000:00/0000:00:03.0/0000:05:00.0/host0/port-0:0/ ... /enclosure/0:0:0:0
620 ENC_DEVICE
=$
(readlink
"/sys/class/enclosure/$ENC")
622 # Grab the full path to the hosts port dir:
623 # /devices/pci0000:00/0000:00:03.0/0000:05:00.0/host0/port-0:0
624 PORT_DIR
=$
(echo "$ENC_DEVICE" |
grep -Eo '.+host[0-9]+/port-[0-9]+:[0-9]+')
626 # Get the port number
627 PORT_ID
=$
(echo "$PORT_DIR" |
grep -Eo "[0-9]+$")
629 # The PCI directory is two directories up from the port directory
630 # /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0
631 PCI_ID_LONG
="$(readlink -m "/sys
/$PORT_DIR/..
/..
")"
632 PCI_ID_LONG
="${PCI_ID_LONG##*/}"
634 # Strip down the PCI address from 0000:05:00.0 to 05:00.0
635 PCI_ID
="${PCI_ID_LONG#[0-9]*:}"
637 # Name our device according to vdev_id.conf (like "L0" or "U1").
638 NAME
=$
(awk "/channel/{if (\$1 == \"channel\" && \$2 == \"$PCI_ID\" && \
639 \$3 == \"$PORT_ID\") {print \$4\$3}}" $CONFIG)
645 # Special handling is needed to correctly append a -part suffix
646 # to partitions of device mapper devices. The DEVTYPE attribute
647 # is normally set to "disk" instead of "partition" in this case,
648 # so the udev rules won't handle that for us as they do for
649 # "plain" block devices.
651 # For example, we may have the following links for a device and its
654 # /dev/disk/by-id/dm-name-isw_dibgbfcije_ARRAY0 -> ../../dm-0
655 # /dev/disk/by-id/dm-name-isw_dibgbfcije_ARRAY0p1 -> ../../dm-1
656 # /dev/disk/by-id/dm-name-isw_dibgbfcije_ARRAY0p2 -> ../../dm-3
658 # and the following alias in vdev_id.conf.
660 # alias A0 dm-name-isw_dibgbfcije_ARRAY0
662 # The desired outcome is for the following links to be created
663 # without having explicitly defined aliases for the partitions.
665 # /dev/disk/by-vdev/A0 -> ../../dm-0
666 # /dev/disk/by-vdev/A0-part1 -> ../../dm-1
667 # /dev/disk/by-vdev/A0-part2 -> ../../dm-3
669 # Warning: The following grep pattern will misidentify whole-disk
670 # devices whose names end with 'p' followed by a string of
671 # digits as partitions, causing alias creation to fail. This
672 # ambiguity seems unavoidable, so devices using this facility
673 # must not use such names.
675 if echo "$DM_NAME" |
grep -q -E 'p[0-9][0-9]*$' ; then
676 if [ "$DEVTYPE" != "partition" ] ; then
677 # Match p[number], remove the 'p' and prepend "-part"
678 DM_PART
=$
(echo "$DM_NAME" |
679 awk 'match($0,/p[0-9]+$/) {print "-part"substr($0,RSTART+1,RLENGTH-1)}')
683 # DEVLINKS attribute must have been populated by already-run udev rules.
684 for link
in $DEVLINKS ; do
685 # Remove partition information to match key of top-level device.
686 if [ -n "$DM_PART" ] ; then
687 link
=$
(echo "$link" |
sed 's/p[0-9][0-9]*$//')
689 # Check both the fully qualified and the base name of link.
690 for l
in $link ${link##*/} ; do
691 if [ ! -z "$l" ]; then
692 alias=$
(awk -v var
="$l" '($1 == "alias") && \
694 { print $2; exit }' $CONFIG)
695 if [ -n "$alias" ] ; then
696 echo "${alias}${DM_PART}"
705 while getopts 'c:d:eg:jmp:h' OPTION
; do
714 # When udev sees a scsi_generic device, it calls this script with -e to
715 # create the enclosure device symlinks only. We also need
716 # "enclosure_symlinks yes" set in vdev_id.config to actually create the
718 ENCLOSURE_MODE
=$
(awk '{if ($1 == "enclosure_symlinks") \
719 print $2}' "$CONFIG")
721 if [ "$ENCLOSURE_MODE" != "yes" ] ; then
729 PHYS_PER_PORT
=${OPTARG}
743 if [ ! -r "$CONFIG" ] ; then
744 echo "Error: Config file \"$CONFIG\" not found"
748 if [ -z "$DEV" ] && [ -z "$ENCLOSURE_MODE" ] ; then
749 echo "Error: missing required option -d"
753 if [ -z "$TOPOLOGY" ] ; then
754 TOPOLOGY
=$
(awk '($1 == "topology") {print $2; exit}' "$CONFIG")
757 if [ -z "$BAY" ] ; then
758 BAY
=$
(awk '($1 == "slot") {print $2; exit}' "$CONFIG")
761 ZPAD
=$
(awk '($1 == "zpad_slot") {print $2; exit}' "$CONFIG")
763 TOPOLOGY
=${TOPOLOGY:-sas_direct}
765 # Should we create /dev/by-enclosure symlinks?
766 if [ "$ENCLOSURE_MODE" = "yes" ] && [ "$TOPOLOGY" = "sas_direct" ] ; then
767 ID_ENCLOSURE
=$
(enclosure_handler
)
768 if [ -z "$ID_ENCLOSURE" ] ; then
772 # Just create the symlinks to the enclosure devices and then exit.
773 ENCLOSURE_PREFIX
=$
(awk '/enclosure_symlinks_prefix/{print $2}' "$CONFIG")
774 if [ -z "$ENCLOSURE_PREFIX" ] ; then
775 ENCLOSURE_PREFIX
="enc"
777 echo "ID_ENCLOSURE=$ID_ENCLOSURE"
778 echo "ID_ENCLOSURE_PATH=by-enclosure/$ENCLOSURE_PREFIX-$ID_ENCLOSURE"
782 # First check if an alias was defined for this device.
783 ID_VDEV
=$
(alias_handler
)
785 if [ -z "$ID_VDEV" ] ; then
788 sas_direct|sas_switch
)
789 ID_VDEV
=$
(sas_handler
)
792 ID_VDEV
=$
(scsi_handler
)
795 echo "Error: unknown topology $TOPOLOGY"
801 if [ -n "$ID_VDEV" ] ; then
802 echo "ID_VDEV=${ID_VDEV}"
803 echo "ID_VDEV_PATH=disk/by-vdev/${ID_VDEV}"