Won't scrub my volume

Status
Not open for further replies.

rangopango

Contributor
Joined
Feb 21, 2018
Messages
151
I'm using FreeNAS-11.1-U4, these are my scrub settings

Threshold days: 35
Minute and hour: 00
Day of month: everyday
Month:every month
Day of week: Sunday
Enabled: true

It's been 2 months and it hasn't scrubbed my volume once. What could be causing it to not scrub?
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Does it scrub when you start it manually from a command line?

zpool scrub [poolname]
zpool status [poolname]
 

rangopango

Contributor
Joined
Feb 21, 2018
Messages
151
How do I try and scrub a dataset? Don't want to scrub the entire volume right now

it seems to scrub my boot SSD just fine though
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
You cannot. Scrub works at the pool (volume) level. Why don't you want to scrub the entire pool?

If it's because you have some performance sensitive stuff, slow down the scrub. Issue this command before starting the scrub:
sysctl vfs.zfs.scrub_delay=100

That will cause the scrub to issue far fewer I/O operations that it otherwise would if the pool is otherwise busy. It goes back to "full speed" if the pool is not being used at the time.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Looks ok. But can you post a pic of the screen that lists the scrub info on one line? From the Menu it is in Storage > Scrubs > View Scrubs.

Click that and it should show the scrub and the list of parameters left to right. Make sure all columns are visible.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Just curious, I think 35 days is the default. Is there any reason you didn't want to scrub say on the 1st day of the month or something? Just curious. Or every 4th Sunday (if you don't want to scrub during the week or something)?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

toadman

Guru
Joined
Jun 4, 2013
Messages
619
If you are ok with once a month on the first day of the month, then:

All good on:
  • every month is fine
  • day of month at 01 is fine
  • Hour at 02 is fine (or set to what you want)

Make changes on:
  • You have 00 and 02 as the minute. Pick one, not both
  • enable all days of the week, not just Sunday
  • set the threshold days to 27 (or 26 if you think it will take more than a day to scrub, as this accounts for February

Should be fine at that point. Make sense?

If you prefer Sundays only, then I would set threshold to 27, set day of week to Sunday, and NOT pick day of month at all (which will pull that out of the setting). That way every 4th Sunday it will scrub.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
I believe so yes.

The only things in your scrub job that differs from mine is I do two per month, 1st and 16th. And my threshold days is set to 10 vs the "0" you have. (I'm not sure how the script that runs this treats a "0", so I put in a non-zero value just to avoid a weird corner case.)

Otherwise it's the same approach, which I can confirm works. :)
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
The only other thing I do is set vfs.zfs.scrub_delay=50 in my tunables. Which has nothing to do with schedule, only with speed of scrub. I slow the scrub down at the expense of time required to complete it so the performance impact of the scrub on the pool is minimized.
 

rangopango

Contributor
Joined
Feb 21, 2018
Messages
151
Good news: it scrubbed my first volume
Bad news: it didn't scrub the second volume

I changed the second volume's scrub settings to day 2 instead of day 1, so that it won't overlap with the first volume since it's already on day 1.
70dc17c76c.jpg
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Good news: it scrubbed my first volume
Bad news: it didn't scrub the second volume

I changed the second volume's scrub settings to day 2 instead of day 1, so that it won't overlap with the first volume since it's already on day 1.
Was the scrub on first volume complete when the time to start second volume rolled around? I have a system at work that takes four and a half days to finish a scrub. If you are only doing a scrub once a month, maybe do one on day 1 and the other on day 5 or 7 so you can be certain that the first scrub is complete before the second needs to start.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Good news: it scrubbed my first volume
Bad news: it didn't scrub the second volume

I changed the second volume's scrub settings to day 2 instead of day 1, so that it won't overlap with the first volume since it's already on day 1.
70dc17c76c.jpg

You gotta change the threshold days to like 25 or less (depends on how long a scrub lasts - just change it to like 14 or less). Think about it. You scrub Feb 1. March 1 rolls around. It hasn't been 30 days. No scrub in March. April is the next time. And if ZFS counts 30 days from when your last scrub ended (vs. started) and the scrub lasts more than 24 hours, you'll only start every month following a 31 day month. (I don't know how it counts.)

I agree with Chris above. While I haven't looked at the code for the scrub script/zfs code for scrubbing, you may want to separate the day of month by a week to make sure the first scrub completes. So maybe set it to 01 for the day for the first scrub and like 08 for the second scrub. Both with 14 day or less threshold.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
You gotta change the threshold days to like 25 or less (depends on how long a scrub lasts - just change it to like 14 or less). Think about it. You scrub Feb 1. March 1 rolls around. It hasn't been 30 days. No scrub in March. April is the next time. And if ZFS counts 30 days from when your last scrub ended (vs. started) and the scrub lasts more than 24 hours, you'll only start every month following a 31 day month. (I don't know how it counts.)
Good point. I forgot about that. I have my threshold days set to 21. That ensures that I get a scrub every 3 weeks and I didn't select a certain day of the month, rather a certain day of the week and hour of the day. Like this:
upload_2018-6-3_19-55-49.png

and,
upload_2018-6-3_19-56-33.png
 
Status
Not open for further replies.
Top