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