SCRUB and SMART tasks not starting as planned

Status
Not open for further replies.

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Hiao,

i am just "playing" with my new box and thing is that the scheduled SCRUB task or SMART test will not start as planned. I tried several settings and nothing happened. Am i missing some important step or is it really not working in FreeNAS 8.3.0 p1 ? I have RAID-Z2 over six 3TB disks. One pool and several datasets configured. CIFS enabled (works perfectly). SMART is enabled on all devices, service is running.

I just wanted to schedule long test for all disks during night before i will start uploading data on it, but looks like i will need to start them manually from console :/

BTW: Manually executed scrub works just fine, so only the scheduler is somehow "weird?"


Thanks and sorry for my dummy question ^^

Holy
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi Holy,

Under Storage->Volumes->View Disks there is a column that says which disks SMART is enabled for, you need to "Edit" each disk to turn it on.

I'm not sure about the scrub, I always manually start mine.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Other thing to keep in mind, scrub only runs if it's past the threshold between scrubs.
 

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
2 Protosd: Yea, i checked this and yes, i have SMART enabled for all of them :/

2 paleoN: Even the first one? I understand it like first should be executed at planned day/time and the next after threshold.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
paleoN: Even the first one? I understand it like first should be executed at planned day/time and the next after threshold.
Depends. The scrub script, /usr/local/sbin/scrub, is likely smarter than you think. It actually checks the pool for the last time any scrub was run. It also won't run on a new pool until after the threshold period.

What does your smartd.conf look like:
Code:
cat /etc/local/smartd.conf
 

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Ok thx, i understand. I am now running long SMART test (manualy executed) on all discs to ensure that they are fine from this perspective. After that, i will start uploading data, so i will see if the scrub will be executed automatically after the preset period. I have scrub planned for each 14 days, i guess its enough. Since the discs are brand new, it's better to watch them closely :]
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Here's my understanding of the logic behind how the automatic scrubs work: Obviously, "Enabled" must be checked.

1. Is the minute (or every n minutes) met? If yes, go to next. Else no scrub due.
2. Is the hour(or every N hour) met? If yes, go to next. Else no scrub due.
3. Is the day of month (or every N day of the month) met? If yes, go to next. Else no scrub due.
4. Is the month met? If yes, go to next. Else no scrub due.
5. Is the day of the week met? If yes, go to next. Else no scrub due.
6. Is the threshold value met or exceeded?* If yes, go to next. Else no scrub due.
7. Perform a scrub.

* - Note that the day the pool was created also counts as the day of the last scrub. Additionally, consider the fact that if you run a manual scrub or resilver this will also count as the "last scrub".

So, here's how I do my scrubs. Since I'm a home user and performance isn't affected by a scrub, I always run a scrub on the 1st and 15th. Some people do 15th and 30th, but then February screws everything up. I also do a short SMART test every 7th and 21st. I do the scrubs and SMART tests at 0305 on their respective day. I do 0305 so that the 0300 stuff that FreeNAS does(such as nightly reports) do not happen to run at the same time as a SMART test or scrub. This really shouldn't matter, but why not let the system focus on one thing at a time?

My threshold for scrubs is 12 days. I chose 12 days to allow roughly 48 hours for the scrub to complete. It shouldn't take more than 12 hours, but I figure I'll give it alot of buffer space if something starts acting up. Yes, it is possible that if I resilver on the 9th the scrub on the 14th won't happen because of the threshold, but I'm not too terribly worried about that. You will get an email that the threshold hasn't been met so if you feel compelled to do a scrub on the 14th you could start one manually. I don't worry about it though and just delete the email.

Then, if I am going to be doing alot of maintenance on the server, moving it, or otherwise doing something that I consider riskier than letting the system just run constantly I'll do a scrub before and sometimes after too.
 

bertrem

Dabbler
Joined
Feb 19, 2013
Messages
15
Here's my understanding of the logic behind how the automatic scrubs work:

Thank you! This was insanely confusing to me since it appears that you can set up all sorts of mutually exclusive/contradictory scheduling requirements. (ie. how can i possibly do a scrub every 10 days and always have it be on a Sunday??) So basically it's the logical AND of all requirements you set, and anything involving a count of time is treated as true if >= (not just ==). I think that's another way of saying the same thing? Could some explanation of this please be added to the manual? It's nowhere in it as best I can tell.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
So lets say you want the scrub to start at 3:05am on Sundays(year-round), but only after 10 days since the last scrub has performed.. Keep in mind that 10 days really is a weird value because you won't typically have 10 days between Sundays(there's only multiples of 7 between any two Sundays on the calendar).

So going down the window options you'd choose:

Threshold = 10

Minute = Each selected minute(05)
Hour = Each selected hour(03)
Day of month = Every (1) day of month OR Each selected day of the month(with all of them highlighted)
Month = All highlighted
Day of Week = Sunday
Enabled = Checked

Keep in mind you may get emails frequently that scrubs aren't being performed because not all of the criteria are met. I believe anytime a scrub isn't performed because of the threshold you get an email, so you can expect an email every day except for the Sundays that the scrubs are actually performed. On the Sundays that a scrub is performed I believe you get an email that a scrub has started and then another when it has finished(but don't quote me on this).
 

bertrem

Dabbler
Joined
Feb 19, 2013
Messages
15
Right. To be clear, i wasn't suggesting that i actually wanted to run a scrub every 10 days and only on Sundays. I obviously realize that's impossible. :P My point was just that the scheduler seems to allow you to specify that even though it's clearly ludicrous.

In any case... the important bit (to me) is to see that this all finds its way into the docs somehow. I'm not sure what the process is for that. Do the people who write the docs pay attention to the forum? :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
In any case... the important bit (to me) is to see that this all finds its way into the docs somehow. I'm not sure what the process is for that. Do the people who write the docs pay attention to the forum? :)

Not sure. Personally, I was able to understand everything except the threshold just by looking at the window. It's a typical scheduler setup from what I've seen. A quick search of the forums confirmed my guess as to what the threshold meant.
 
Status
Not open for further replies.
Top