mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Implemented zpool scrub pause/resume
Currently, there is no way to pause a scrub. Pausing may be useful when the pool is busy with other I/O to preserve bandwidth. This patch adds the ability to pause and resume scrubbing. This is achieved by maintaining a persistent on-disk scrub state. While the state is 'paused' we do not scrub any more blocks. We do however perform regular scan housekeeping such as freeing async destroyed and deadlist blocks while paused. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Thomas Caputi <tcaputi@datto.com> Reviewed-by: Serapheim Dimitropoulos <serapheimd@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alek Pinchuk <apinchuk@datto.com> Closes #6167
This commit is contained in:
+17
-6
@@ -25,8 +25,9 @@
|
||||
.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
|
||||
.\" Copyright (c) 2017 Datto Inc.
|
||||
.\" Copyright (c) 2017 George Melikov. All Rights Reserved.
|
||||
.\" Copyright (c) 2017 Datto Inc.
|
||||
.\"
|
||||
.Dd June 22, 2017
|
||||
.Dd June 28, 2017
|
||||
.Dt ZPOOL 8 SMM
|
||||
.Os Linux
|
||||
.Sh NAME
|
||||
@@ -151,7 +152,7 @@
|
||||
.Ar pool Ar device Op Ar new_device
|
||||
.Nm
|
||||
.Cm scrub
|
||||
.Op Fl s
|
||||
.Op Fl s | Fl p
|
||||
.Ar pool Ns ...
|
||||
.Nm
|
||||
.Cm set
|
||||
@@ -1769,10 +1770,10 @@ The only property supported at the moment is
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm scrub
|
||||
.Op Fl s
|
||||
.Op Fl s | Fl p
|
||||
.Ar pool Ns ...
|
||||
.Xc
|
||||
Begins a scrub.
|
||||
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
|
||||
@@ -1795,15 +1796,25 @@ faults or disk failure.
|
||||
.Pp
|
||||
Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows
|
||||
one at a time.
|
||||
If a scrub is already in progress, the
|
||||
If a scrub is paused, the
|
||||
.Nm zpool Cm scrub
|
||||
command terminates it and starts a new scrub.
|
||||
resumes it.
|
||||
If a resilver is in progress, ZFS does not allow a scrub to be started until the
|
||||
resilver completes.
|
||||
.Bl -tag -width Ds
|
||||
.It Fl s
|
||||
Stop scrubbing.
|
||||
.El
|
||||
.Bl -tag -width Ds
|
||||
.It Fl p
|
||||
Pause scrubbing.
|
||||
Scrub progress is periodically synced to disk so if the system
|
||||
is restarted or pool is exported during a paused scrub, the scrub will resume
|
||||
from the place where it was last checkpointed to disk.
|
||||
To resume a paused scrub issue
|
||||
.Nm zpool Cm scrub
|
||||
again.
|
||||
.El
|
||||
.It Xo
|
||||
.Nm
|
||||
.Cm set
|
||||
|
||||
Reference in New Issue
Block a user