xref: /freebsd/sys/contrib/openzfs/man/man8/vdev_id.8 (revision 19261079)
1.\"
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
5.\" 1.0 of the CDDL.
6.\"
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.
10.\"
11.Dd May 26, 2021
12.Dt VDEV_ID 8
13.Os
14.
15.Sh NAME
16.Nm vdev_id
17.Nd generate user-friendly names for JBOD disks
18.Sh SYNOPSIS
19.Nm
20.Fl d Ar dev
21.Fl c Ar config_file
22.Fl g Sy sas_direct Ns | Ns Sy sas_switch Ns | Ns Sy scsi
23.Fl m
24.Fl p Ar phys_per_port
25.
26.Sh DESCRIPTION
27.Nm
28is an udev helper which parses
29.Xr vdev_id.conf 5
30to map a physical path in a storage topology to a channel name.
31The channel name is combined with a disk enclosure slot number to create
32an alias that reflects the physical location of the drive.
33This is particularly helpful when it comes to tasks like replacing failed drives.
34Slot numbers may also be remapped in case the default numbering is unsatisfactory.
35The drive aliases will be created as symbolic links in
36.Pa /dev/disk/by-vdev .
37.Pp
38The currently supported topologies are
39.Sy sas_direct ,
40.Sy sas_switch ,
41and
42.Sy scsi .
43A multipath mode is supported in which dm-mpath devices are handled by
44examining the first running component disk as reported by the driver.
45In multipath mode the configuration file should contain a
46channel definition with the same name for each path to a given
47enclosure.
48.Pp
49.Nm
50also supports creating aliases based on existing udev links in the /dev
51hierarchy using the
52.Sy alias
53configuration file keyword.
54See
55.Xr vdev_id.conf 5
56for details.
57.
58.Sh OPTIONS
59.Bl -tag -width "-m"
60.It Fl d Ar device
61The device node to classify, like
62.Pa /dev/sda .
63.It Fl c Ar config_file
64Specifies the path to an alternate configuration file.
65The default is
66.Pa /etc/zfs/vdev_id.conf .
67.It Fl g Sy sas_direct Ns | Ns Sy sas_switch Ns | Ns Sy scsi
68Identifies a physical topology that governs how physical paths are
69mapped to channels:
70.Bl -tag -compact -width "sas_direct and scsi"
71.It Sy sas_direct No and Sy scsi
72channels are uniquely identified by a PCI slot and HBA port number
73.It Sy sas_switch
74channels are uniquely identified by a SAS switch port number
75.El
76.It Fl m
77Only handle dm-multipath devices.
78If specified, examine the first running component disk of a dm-multipath
79device as provided by the driver to determine the physical path.
80.It Fl p Ar phys_per_port
81Specifies the number of PHY devices associated with a SAS HBA port or SAS
82switch port.
83.Nm
84internally uses this value to determine which HBA or switch port a
85device is connected to.
86The default is
87.Sy 4 .
88.It Fl h
89Print a usage summary.
90.El
91.
92.Sh SEE ALSO
93.Xr vdev_id.conf 5
94