Scheduled scrubs not taking place?

Status
Not open for further replies.

platinumjsi

Dabbler
Joined
Oct 13, 2015
Messages
49
Or at least I think thats not the case? this is my schedule :

https://i.imgur.com/B9oKq2N.png

So I would expect the scrub to take place at 1am this morning (Or am I reading it wrong?)

and this is the current output from zpool status

https://i.imgur.com/jhdPnbU.png

To me that looks like no scrubs have taken place?

Oh also another quick one, I set up the scrubs based on a guide, not really got around to fine tuning things yet, so I have it set to do a scrub every 15 days but the threshold is set to 10 days, should I change this to 15?

Also I understand scrubs put a great deal of load on the drive, as this is just a media server for home use would the drives benefit from me pushing this to a monthly scrub?
 

platinumjsi

Dabbler
Joined
Oct 13, 2015
Messages
49
I think I have found the answer but if someone can confirm it would be great, it looks like no scrub has taken place as its not hit the threashold yet given that its new setup.

Can someone answer the second one though, will it wait the 15 days or will it see the 10 day threashold has passed and run a scrub at day 10?

Thanks
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
From Table 8.4a (FreeNAS 9.3.1 manual)

Threashold:
"number of days since the last scrub completed before the next scrub can occur, regardless of the calendar schedule; the default is a multiple of 7 which should ensure that the scrub always occurs on the same day of the week".
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I should probably clarify that last post, since it was pretty brief. When you schedule a scrub, there's all the cron-type parameters (because it sets up a cron job)--month, day of month, day of week, hour, minute--and there's also the threshold value. In my case, I've set up the cron parameters to Sundays at midnight. Thus, every Sunday at midnight, my server runs an iXSystems script with a parameter of the threshold in days. The script checks when the last scrub finished, and if that was less than <threshold> days ago, it terminates. Otherwise, it starts a scrub.

Since scrubs take a non-zero amount of time, if I set my threshold to 14 days, intending to scrub every other week, I'd actually get a scrub every three weeks. Let's suppose the script ran a scrub the first Sunday of this month, 10/3. The next Sunday, 10/10, the script runs, notices it's been less than 14 days, and terminates. The following Sunday, 10/17, it's still been less than 14 days (it's been 13 and change), so the script still doesn't start a scrub. On the Sunday after that, 10/24, it's been more than 14 days since the last scrub, so the script starts another one.

In my case, I want a scrub every other Sunday, so I've set my threshold to 12 days. That will work unless a scrub takes longer than 48 hours.

@platinumjsi, on your first question, I think you're right that it hadn't hit the threshold since it was a new pool.
 

platinumjsi

Dabbler
Joined
Oct 13, 2015
Messages
49
Ok thanks, so should I change the threshold to 7 in that case?, still not 100% sure of the purpose of threshold, if its set to scrub every 15 days wont it scrub every 15 days?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If you've set the cron task to run on the 1st and 15th, as you have in your first screen shot (BTW, you can upload those directly into your posts--much easier for readers to follow than linking out to some external site), and the threshold is less than 15 days, then it will run on those dates.

I can't say for certain the purpose of the threshold setting, as I didn't have anything to do with developing the product. I can tell you how I use it, though. I want a scrub to run every other Sunday. I don't think that can be set just using the cron settings--the closest I can come is every Sunday. So I set the threshold to more than one week, but less than two, to get it to run every other Sunday.
 
Status
Not open for further replies.
Top