From 2957f38d78d376431ab18d2f576099d682d7a711 Mon Sep 17 00:00:00 2001 From: Ned Bass Date: Thu, 29 Nov 2012 11:08:37 -0800 Subject: vdev_id support for device link aliases Add a vdev_id feature to map device names based on already defined udev device links. To increase the odds that vdev_id will run after the rules it depends on, increase the vdev.rules rule number from 60 to 69. With this change, vdev_id now provides functionality analogous to zpool_id and zpool_layout, paving the way to retire those tools. A defined alias takes precedence over a topology-derived name, but the two naming methods can otherwise coexist. For example, one might name drives in a JBOD with the sas_direct topology while naming an internal L2ARC device with an alias. For example, the following lines in vdev_id.conf will result in the creation of links /dev/disk/by-vdev/{d1,d2}, each pointing to the same target as the device link specified in the third field. # by-vdev # name fully qualified or base name of device link alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca alias d2 wwn-0x5000c5002def789e Also perform some minor vdev_id cleanup, such as removal of the unused -s command line option. Signed-off-by: Brian Behlendorf Closes #981 --- man/man5/vdev_id.conf.5 | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'man/man5/vdev_id.conf.5') diff --git a/man/man5/vdev_id.conf.5 b/man/man5/vdev_id.conf.5 index e449360d1..df3f59fc2 100644 --- a/man/man5/vdev_id.conf.5 +++ b/man/man5/vdev_id.conf.5 @@ -17,6 +17,22 @@ keyword is ignored. Comments may optionally begin with a hash character. The following keywords and values are used. +.TP +\fIalias\fR +Maps a device link in the /dev directory hierarchy to a new device +name. The udev rule defining the device link must have run prior to +.BR vdev_id (8). +A defined alias takes precedence over a topology-derived name, but the +two naming methods can otherwise coexist. For example, one might name +drives in a JBOD with the sas_direct topology while naming an internal +L2ARC device with an alias. + +\fIname\fR - the name of the link to the device that will by created in +/dev/disk/by-vdev. + +\fIdevlink\fR - the name of the device link that has already been +defined by udev. This may be an absolute path or the base filename. + .TP \fIchannel\fR [pci_slot] Maps a physical path to a channel name (typically representing a single @@ -59,7 +75,7 @@ a SAS switch port number .TP \fIphys_per_port\fR -Specifies the number of PHY devices are associated with a SAS HBA port or SAS +Specifies the number of PHY devices associated with a SAS HBA port or SAS switch port. .BR vdev_id (8) internally uses this value to determine which HBA or switch port a @@ -150,6 +166,18 @@ definitions - one per physical path. channel 86:00.0 0 B .br .P +A configuration using device link aliases. +.P +.br + # by-vdev +.br + # name fully qualified or base name of device link +.br + alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca +.br + alias d2 wwn-0x5000c5002def789e +.br +.P .SH FILES .TP -- cgit v1.2.3