Do you need to halt jails and disk activity before a scrub?

Status
Not open for further replies.

JTheNASBuilder

Dabbler
Joined
Feb 4, 2014
Messages
28
The obvious answer would seem to be, just based on general computer knowledge, "yes, minimize or eliminate disk activity before performing a disk intensive activity" but my actual FreeBSD knowledge is pretty limited.

Before performing a scrub should I shut down my jails and stop any secondary read/write activity (to the best of my ability) so the scrub can work on a relatively static slate?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
No. Scrubs will automatically adapt to the server's load.

It is advisable to schedule them for slow periods, though. No need to shut everything down, but too much load will slow everything down.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
The settings for scrubs are somewhat tunable to avoid significant impact on the workload, but the flip side is that it'll make the scrub drag on (and on and on). The best idea is to figure out when your workload is the lightest and schedule accordingly. Unfortunately, with modern disk sizes, a scrub can take over a day:

scan: scrub repaired 0 in 34h31m with 0 errors on Thu Oct 2 10:31:27 2014

That's for an 11 disk RAIDZ3 of 4TB drives.
 

JTheNASBuilder

Dabbler
Joined
Feb 4, 2014
Messages
28
Alright so ideally I would schedule a scrub to start at, say, 12:01 on a Sunday so it could run all day Sunday and into the Monday morning if need be (with this time selected because the chances of the server downloading newly aired content or having any serious activity is pretty low).

Also, to further the inquiry, there's no need to worry about in-use files becoming corrupted or anything? One of the jails, for example, is running a Minecraft server and I'd hate for the world to get corrupted because the scrub was running.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
No, ZFS has fairly strong data integrity validation and as long as ZFS has a way to recover the data from redundancy, it will correct any errors identified on disk. Do note that you really need to have ECC memory and a CPU that supports it in order for this mechanism to work correctly, or you actually introduce a chance for Bad Things(tm) to happe.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You're all good then, it sounds like. When you do "zpool status" from the CLI, ZFS will report if it has had any issues or errors on the disks or the filesystem. Unless integrity checking is specifically disabled, ZFS will ensure that the data that is handed to it is the same as the data it hands back to you. Things that it is doing "behind the scenes" like scrubs are just a more proactive way of periodically forcing ZFS to walk the entire filesystem tree and look for unnoticed problems. When ZFS runs across data that is corrupt, either during normal operations when asked for the data by a program, or by the scrub mechanism, it will make an attempt to repair the damage and log that fact.
 
Status
Not open for further replies.
Top