Hello,
i have a zfs pool on my daily pc.
I want to set: services.zfs.autoScrub.enable = true; but i am unsure on what happens if i shutdown the system during a scrub.
From zpool-scrub-8 i gather that -C can continue a paused (stopped?) scrub.
As a scrub can take longer than 15h at the moment, i want to know what happens if it is in an active scrub during shutdown.
Does it simply pause the scrub and resumes on the next system start?
Do i need to manually resume the scrub?
Can i corrupt the data if there is a “sudden” power loss (because it got shutdown)?
Is the scrub simply treated as that it never happened?
yes
no
no
no
You can see the status of an ongoing (or most recent) scrub using zpool status .
1 Like
to add on, it also can make other I/O (and boot) tremendously slow whilst it tries to continue its scrub when systemd is loading your entire system
2 Likes
Scrub IO is scheduled at lowest priority. It should not significantly affect other IO or boot performance unless you have really shitty drives. If you are doing heavy IO, you can manually pause the scrub if needed.
Additionally, recent ZFS versions have switched to linear scrub over the disk rather than following block pointers. This makes scrubs much faster on spinning disks as you don’t have to seek all over the place.
1 Like
“Rcent ZFS versions” meaning as old as 2019, but sure
But yea, I use ZFS on my machines and the only reason I notice when a scrub starts going is because the fans ramp up and make some noise. The actual performance seems basically unaffected.
1 Like
Thanks for all the answers <3
As the zfs pool isn’t my boot drive i don’t have concerns about the boot time.