2019-11-13 20:21:07 +03:00
|
|
|
.\"
|
|
|
|
.\" CDDL HEADER START
|
|
|
|
.\"
|
|
|
|
.\" The contents of this file are subject to the terms of the
|
|
|
|
.\" Common Development and Distribution License (the "License").
|
|
|
|
.\" You may not use this file except in compliance with the License.
|
|
|
|
.\"
|
|
|
|
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
|
|
.\" or http://www.opensolaris.org/os/licensing.
|
|
|
|
.\" See the License for the specific language governing permissions
|
|
|
|
.\" and limitations under the License.
|
|
|
|
.\"
|
|
|
|
.\" When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
.\" If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
.\" fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
.\" information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
.\"
|
|
|
|
.\" CDDL HEADER END
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
|
|
|
|
.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
|
|
|
|
.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
|
|
|
|
.\" Copyright (c) 2017 Datto Inc.
|
2021-08-06 00:30:28 +03:00
|
|
|
.\" Copyright (c) 2018, 2021 George Melikov. All Rights Reserved.
|
2019-11-13 20:21:07 +03:00
|
|
|
.\" Copyright 2017 Nexenta Systems, Inc.
|
|
|
|
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
|
|
|
|
.\"
|
2021-08-06 00:30:28 +03:00
|
|
|
.Dd July 25, 2021
|
2019-11-13 20:21:07 +03:00
|
|
|
.Dt ZPOOL-SCRUB 8
|
2020-08-21 21:55:47 +03:00
|
|
|
.Os
|
2021-05-27 03:46:40 +03:00
|
|
|
.
|
2019-11-13 20:21:07 +03:00
|
|
|
.Sh NAME
|
2020-10-22 21:28:10 +03:00
|
|
|
.Nm zpool-scrub
|
2021-05-27 03:46:40 +03:00
|
|
|
.Nd begin or resume scrub of ZFS storage pools
|
2019-11-13 20:21:07 +03:00
|
|
|
.Sh SYNOPSIS
|
2020-10-22 21:28:10 +03:00
|
|
|
.Nm zpool
|
2019-11-13 20:21:07 +03:00
|
|
|
.Cm scrub
|
2021-05-27 03:46:40 +03:00
|
|
|
.Op Fl s Ns | Ns Fl p
|
2019-11-13 20:21:07 +03:00
|
|
|
.Op Fl w
|
2021-05-27 03:46:40 +03:00
|
|
|
.Ar pool Ns …
|
|
|
|
.
|
2019-11-13 20:21:07 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
Begins a scrub or resumes a paused scrub.
|
|
|
|
The scrub examines all data in the specified pools to verify that it checksums
|
|
|
|
correctly.
|
|
|
|
For replicated
|
Distributed Spare (dRAID) Feature
This patch adds a new top-level vdev type called dRAID, which stands
for Distributed parity RAID. This pool configuration allows all dRAID
vdevs to participate when rebuilding to a distributed hot spare device.
This can substantially reduce the total time required to restore full
parity to pool with a failed device.
A dRAID pool can be created using the new top-level `draid` type.
Like `raidz`, the desired redundancy is specified after the type:
`draid[1,2,3]`. No additional information is required to create the
pool and reasonable default values will be chosen based on the number
of child vdevs in the dRAID vdev.
zpool create <pool> draid[1,2,3] <vdevs...>
Unlike raidz, additional optional dRAID configuration values can be
provided as part of the draid type as colon separated values. This
allows administrators to fully specify a layout for either performance
or capacity reasons. The supported options include:
zpool create <pool> \
draid[<parity>][:<data>d][:<children>c][:<spares>s] \
<vdevs...>
- draid[parity] - Parity level (default 1)
- draid[:<data>d] - Data devices per group (default 8)
- draid[:<children>c] - Expected number of child vdevs
- draid[:<spares>s] - Distributed hot spares (default 0)
Abbreviated example `zpool status` output for a 68 disk dRAID pool
with two distributed spares using special allocation classes.
```
pool: tank
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
slag7 ONLINE 0 0 0
draid2:8d:68c:2s-0 ONLINE 0 0 0
L0 ONLINE 0 0 0
L1 ONLINE 0 0 0
...
U25 ONLINE 0 0 0
U26 ONLINE 0 0 0
spare-53 ONLINE 0 0 0
U27 ONLINE 0 0 0
draid2-0-0 ONLINE 0 0 0
U28 ONLINE 0 0 0
U29 ONLINE 0 0 0
...
U42 ONLINE 0 0 0
U43 ONLINE 0 0 0
special
mirror-1 ONLINE 0 0 0
L5 ONLINE 0 0 0
U5 ONLINE 0 0 0
mirror-2 ONLINE 0 0 0
L6 ONLINE 0 0 0
U6 ONLINE 0 0 0
spares
draid2-0-0 INUSE currently in use
draid2-0-1 AVAIL
```
When adding test coverage for the new dRAID vdev type the following
options were added to the ztest command. These options are leverages
by zloop.sh to test a wide range of dRAID configurations.
-K draid|raidz|random - kind of RAID to test
-D <value> - dRAID data drives per group
-S <value> - dRAID distributed hot spares
-R <value> - RAID parity (raidz or dRAID)
The zpool_create, zpool_import, redundancy, replacement and fault
test groups have all been updated provide test coverage for the
dRAID feature.
Co-authored-by: Isaac Huang <he.huang@intel.com>
Co-authored-by: Mark Maybee <mmaybee@cray.com>
Co-authored-by: Don Brady <don.brady@delphix.com>
Co-authored-by: Matthew Ahrens <mahrens@delphix.com>
Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mmaybee@cray.com>
Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10102
2020-11-14 00:51:51 +03:00
|
|
|
.Pq mirror, raidz, or draid
|
2019-11-13 20:21:07 +03:00
|
|
|
devices, ZFS automatically repairs any damage discovered during the scrub.
|
|
|
|
The
|
|
|
|
.Nm zpool Cm status
|
|
|
|
command reports the progress of the scrub and summarizes the results of the
|
|
|
|
scrub upon completion.
|
|
|
|
.Pp
|
|
|
|
Scrubbing and resilvering are very similar operations.
|
|
|
|
The difference is that resilvering only examines data that ZFS knows to be out
|
|
|
|
of date
|
|
|
|
.Po
|
|
|
|
for example, when attaching a new device to a mirror or replacing an existing
|
|
|
|
device
|
|
|
|
.Pc ,
|
|
|
|
whereas scrubbing examines all data to discover silent errors due to hardware
|
|
|
|
faults or disk failure.
|
|
|
|
.Pp
|
|
|
|
Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
|
|
|
|
one at a time.
|
2021-08-06 00:30:28 +03:00
|
|
|
.Pp
|
|
|
|
A scrub is split into two parts: metadata scanning and block scrubbing.
|
|
|
|
The metadata scanning sorts blocks into large sequential ranges which can then
|
|
|
|
be read much more efficiently from disk when issuing the scrub I/O.
|
|
|
|
.Pp
|
2019-11-13 20:21:07 +03:00
|
|
|
If a scrub is paused, the
|
|
|
|
.Nm zpool Cm scrub
|
|
|
|
resumes it.
|
|
|
|
If a resilver is in progress, ZFS does not allow a scrub to be started until the
|
|
|
|
resilver completes.
|
|
|
|
.Pp
|
|
|
|
Note that, due to changes in pool data on a live system, it is possible for
|
2021-05-27 03:46:40 +03:00
|
|
|
scrubs to progress slightly beyond 100% completion.
|
|
|
|
During this period, no completion time estimate will be provided.
|
|
|
|
.
|
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width "-s"
|
2019-11-13 20:21:07 +03:00
|
|
|
.It Fl s
|
|
|
|
Stop scrubbing.
|
|
|
|
.It Fl p
|
|
|
|
Pause scrubbing.
|
|
|
|
Scrub pause state and progress are periodically synced to disk.
|
|
|
|
If the system is restarted or pool is exported during a paused scrub,
|
|
|
|
even after import, scrub will remain paused until it is resumed.
|
|
|
|
Once resumed the scrub will pick up from the place where it was last
|
|
|
|
checkpointed to disk.
|
|
|
|
To resume a paused scrub issue
|
|
|
|
.Nm zpool Cm scrub
|
|
|
|
again.
|
|
|
|
.It Fl w
|
|
|
|
Wait until scrub has completed before returning.
|
|
|
|
.El
|
2021-08-06 00:30:28 +03:00
|
|
|
.Sh EXAMPLES
|
2022-03-16 19:46:32 +03:00
|
|
|
.Ss Example 1 : No Status of pool with ongoing scrub:
|
|
|
|
.Bd -literal -compact
|
2021-08-06 00:30:28 +03:00
|
|
|
.No # Nm zpool Cm status
|
|
|
|
...
|
|
|
|
scan: scrub in progress since Sun Jul 25 16:07:49 2021
|
|
|
|
403M scanned at 100M/s, 68.4M issued at 10.0M/s, 405M total
|
|
|
|
0B repaired, 16.91% done, 00:00:04 to go
|
|
|
|
...
|
|
|
|
.Ed
|
2022-03-16 19:46:32 +03:00
|
|
|
.Pp
|
|
|
|
Where metadata which references 403M of file data has been
|
2021-08-06 00:30:28 +03:00
|
|
|
scanned at 100M/s, and 68.4M of that file data has been
|
|
|
|
scrubbed sequentially at 10.0M/s.
|
2021-12-16 22:47:22 +03:00
|
|
|
.Sh PERIODIC SCRUB
|
|
|
|
On machines using systemd, scrub timers can be enabled on per-pool basis.
|
|
|
|
.Nm weekly
|
|
|
|
and
|
|
|
|
.Nm monthly
|
|
|
|
timer units are provided.
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Xo
|
|
|
|
.Xc
|
|
|
|
.Nm systemctl
|
|
|
|
.Cm enable
|
|
|
|
.Cm zfs-scrub-\fIweekly\fB@\fIrpool\fB.timer
|
|
|
|
.Cm --now
|
|
|
|
.It Xo
|
|
|
|
.Xc
|
|
|
|
.Nm systemctl
|
|
|
|
.Cm enable
|
|
|
|
.Cm zfs-scrub-\fImonthly\fB@\fIotherpool\fB.timer
|
|
|
|
.Cm --now
|
|
|
|
.El
|
2021-05-27 03:46:40 +03:00
|
|
|
.
|
2019-11-13 20:21:07 +03:00
|
|
|
.Sh SEE ALSO
|
2021-12-16 22:47:22 +03:00
|
|
|
.Xr systemd.timer 5 ,
|
2019-11-13 20:21:07 +03:00
|
|
|
.Xr zpool-iostat 8 ,
|
|
|
|
.Xr zpool-resilver 8 ,
|
|
|
|
.Xr zpool-status 8
|