xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-scrub.8 (revision eda14cbc264d6969b02f2b1994cef11148e914f1)
1*eda14cbcSMatt Macy.\"
2*eda14cbcSMatt Macy.\" CDDL HEADER START
3*eda14cbcSMatt Macy.\"
4*eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
5*eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
6*eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
7*eda14cbcSMatt Macy.\"
8*eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*eda14cbcSMatt Macy.\" or http://www.opensolaris.org/os/licensing.
10*eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
11*eda14cbcSMatt Macy.\" and limitations under the License.
12*eda14cbcSMatt Macy.\"
13*eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
14*eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
16*eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
17*eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
18*eda14cbcSMatt Macy.\"
19*eda14cbcSMatt Macy.\" CDDL HEADER END
20*eda14cbcSMatt Macy.\"
21*eda14cbcSMatt Macy.\"
22*eda14cbcSMatt Macy.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23*eda14cbcSMatt Macy.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24*eda14cbcSMatt Macy.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25*eda14cbcSMatt Macy.\" Copyright (c) 2017 Datto Inc.
26*eda14cbcSMatt Macy.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27*eda14cbcSMatt Macy.\" Copyright 2017 Nexenta Systems, Inc.
28*eda14cbcSMatt Macy.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
29*eda14cbcSMatt Macy.\"
30*eda14cbcSMatt Macy.Dd August 9, 2019
31*eda14cbcSMatt Macy.Dt ZPOOL-SCRUB 8
32*eda14cbcSMatt Macy.Os
33*eda14cbcSMatt Macy.Sh NAME
34*eda14cbcSMatt Macy.Nm zpool Ns Pf - Cm scrub
35*eda14cbcSMatt Macy.Nd Begin a scrub or resume a paused scrub of a ZFS storage pool
36*eda14cbcSMatt Macy.Sh SYNOPSIS
37*eda14cbcSMatt Macy.Nm
38*eda14cbcSMatt Macy.Cm scrub
39*eda14cbcSMatt Macy.Op Fl s | Fl p
40*eda14cbcSMatt Macy.Op Fl w
41*eda14cbcSMatt Macy.Ar pool Ns ...
42*eda14cbcSMatt Macy.Sh DESCRIPTION
43*eda14cbcSMatt Macy.Bl -tag -width Ds
44*eda14cbcSMatt Macy.It Xo
45*eda14cbcSMatt Macy.Nm
46*eda14cbcSMatt Macy.Cm scrub
47*eda14cbcSMatt Macy.Op Fl s | Fl p
48*eda14cbcSMatt Macy.Op Fl w
49*eda14cbcSMatt Macy.Ar pool Ns ...
50*eda14cbcSMatt Macy.Xc
51*eda14cbcSMatt MacyBegins a scrub or resumes a paused scrub.
52*eda14cbcSMatt MacyThe scrub examines all data in the specified pools to verify that it checksums
53*eda14cbcSMatt Macycorrectly.
54*eda14cbcSMatt MacyFor replicated
55*eda14cbcSMatt Macy.Pq mirror or raidz
56*eda14cbcSMatt Macydevices, ZFS automatically repairs any damage discovered during the scrub.
57*eda14cbcSMatt MacyThe
58*eda14cbcSMatt Macy.Nm zpool Cm status
59*eda14cbcSMatt Macycommand reports the progress of the scrub and summarizes the results of the
60*eda14cbcSMatt Macyscrub upon completion.
61*eda14cbcSMatt Macy.Pp
62*eda14cbcSMatt MacyScrubbing and resilvering are very similar operations.
63*eda14cbcSMatt MacyThe difference is that resilvering only examines data that ZFS knows to be out
64*eda14cbcSMatt Macyof date
65*eda14cbcSMatt Macy.Po
66*eda14cbcSMatt Macyfor example, when attaching a new device to a mirror or replacing an existing
67*eda14cbcSMatt Macydevice
68*eda14cbcSMatt Macy.Pc ,
69*eda14cbcSMatt Macywhereas scrubbing examines all data to discover silent errors due to hardware
70*eda14cbcSMatt Macyfaults or disk failure.
71*eda14cbcSMatt Macy.Pp
72*eda14cbcSMatt MacyBecause scrubbing and resilvering are I/O-intensive operations, ZFS only allows
73*eda14cbcSMatt Macyone at a time.
74*eda14cbcSMatt MacyIf a scrub is paused, the
75*eda14cbcSMatt Macy.Nm zpool Cm scrub
76*eda14cbcSMatt Macyresumes it.
77*eda14cbcSMatt MacyIf a resilver is in progress, ZFS does not allow a scrub to be started until the
78*eda14cbcSMatt Macyresilver completes.
79*eda14cbcSMatt Macy.Pp
80*eda14cbcSMatt MacyNote that, due to changes in pool data on a live system, it is possible for
81*eda14cbcSMatt Macyscrubs to progress slightly beyond 100% completion. During this period, no
82*eda14cbcSMatt Macycompletion time estimate will be provided.
83*eda14cbcSMatt Macy.Bl -tag -width Ds
84*eda14cbcSMatt Macy.It Fl s
85*eda14cbcSMatt MacyStop scrubbing.
86*eda14cbcSMatt Macy.El
87*eda14cbcSMatt Macy.Bl -tag -width Ds
88*eda14cbcSMatt Macy.It Fl p
89*eda14cbcSMatt MacyPause scrubbing.
90*eda14cbcSMatt MacyScrub pause state and progress are periodically synced to disk.
91*eda14cbcSMatt MacyIf the system is restarted or pool is exported during a paused scrub,
92*eda14cbcSMatt Macyeven after import, scrub will remain paused until it is resumed.
93*eda14cbcSMatt MacyOnce resumed the scrub will pick up from the place where it was last
94*eda14cbcSMatt Macycheckpointed to disk.
95*eda14cbcSMatt MacyTo resume a paused scrub issue
96*eda14cbcSMatt Macy.Nm zpool Cm scrub
97*eda14cbcSMatt Macyagain.
98*eda14cbcSMatt Macy.It Fl w
99*eda14cbcSMatt MacyWait until scrub has completed before returning.
100*eda14cbcSMatt Macy.El
101*eda14cbcSMatt Macy.El
102*eda14cbcSMatt Macy.Sh SEE ALSO
103*eda14cbcSMatt Macy.Xr zpool-iostat 8 ,
104*eda14cbcSMatt Macy.Xr zpool-resilver 8 ,
105*eda14cbcSMatt Macy.Xr zpool-status 8
106