The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/man/man8/zpool-scrub.8

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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 https://opensource.org/licenses/CDDL-1.0.
   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, 2021 George Melikov. All Rights Reserved.
   26 .\" Copyright 2017 Nexenta Systems, Inc.
   27 .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
   28 .\"
   29 .Dd July 25, 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
   44 Begins a scrub or resumes a paused scrub.
   45 The scrub examines all data in the specified pools to verify that it checksums
   46 correctly.
   47 For replicated
   48 .Pq mirror, raidz, or draid
   49 devices, ZFS automatically repairs any damage discovered during the scrub.
   50 The
   51 .Nm zpool Cm status
   52 command reports the progress of the scrub and summarizes the results of the
   53 scrub upon completion.
   54 .Pp
   55 Scrubbing and resilvering are very similar operations.
   56 The difference is that resilvering only examines data that ZFS knows to be out
   57 of date
   58 .Po
   59 for example, when attaching a new device to a mirror or replacing an existing
   60 device
   61 .Pc ,
   62 whereas scrubbing examines all data to discover silent errors due to hardware
   63 faults or disk failure.
   64 .Pp
   65 Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
   66 one at a time.
   67 .Pp
   68 A scrub is split into two parts: metadata scanning and block scrubbing.
   69 The metadata scanning sorts blocks into large sequential ranges which can then
   70 be read much more efficiently from disk when issuing the scrub I/O.
   71 .Pp
   72 If a scrub is paused, the
   73 .Nm zpool Cm scrub
   74 resumes it.
   75 If a resilver is in progress, ZFS does not allow a scrub to be started until the
   76 resilver completes.
   77 .Pp
   78 Note that, due to changes in pool data on a live system, it is possible for
   79 scrubs to progress slightly beyond 100% completion.
   80 During this period, no completion time estimate will be provided.
   81 .
   82 .Sh OPTIONS
   83 .Bl -tag -width "-s"
   84 .It Fl s
   85 Stop scrubbing.
   86 .It Fl p
   87 Pause scrubbing.
   88 Scrub pause state and progress are periodically synced to disk.
   89 If the system is restarted or pool is exported during a paused scrub,
   90 even after import, scrub will remain paused until it is resumed.
   91 Once resumed the scrub will pick up from the place where it was last
   92 checkpointed to disk.
   93 To resume a paused scrub issue
   94 .Nm zpool Cm scrub
   95 again.
   96 .It Fl w
   97 Wait until scrub has completed before returning.
   98 .El
   99 .Sh EXAMPLES
  100 .Ss Example 1
  101 Status of pool with ongoing scrub:
  102 .sp
  103 .Bd -literal -compact
  104 .No # Nm zpool Cm status
  105   ...
  106   scan: scrub in progress since Sun Jul 25 16:07:49 2021
  107         403M scanned at 100M/s, 68.4M issued at 10.0M/s, 405M total
  108         0B repaired, 16.91% done, 00:00:04 to go
  109   ...
  110 .Ed
  111 .Pp
  112 Where metadata which references 403M of file data has been
  113 scanned at 100M/s, and 68.4M of that file data has been
  114 scrubbed sequentially at 10.0M/s.
  115 .Sh PERIODIC SCRUB
  116 On machines using systemd, scrub timers can be enabled on per-pool basis.
  117 .Nm weekly
  118 and
  119 .Nm monthly
  120 timer units are provided.
  121 .Bl -tag -width Ds
  122 .It Xo
  123 .Xc
  124 .Nm systemctl
  125 .Cm enable
  126 .Cm zfs-scrub-\fIweekly\fB@\fIrpool\fB.timer
  127 .Cm --now
  128 .It Xo
  129 .Xc
  130 .Nm systemctl
  131 .Cm enable
  132 .Cm zfs-scrub-\fImonthly\fB@\fIotherpool\fB.timer
  133 .Cm --now
  134 .El
  135 .
  136 .Sh SEE ALSO
  137 .Xr systemd.timer 5 ,
  138 .Xr zpool-iostat 8 ,
  139 .Xr zpool-resilver 8 ,
  140 .Xr zpool-status 8

Cache object: 101d20e2cb4a1d2ec257af178992beb7


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.