mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
2957f38d78
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 <behlendorf1@llnl.gov> Closes #981
78 lines
2.4 KiB
Groff
78 lines
2.4 KiB
Groff
.TH vdev_id 8
|
|
.SH NAME
|
|
vdev_id \- generate user-friendly names for JBOD disks
|
|
.SH SYNOPSIS
|
|
.LP
|
|
.nf
|
|
\fBvdev_id\fR <-d dev> [-c config_file] [-g sas_direct|sas_switch]
|
|
[-m] [-p phys_per_port]
|
|
\fBvdev_id\fR -h
|
|
.fi
|
|
.SH DESCRIPTION
|
|
The \fBvdev_id\fR command is a udev helper which parses the file
|
|
.BR /etc/zfs/vdev_id.conf (5)
|
|
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 currently supported topologies are sas_direct and sas_switch. A
|
|
multipath mode is supported in which dm-mpath devices are handled by
|
|
examining the first-listed running component disk as reported by the
|
|
.BR multipath (8)
|
|
command. In multipath mode the configuration file should contain a
|
|
channel definition with the same name for each path to a given
|
|
enclosure.
|
|
|
|
.BR vdev_id
|
|
also supports creating aliases based on existing udev links in the /dev
|
|
hierarchy using the \fIalias\fR configuration file keyword. See the
|
|
.BR vdev_id.conf (5)
|
|
man page for details.
|
|
|
|
.SH OPTIONS
|
|
.TP
|
|
\fB\-c\fR <config_file>
|
|
Specifies the path to an alternate configuration file. The default is
|
|
/etc/zfs/vdev_id.conf.
|
|
.TP
|
|
\fB\-d\fR <device>
|
|
This is the only mandatory argument. Specifies the name of a device
|
|
in /dev, i.e. "sda".
|
|
.TP
|
|
\fB\-g\fR <sas_direct|sas_switch>
|
|
Identifies a physical topology that governs how physical paths are
|
|
mapped to channels.
|
|
|
|
\fIsas_direct\fR - in this mode a channel is uniquely identified by
|
|
a PCI slot and a HBA port number
|
|
|
|
\fIsas_switch\fR - in this mode a channel is uniquely identified by
|
|
a SAS switch port number
|
|
.TP
|
|
\fB\-m\fR
|
|
Specifies that
|
|
.BR vdev_id (8)
|
|
will handle only dm-multipath devices. If set to "yes" then
|
|
.BR vdev_id (8)
|
|
will examine the first running component disk of a dm-multipath
|
|
device as listed by the
|
|
.BR multipath (8)
|
|
command to determine the physical path.
|
|
.TP
|
|
\fB\-p\fR <phys_per_port>
|
|
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
|
|
device is connected to. The default is 4.
|
|
.TP
|
|
\fB\-h\fR
|
|
Print a usage summary.
|
|
.SH SEE ALSO
|
|
.LP
|
|
\fBvdev_id.conf\fR(5)
|