Pausing scrub automatically to reduce performance impact during use

When scrubbing a pool, it is possible to manually pause/resume the scrub from the UI. I have used this on occasion, and would like to maybe automate it as described here: Incremental zpool scrub · Justin Azoff.

I was wondering if there is any negative impact to pausing a scrub, and specifically if this may be related to the duration of the pause. For example, is it irrelevant whether I pause for one hour or I pause for 1 day? Does writing over the part that has been scrubbed already during the pause require the scrub to restart? Or does ZFS keep state about such events so that resuming the scrub “reprocesses” the modified/added parts?

If indeed there is no downside to pausing, It definitely makes sense to scrub intermittently (e.g. for 3 hours every day) during off-hours (e.g. from 2am to 5am daily). In fact, I would love to see this as a standard feature of TrueNAS…

yeah id like to know this too

I started my first scrub & the first 75% went by pretty quickly. I ended up pausing the scrub twice so there wasn’t significant contention during two long user operations. Now that I’ve resumed the scrub, it’s been stuck at 76.74% for well over half an hour & not sure if restarting the task results in rework as the OP inquires about.

though for the record, it has gotten halfway through the degraded disk so it is possible it is having issues it hasn’t reported yet.

EDIT: I aborted the scrub, did a swap of drives to rule out a SATA connector and restarted the scrub.

ok while ymmv, the scrub completed without a hitch.

so the only conclusion I can draw is it’s not a great idea to pause a scrub mid-way if you plan to do a significant amount of writes while to paused (as you inquired if it has an impact on the scrub). It would be good to get a more definitive answer though.

This is just my personal experience doing my first scrub and pausing only to have to cancel (because it hung) and restart (from 0) without any issues.