xref: /freebsd/cddl/usr.sbin/zfsd/zfsd.8 (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1.\"-
2.\" Copyright (c) 2016 Allan Jude
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.Dd February 20, 2024
27.Dt ZFSD 8
28.Os
29.Sh NAME
30.Nm zfsd
31.Nd ZFS fault management daemon
32.Sh SYNOPSIS
33.Nm
34.Op Fl d
35.Sh DESCRIPTION
36.Nm
37attempts to resolve ZFS faults that the kernel can't resolve by itself.
38It listens to
39.Xr devctl 4
40events, which are how the kernel notifies userland of events such as I/O
41errors and disk removals.
42.Nm
43attempts to resolve these faults by activating or deactivating hot spares
44and onlining offline vdevs.
45.Pp
46The following options are available:
47.Bl -tag -width indent
48.It Fl d
49Run in the foreground instead of daemonizing.
50.El
51.Pp
52System administrators never interact with
53.Nm
54directly.
55Instead, they control its behavior indirectly through zpool configuration.
56There are two ways to influence
57.Nm :
58assigning hot spares and setting pool properties.
59Currently, only the
60.Em autoreplace
61property has any effect.
62See
63.Xr zpool 8
64for details.
65.Pp
66.Nm
67will attempt to resolve the following types of fault:
68.Bl -tag -width a
69.It device removal
70When a leaf vdev disappears,
71.Nm
72will activate any available hot spare.
73.It device arrival
74When a new GEOM device appears,
75.Nm
76will attempt to read its ZFS label, if any.
77If it matches a previously removed vdev on an active pool,
78.Nm
79will online it.
80Once resilvering completes, any active hot spare will detach automatically.
81.Pp
82If the new device has no ZFS label but its physical path matches the
83physical path of a previously removed vdev on an active pool, and that
84pool has the autoreplace property set, then
85.Nm
86will replace the missing vdev with the newly arrived device.
87Once resilvering completes, any active hot spare will detach automatically.
88.It vdev degrade or fault events
89If a vdev becomes degraded or faulted,
90.Nm
91will activate any available hot spare.
92.It I/O errors
93By default, if a leaf vdev generates more than 50 I/O errors in a 60 second
94period, then
95.Nm
96will mark that vdev as
97.Em FAULTED .
98ZFS will no longer issue any I/Os to it.
99.Nm
100will activate a hot spare if one is available. The defaults can be changed by
101setting the
102.Em io_n
103and/or
104.Em io_t
105vdev properties. See
106.Xr vdevprops 7
107for details.
108.It I/O delays
109By default, if a leaf vdev generates more than delayed 8 I/O events in a 60
110second period, then
111.Nm
112will mark that vdev as
113.Em FAULTED .
114ZFS will no longer issue any I/Os to it.
115.Nm
116will activate a hot spare if one is available. The defaults can be changed by
117setting the
118.Em slow_io_n
119and/or
120.Em slow_io_t
121vdev properties. See
122.Xr vdevprops 7
123for details.
124.It Checksum errors
125By default, if a leaf vdev generates more than 50 checksum errors in a 60
126second period, then
127.Nm
128will mark that vdev as
129.Em DEGRADED .
130ZFS will still use it, but zfsd will also activate a hot spare if one is
131available. The defaults can be changed by setting the
132.Em checksum_n
133and/or
134.Em checksum_t
135vdev properties. See
136.Xr vdevprops 7
137for details.
138.It Spare addition
139If the system administrator adds a hot spare to a pool that is already degraded,
140.Nm
141will activate the spare.
142.It Resilver complete
143.Nm
144will detach any hot spare once a permanent replacement finishes resilvering.
145.It Physical path change
146If the physical path of an existing disk changes,
147.Nm
148will attempt to replace any missing disk with the same physical path,
149if its pool's autoreplace property is set.
150.El
151.Pp
152.Nm
153will log interesting events and its actions to syslog with facility
154.Em daemon
155and identity
156.Op zfsd .
157.El
158.Sh FILES
159.Bl -tag -width a -compact
160.It Pa /var/db/zfsd/cases
161When
162.Nm
163exits, it serializes any unresolved casefiles here,
164then reads them back in when next it starts up.
165.El
166.Sh SEE ALSO
167.Xr devctl 4 ,
168.Xr vdevprops 7 ,
169.Xr zpool 8
170.Sh HISTORY
171.Nm
172first appeared in
173.Fx 11.0 .
174.Sh AUTHORS
175.Nm
176was originally written by
177.An Justin Gibbs Aq Mt gibbs@FreeBSD.org
178and
179.An Alan Somers Aq Mt asomers@FreeBSD.org
180.Sh TODO
181In the future,
182.Nm
183should be able to resume a pool that became suspended due to device
184removals, if enough missing devices have returned.
185