2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
17 .Nd configuration file for vdev_id(8)
20 is the configuration file for
22 It controls the default behavior of
24 while it is mapping a disk device name to an alias.
28 file uses a simple format consisting of a keyword followed by one or
29 more values on a single line.
30 Any line not beginning with a recognized keyword is ignored.
31 Comments may optionally begin with a hash character.
33 The following keywords and values are used.
35 .It Sy alias Ar name Ar devlink
36 Maps a device link in the
38 directory hierarchy to a new device name.
39 The udev rule defining the device link must have run prior to
41 A defined alias takes precedence over a topology-derived name, but the
42 two naming methods can otherwise coexist.
43 For example, one might name drives in a JBOD with the
45 topology while naming an internal L2ARC device with an alias.
48 is the name of the link to the device that will by created under
49 .Pa /dev/disk/by-vdev .
52 is the name of the device link that has already been
54 This may be an absolute path or the base filename.
56 .It Sy channel [ Ns Ar pci_slot ] Ar port Ar name
57 Maps a physical path to a channel name (typically representing a single
60 .It Sy enclosure_symlinks Sy yes Ns | Ns Sy no
63 symlinks to the disk enclosure
65 devices using the naming scheme from
67 .Sy enclosure_symlinks
72 .It Sy enclosure_symlinks_prefix Ar prefix
73 Specify the prefix for the enclosure symlinks in the form
74 .Pa /dev/by-enclosure/ Ns Ao Ar prefix Ac Ns - Ns Ao Ar channel Ac Ns Aq Ar num
79 .It Sy slot Ar prefix Ar new Op Ar channel
80 Maps a disk slot number as reported by the operating system to an
81 alternative slot number.
84 parameter is specified
85 then the mapping is only applied to slots in the named channel,
86 otherwise the mapping is applied to all channels.
89 rule that can match a slot takes precedence.
90 Therefore a channel-specific mapping for a given slot should generally appear
91 before a generic mapping for the same slot.
92 In this way a custom mapping may be applied to a particular channel
93 and a default mapping applied to the others.
95 .It Sy zpad_slot Ar digits
96 Pad slot numbers with zeros to make them
98 long, which can help to make disk names a consistent length and easier to sort.
100 .It Sy multipath Sy yes Ns | Ns Sy no
103 will handle only dm-multipath devices.
108 will examine the first running component disk of a dm-multipath
109 device as provided by the driver command to determine the physical path.
111 .It Sy topology Sy sas_direct Ns | Ns Sy sas_switch Ns | Ns Sy scsi
112 Identifies a physical topology that governs how physical paths are
114 .Bl -tag -compact -width "sas_direct and scsi"
115 .It Sy sas_direct No and Sy scsi
116 channels are uniquely identified by a PCI slot and HBA port number
118 channels are uniquely identified by a SAS switch port number
121 .It Sy phys_per_port Ar num
122 Specifies the number of PHY devices associated with a SAS HBA port or SAS
125 internally uses this value to determine which HBA or switch port a
126 device is connected to.
130 .It Sy slot Sy bay Ns | Ns Sy phy Ns | Ns Sy port Ns | Ns Sy id Ns | Ns Sy lun Ns | Ns Sy bay_lun Ns | Ns Sy ses
131 Specifies from which element of a SAS identifier the slot number is
135 .Bl -tag -compact -width "port"
137 read the slot number from the bay identifier.
139 read the slot number from the phy identifier.
141 use the SAS port as the slot number.
143 use the scsi id as the slot number.
145 use the scsi lun as the slot number.
147 read the slot number from the bay identifier and append the lun number.
148 Useful for multi-lun multi-actuator hard drives.
150 use the SCSI Enclosure Services (SES) enclosure device slot number,
153 Intended for use only on systems where
160 may be unstable across disk replacement.
165 .Bl -tag -width "-v v"
166 .It Pa /etc/zfs/vdev_id.conf
167 The configuration file for
172 A non-multipath configuration with direct-attached SAS enclosures and an
173 arbitrary slot re-mapping:
174 .Bd -literal -compact -offset Ds
180 # PCI_SLOT HBA PORT CHANNEL NAME
186 # Custom mapping for Channel A
195 # Default mapping for B, C, and D
203 A SAS-switch topology.
206 keyword takes only two arguments in this example:
207 .Bd -literal -compact -offset Ds
210 # SWITCH PORT CHANNEL NAME
217 A multipath configuration.
218 Note that channel names have multiple definitions - one per physical path:
219 .Bd -literal -compact -offset Ds
222 # PCI_SLOT HBA PORT CHANNEL NAME
229 A configuration with enclosure_symlinks enabled:
230 .Bd -literal -compact -offset Ds
232 enclosure_symlinks yes
234 # PCI_ID HBA PORT CHANNEL NAME
240 In addition to the disks symlinks, this configuration will create:
241 .Bd -literal -compact -offset Ds
242 /dev/by-enclosure/enc-L0
243 /dev/by-enclosure/enc-L1
244 /dev/by-enclosure/enc-U0
245 /dev/by-enclosure/enc-U1
248 A configuration using device link aliases:
249 .Bd -literal -compact -offset Ds
251 # name fully qualified or base name of device link
252 alias d1 /dev/disk/by-id/wwn-0x5000c5002de3b9ca
253 alias d2 wwn-0x5000c5002def789e