summaryrefslogtreecommitdiffstats
path: root/udev/rules.d
diff options
context:
space:
mode:
authorNed A. Bass <bass6@zeno1.(none)>2012-04-20 17:32:30 -0700
committerBrian Behlendorf <[email protected]>2012-06-01 08:55:14 -0700
commit821b683436423593a1f3ee597f40a61bd4569bdd (patch)
treea327afe3250cad9feae0ca1bdab8a16c9171b33d /udev/rules.d
parente5b85622771090b7529cffdd38c0402a544609ef (diff)
Add vdev_id for JBOD-friendly udev aliases
vdev_id parses the file /etc/zfs/vdev_id.conf to map a physical path in a storage topology to a channel name. The channel name is combined with a disk enclosure slot number to create an alias that reflects the physical location of the drive. This is particularly helpful when it comes to tasks like replacing failed drives. Slot numbers may also be re-mapped in case the default numbering is unsatisfactory. The drive aliases will be created as symbolic links in /dev/disk/by-vdev. The only currently supported topologies are sas_direct and sas_switch: o sas_direct - a channel is uniquely identified by a PCI slot and a HBA port o sas_switch - a channel is uniquely identified by a SAS switch port A multipath mode is supported in which dm-mpath devices are handled by examining the first running component disk, as reported by 'multipath -l'. In multipath mode the configuration file should contain a channel definition with the same name for each path to a given enclosure. vdev_id can replace the existing zpool_id script on systems where the storage topology conforms to sas_direct or sas_switch. The script could be extended to support other topologies as well. The advantage of vdev_id is that it is driven by a single static input file that can be shared across multiple nodes having a common storage toplogy. zpool_id, on the other hand, requires a unique /etc/zfs/zdev.conf per node and a separate slot-mapping file. However, zpool_id provides the flexibility of using any device names that show up in /dev/disk/by-path, so it may still be needed on some systems. vdev_id's functionality subsumes that of the sas_switch_id script, and it is unlikely that anyone is using it, so sas_switch_id is removed. Finally, /dev/disk/by-vdev is added to the list of directories that 'zpool import' will scan. Signed-off-by: Brian Behlendorf <[email protected]> Closes #713
Diffstat (limited to 'udev/rules.d')
-rw-r--r--udev/rules.d/60-vdev.rules.in9
-rw-r--r--udev/rules.d/Makefile.am2
-rw-r--r--udev/rules.d/Makefile.in2
3 files changed, 13 insertions, 0 deletions
diff --git a/udev/rules.d/60-vdev.rules.in b/udev/rules.d/60-vdev.rules.in
new file mode 100644
index 000000000..a1885d967
--- /dev/null
+++ b/udev/rules.d/60-vdev.rules.in
@@ -0,0 +1,9 @@
+#
+# /lib/udev/rules.d/60-vdev.rules
+#
+
+ENV{DEVTYPE}=="disk", IMPORT{program}="/lib/udev/vdev_id -d %k"
+
+KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
+KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}-part%n"
+KERNEL=="dm-[0-9]*", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
diff --git a/udev/rules.d/Makefile.am b/udev/rules.d/Makefile.am
index bb4eedfe9..586d76a5e 100644
--- a/udev/rules.d/Makefile.am
+++ b/udev/rules.d/Makefile.am
@@ -1,9 +1,11 @@
udevrule_DATA = \
+ $(top_srcdir)/udev/rules.d/60-vdev.rules \
$(top_srcdir)/udev/rules.d/60-zpool.rules \
$(top_srcdir)/udev/rules.d/60-zvol.rules \
$(top_srcdir)/udev/rules.d/90-zfs.rules
EXTRA_DIST = \
+ $(top_srcdir)/udev/rules.d/60-vdev.rules.in \
$(top_srcdir)/udev/rules.d/60-zpool.rules.in \
$(top_srcdir)/udev/rules.d/60-zvol.rules.in \
$(top_srcdir)/udev/rules.d/90-zfs.rules.in
diff --git a/udev/rules.d/Makefile.in b/udev/rules.d/Makefile.in
index d016d1646..2f440e126 100644
--- a/udev/rules.d/Makefile.in
+++ b/udev/rules.d/Makefile.in
@@ -313,11 +313,13 @@ top_srcdir = @top_srcdir@
udevdir = @udevdir@
udevruledir = @udevruledir@
udevrule_DATA = \
+ $(top_srcdir)/udev/rules.d/60-vdev.rules \
$(top_srcdir)/udev/rules.d/60-zpool.rules \
$(top_srcdir)/udev/rules.d/60-zvol.rules \
$(top_srcdir)/udev/rules.d/90-zfs.rules
EXTRA_DIST = \
+ $(top_srcdir)/udev/rules.d/60-vdev.rules.in \
$(top_srcdir)/udev/rules.d/60-zpool.rules.in \
$(top_srcdir)/udev/rules.d/60-zvol.rules.in \
$(top_srcdir)/udev/rules.d/90-zfs.rules.in