logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

zpool-scrub.8 (4980B)


  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 November 18, 2024
  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 Ns Fl e | Ns Fl p | Fl s Ns | Fl C Ns
  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. When scrubbing a pool with encrypted filesystems the keys do not need to be
  66. loaded.
  67. However, if the keys are not loaded and an unrepairable checksum error is
  68. detected the file name cannot be included in the
  69. .Nm zpool Cm status Fl v
  70. verbose error report.
  71. .Pp
  72. Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
  73. one at a time.
  74. .Pp
  75. A scrub is split into two parts: metadata scanning and block scrubbing.
  76. The metadata scanning sorts blocks into large sequential ranges which can then
  77. be read much more efficiently from disk when issuing the scrub I/O.
  78. .Pp
  79. If a scrub is paused, the
  80. .Nm zpool Cm scrub
  81. resumes it.
  82. If a resilver is in progress, ZFS does not allow a scrub to be started until the
  83. resilver completes.
  84. .Pp
  85. Note that, due to changes in pool data on a live system, it is possible for
  86. scrubs to progress slightly beyond 100% completion.
  87. During this period, no completion time estimate will be provided.
  88. .
  89. .Sh OPTIONS
  90. .Bl -tag -width "-s"
  91. .It Fl s
  92. Stop scrubbing.
  93. .It Fl p
  94. Pause scrubbing.
  95. Scrub pause state and progress are periodically synced to disk.
  96. If the system is restarted or pool is exported during a paused scrub,
  97. even after import, scrub will remain paused until it is resumed.
  98. Once resumed the scrub will pick up from the place where it was last
  99. checkpointed to disk.
  100. To resume a paused scrub issue
  101. .Nm zpool Cm scrub
  102. or
  103. .Nm zpool Cm scrub
  104. .Fl e
  105. again.
  106. .It Fl w
  107. Wait until scrub has completed before returning.
  108. .It Fl e
  109. Only scrub files with known data errors as reported by
  110. .Nm zpool Cm status Fl v .
  111. The pool must have been scrubbed at least once with the
  112. .Sy head_errlog
  113. feature enabled to use this option.
  114. Error scrubbing cannot be run simultaneously with regular scrubbing or
  115. resilvering, nor can it be run when a regular scrub is paused.
  116. .It Fl C
  117. Continue scrub from last saved txg (see zpool
  118. .Sy last_scrubbed_txg
  119. property).
  120. .El
  121. .Sh EXAMPLES
  122. .Ss Example 1
  123. Status of pool with ongoing scrub:
  124. .sp
  125. .Bd -literal -compact
  126. .No # Nm zpool Cm status
  127. ...
  128. scan: scrub in progress since Sun Jul 25 16:07:49 2021
  129. 403M / 405M scanned at 100M/s, 68.4M / 405M issued at 10.0M/s
  130. 0B repaired, 16.91% done, 00:00:04 to go
  131. ...
  132. .Ed
  133. .Pp
  134. Where metadata which references 403M of file data has been
  135. scanned at 100M/s, and 68.4M of that file data has been
  136. scrubbed sequentially at 10.0M/s.
  137. .Sh PERIODIC SCRUB
  138. On machines using systemd, scrub timers can be enabled on per-pool basis.
  139. .Nm weekly
  140. and
  141. .Nm monthly
  142. timer units are provided.
  143. .Bl -tag -width Ds
  144. .It Xo
  145. .Xc
  146. .Nm systemctl
  147. .Cm enable
  148. .Cm zfs-scrub-\fIweekly\fB@\fIrpool\fB.timer
  149. .Cm --now
  150. .It Xo
  151. .Xc
  152. .Nm systemctl
  153. .Cm enable
  154. .Cm zfs-scrub-\fImonthly\fB@\fIotherpool\fB.timer
  155. .Cm --now
  156. .El
  157. .
  158. .Sh SEE ALSO
  159. .Xr systemd.timer 5 ,
  160. .Xr zpool-iostat 8 ,
  161. .Xr zpool-resilver 8 ,
  162. .Xr zpool-status 8