xref: /freebsd/cddl/usr.sbin/zfsd/zfsd.8 (revision c801836ff43deea3c86935abcad1069bfcd3989c)
17a0c41d5SAlan Somers.\"-
27a0c41d5SAlan Somers.\" Copyright (c) 2016 Allan Jude
37a0c41d5SAlan Somers.\" All rights reserved.
47a0c41d5SAlan Somers.\"
57a0c41d5SAlan Somers.\" Redistribution and use in source and binary forms, with or without
67a0c41d5SAlan Somers.\" modification, are permitted provided that the following conditions
77a0c41d5SAlan Somers.\" are met:
87a0c41d5SAlan Somers.\" 1. Redistributions of source code must retain the above copyright
97a0c41d5SAlan Somers.\"    notice, this list of conditions and the following disclaimer.
107a0c41d5SAlan Somers.\" 2. Redistributions in binary form must reproduce the above copyright
117a0c41d5SAlan Somers.\"    notice, this list of conditions and the following disclaimer in the
127a0c41d5SAlan Somers.\"    documentation and/or other materials provided with the distribution.
137a0c41d5SAlan Somers.\"
147a0c41d5SAlan Somers.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
157a0c41d5SAlan Somers.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
167a0c41d5SAlan Somers.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
177a0c41d5SAlan Somers.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
187a0c41d5SAlan Somers.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
197a0c41d5SAlan Somers.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
207a0c41d5SAlan Somers.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
217a0c41d5SAlan Somers.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
227a0c41d5SAlan Somers.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
237a0c41d5SAlan Somers.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
247a0c41d5SAlan Somers.\" SUCH DAMAGE.
257a0c41d5SAlan Somers.\"
26*89f4f91dSAlan Somers.Dd February 20, 2024
277a0c41d5SAlan Somers.Dt ZFSD 8
287a0c41d5SAlan Somers.Os
297a0c41d5SAlan Somers.Sh NAME
307a0c41d5SAlan Somers.Nm zfsd
317a0c41d5SAlan Somers.Nd ZFS fault management daemon
327a0c41d5SAlan Somers.Sh SYNOPSIS
337a0c41d5SAlan Somers.Nm
347a0c41d5SAlan Somers.Op Fl d
357a0c41d5SAlan Somers.Sh DESCRIPTION
367a0c41d5SAlan Somers.Nm
377a0c41d5SAlan Somersattempts to resolve ZFS faults that the kernel can't resolve by itself.
387a0c41d5SAlan SomersIt listens to
397a0c41d5SAlan Somers.Xr devctl 4
407a0c41d5SAlan Somersevents, which are how the kernel notifies userland of events such as I/O
417a0c41d5SAlan Somerserrors and disk removals.
427a0c41d5SAlan Somers.Nm
437a0c41d5SAlan Somersattempts to resolve these faults by activating or deactivating hot spares
447a0c41d5SAlan Somersand onlining offline vdevs.
457a0c41d5SAlan Somers.Pp
467a0c41d5SAlan SomersThe following options are available:
477a0c41d5SAlan Somers.Bl -tag -width indent
487a0c41d5SAlan Somers.It Fl d
497a0c41d5SAlan SomersRun in the foreground instead of daemonizing.
507a0c41d5SAlan Somers.El
517a0c41d5SAlan Somers.Pp
527a0c41d5SAlan SomersSystem administrators never interact with
537a0c41d5SAlan Somers.Nm
547a0c41d5SAlan Somersdirectly.
557a0c41d5SAlan SomersInstead, they control its behavior indirectly through zpool configuration.
567a0c41d5SAlan SomersThere are two ways to influence
577a0c41d5SAlan Somers.Nm :
587a0c41d5SAlan Somersassigning hot spares and setting pool properties.
597a0c41d5SAlan SomersCurrently, only the
607a0c41d5SAlan Somers.Em autoreplace
617a0c41d5SAlan Somersproperty has any effect.
627a0c41d5SAlan SomersSee
637a0c41d5SAlan Somers.Xr zpool 8
647a0c41d5SAlan Somersfor details.
657a0c41d5SAlan Somers.Pp
667a0c41d5SAlan Somers.Nm
677a0c41d5SAlan Somerswill attempt to resolve the following types of fault:
687a0c41d5SAlan Somers.Bl -tag -width a
697a0c41d5SAlan Somers.It device removal
707a0c41d5SAlan SomersWhen a leaf vdev disappears,
717a0c41d5SAlan Somers.Nm
727a0c41d5SAlan Somerswill activate any available hot spare.
737a0c41d5SAlan Somers.It device arrival
747a0c41d5SAlan SomersWhen a new GEOM device appears,
757a0c41d5SAlan Somers.Nm
767a0c41d5SAlan Somerswill attempt to read its ZFS label, if any.
777a0c41d5SAlan SomersIf it matches a previously removed vdev on an active pool,
787a0c41d5SAlan Somers.Nm
797a0c41d5SAlan Somerswill online it.
807a0c41d5SAlan SomersOnce resilvering completes, any active hot spare will detach automatically.
817a0c41d5SAlan Somers.Pp
827a0c41d5SAlan SomersIf the new device has no ZFS label but its physical path matches the
837a0c41d5SAlan Somersphysical path of a previously removed vdev on an active pool, and that
847a0c41d5SAlan Somerspool has the autoreplace property set, then
857a0c41d5SAlan Somers.Nm
867a0c41d5SAlan Somerswill replace the missing vdev with the newly arrived device.
877a0c41d5SAlan SomersOnce resilvering completes, any active hot spare will detach automatically.
887a0c41d5SAlan Somers.It vdev degrade or fault events
897a0c41d5SAlan SomersIf a vdev becomes degraded or faulted,
907a0c41d5SAlan Somers.Nm
917a0c41d5SAlan Somerswill activate any available hot spare.
927a0c41d5SAlan Somers.It I/O errors
93*89f4f91dSAlan SomersBy default, if a leaf vdev generates more than 50 I/O errors in a 60 second
94*89f4f91dSAlan Somersperiod, then
957a0c41d5SAlan Somers.Nm
967a0c41d5SAlan Somerswill mark that vdev as
977a0c41d5SAlan Somers.Em FAULTED .
9835f13913SAlan SomersZFS will no longer issue any I/Os to it.
997a0c41d5SAlan Somers.Nm
100*89f4f91dSAlan Somerswill activate a hot spare if one is available. The defaults can be changed by
101*89f4f91dSAlan Somerssetting the
102*89f4f91dSAlan Somers.Em io_n
103*89f4f91dSAlan Somersand/or
104*89f4f91dSAlan Somers.Em io_t
105*89f4f91dSAlan Somersvdev properties. See
106*89f4f91dSAlan Somers.Xr vdevprops 7
107*89f4f91dSAlan Somersfor details.
108*89f4f91dSAlan Somers.It I/O delays
109*89f4f91dSAlan SomersBy default, if a leaf vdev generates more than delayed 8 I/O events in a 60
110*89f4f91dSAlan Somerssecond period, then
111*89f4f91dSAlan Somers.Nm
112*89f4f91dSAlan Somerswill mark that vdev as
113*89f4f91dSAlan Somers.Em FAULTED .
114*89f4f91dSAlan SomersZFS will no longer issue any I/Os to it.
115*89f4f91dSAlan Somers.Nm
116*89f4f91dSAlan Somerswill activate a hot spare if one is available. The defaults can be changed by
117*89f4f91dSAlan Somerssetting the
118*89f4f91dSAlan Somers.Em slow_io_n
119*89f4f91dSAlan Somersand/or
120*89f4f91dSAlan Somers.Em slow_io_t
121*89f4f91dSAlan Somersvdev properties. See
122*89f4f91dSAlan Somers.Xr vdevprops 7
123*89f4f91dSAlan Somersfor details.
1247a0c41d5SAlan Somers.It Checksum errors
125*89f4f91dSAlan SomersBy default, if a leaf vdev generates more than 50 checksum errors in a 60
126*89f4f91dSAlan Somerssecond period, then
1277a0c41d5SAlan Somers.Nm
1287a0c41d5SAlan Somerswill mark that vdev as
1297a0c41d5SAlan Somers.Em DEGRADED .
130*89f4f91dSAlan SomersZFS will still use it, but zfsd will also activate a hot spare if one is
131*89f4f91dSAlan Somersavailable. The defaults can be changed by setting the
132*89f4f91dSAlan Somers.Em checksum_n
133*89f4f91dSAlan Somersand/or
134*89f4f91dSAlan Somers.Em checksum_t
135*89f4f91dSAlan Somersvdev properties. See
136*89f4f91dSAlan Somers.Xr vdevprops 7
137*89f4f91dSAlan Somersfor details.
1387a0c41d5SAlan Somers.It Spare addition
1397a0c41d5SAlan SomersIf the system administrator adds a hot spare to a pool that is already degraded,
1407a0c41d5SAlan Somers.Nm
1417a0c41d5SAlan Somerswill activate the spare.
1427a0c41d5SAlan Somers.It Resilver complete
1437a0c41d5SAlan Somers.Nm
1447a0c41d5SAlan Somerswill detach any hot spare once a permanent replacement finishes resilvering.
1457a0c41d5SAlan Somers.It Physical path change
1467a0c41d5SAlan SomersIf the physical path of an existing disk changes,
1477a0c41d5SAlan Somers.Nm
1487a0c41d5SAlan Somerswill attempt to replace any missing disk with the same physical path,
1497a0c41d5SAlan Somersif its pool's autoreplace property is set.
1507a0c41d5SAlan Somers.El
1517a0c41d5SAlan Somers.Pp
1527a0c41d5SAlan Somers.Nm
1537a0c41d5SAlan Somerswill log interesting events and its actions to syslog with facility
1547a0c41d5SAlan Somers.Em daemon
1557a0c41d5SAlan Somersand identity
1567a0c41d5SAlan Somers.Op zfsd .
1577a0c41d5SAlan Somers.Sh FILES
1587a0c41d5SAlan Somers.Bl -tag -width a -compact
1597a0c41d5SAlan Somers.It Pa /var/db/zfsd/cases
1607a0c41d5SAlan SomersWhen
1617a0c41d5SAlan Somers.Nm
1627a0c41d5SAlan Somersexits, it serializes any unresolved casefiles here,
1637a0c41d5SAlan Somersthen reads them back in when next it starts up.
1647a0c41d5SAlan Somers.El
1657a0c41d5SAlan Somers.Sh SEE ALSO
1667a0c41d5SAlan Somers.Xr devctl 4 ,
167*89f4f91dSAlan Somers.Xr vdevprops 7 ,
1687a0c41d5SAlan Somers.Xr zpool 8
1697a0c41d5SAlan Somers.Sh HISTORY
1707a0c41d5SAlan Somers.Nm
1717a0c41d5SAlan Somersfirst appeared in
1727a0c41d5SAlan Somers.Fx 11.0 .
1737a0c41d5SAlan Somers.Sh AUTHORS
1747a0c41d5SAlan Somers.Nm
1757a0c41d5SAlan Somerswas originally written by
1767a0c41d5SAlan Somers.An Justin Gibbs Aq Mt gibbs@FreeBSD.org
1777a0c41d5SAlan Somersand
1787a0c41d5SAlan Somers.An Alan Somers Aq Mt asomers@FreeBSD.org
1797a0c41d5SAlan Somers.Sh TODO
1807a0c41d5SAlan SomersIn the future,
1817a0c41d5SAlan Somers.Nm
1827a0c41d5SAlan Somersshould be able to resume a pool that became suspended due to device
1837a0c41d5SAlan Somersremovals, if enough missing devices have returned.
184