Disabling ZFS Scheduled Scrubbing

Status
Not open for further replies.

AirNewZealand15

Dabbler
Joined
Apr 10, 2012
Messages
22
Is there any way to disable this?

I know that in 8.2 BETA there is a new Scrubbing option that allows you to control the schedule but I am running 8.0.4.

I need to disable it because I am pretty sure it is causing my time machine backups to corrupt.

Thanks all.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I doubt scrubbing make your backups corrupt. all it does is checksum files and compare to checksums from when the file was last checksumed. this should actually fix/inform you off corruption. why do you think your files are corrupt, and why do you believe it's caused by scrubbing?
 

AirNewZealand15

Dabbler
Joined
Apr 10, 2012
Messages
22
Hi Joshua
I also don't think that scrubbing along corrupts anything, it is obviously there to stop corruption between raid disks... BUT, I do think that if time Machine trys to backup while the freenass is scrubbing, it then causes the corruption.

That is why I want to know if It can be disabled.

I setup my first FreeNas about a month ago now, and I have had to do a complete time machine backup 3 times now - once for the first backup, and twice because I have been getting the error message "Time Machine completed a verification of your backups".

I found this very helpful thread: https://discussions.apple.com/thread/3658856?start=45&tstart=0 and the important part:

"After the last "poof" I really started digging and found something interesting. I was always puzzled at the periodicity of the problem (always Monday mornings). I discovered that my NAS upon which the TM server is hosted runs a weekly RAID scrub starting at 4AM, which runs until around 11AM. The TM failure always occurred in this time frame - around 8-9 AM. For those of you new to this thread, TM was invalidating my backup history every week or two, on a Monday, and recreating a backup. This problem started with Lion - it never existed before. Something about Lion is less accurate when it comes to verification of writing, so the data is being corrupted when the NAS is busy scrubbing the RAID.

I decided this must be the process which is the proximate cause (the main problem being some change in Lion's writing of the data). But how to fix it? TM backs up very often, so it won't do to just change when the RAID scrub occurs. I found myself wishing there were a feature in TM that would let me "window" the backup schedule to avoid the RAID scrub time frame. So I did some searching and found "TimeMachineEditor", a free utility that lets you build complex schedules to run TM. I was not only able to window the TM process to avoid the RAID scrub, but I was also able to set TM to run hourly rather than every five minutes.

So far this has worked. I anticipate that this will solve my problem. I will of course keep you all posted.

Thanks for your time,

H."
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
AirNewZealand,

This thread will tell you how to disable the automatic scrub. The default was changed from 30 to 35 days in 8.03 I believe.

http://forums.freenas.org/showthread.php?4869-FreeNAS-dead-after-starting-(auto-scheduled)-scrub

In FreeNAS 8.2 there are plans I think to configure this from the GUI. I'm not sure exactly which new features are going to make it into 8.2. I know we were told that and several others would occur, but I haven't completely explored Beta-3 yet and I'm sure there are still more features coming before the final release.

Scrubbing does put quite a strain on your system, but unless network packets are being dropped or RAM is defective, I don't think ZFS would cause it. I usually schedule or manually run scrub at night when nothing else is happening, so I can't say for certain, but if this were a common problem I'd think someone would be all over it to fix it.
 
J

James

Guest
The wiki version of the Guide is mostly up-to-date with 8.2's new features.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I still don't think scrubbing alone would affect the files, even in the middle of a write. But yeah, I know you can add scrub jobs in FreeNAS 8.2, not sure if there is a default one anymore.
 

AirNewZealand15

Dabbler
Joined
Apr 10, 2012
Messages
22
protosd - thanks for that. After reading through that thread though it appears it will still auto scrub at the 30/35 day interval. Also, does mean the nas is scrubbing every day??

It there a way to find out when the has will auto scrub? If I had that info i might be able to schedule my time machine around the scrubbing.



In other news....

How close is 8.2? OR, how safe is the beta to install? Should I just go ahead and install the beta and then play around with the scrubbing options?
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
You can check your pool by issuing zpool status in the shell, the output for each of your pools will contain a line like this one:
Code:
scrub: scrub completed after 13h47m with 0 errors on Fri Apr 27 16:49:01 2012


Also the mail notification contains this information, if you are using it:

Code:
  skipping scrubbing of pool 'tank1':
     last scrubbing is 6 days ago, threshold is set to 35 days
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
protosd - thanks for that. After reading through that thread though it appears it will still auto scrub at the 30/35 day interval. Also, does mean the nas is scrubbing every day??

It doesn't scrub every day. It will only scrub after 35 days if you don't scrub it some other time yourself before that.

How close is 8.2? OR, how safe is the beta to install? Should I just go ahead and install the beta and then play around with the scrubbing options?

8.2 is a little behind schedule, but it's better late than early with bugs!

I wouldn't suggest using the Beta for anything other than testing, there are a lot of major changes in this release so why risk your data unless you have a backup.

I think we're getting close to a Beta-4 or RC-1 sometime soon, but I think they're working on another security release for 8.04 before that.
 

rip97000

Cadet
Joined
May 4, 2012
Messages
7
i have FreeBSD 8.2-RELEASE-p6 but i don't see anything for scrub under volumes. am i not looking in the right place?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
i have FreeBSD 8.2-RELEASE-p6 but i don't see anything for scrub under volumes. am i not looking in the right place?

Rip970000,

First you need to find the right place to get the correct version for FreeNAS ;)

That is the FreeBSD version.
 

rip97000

Cadet
Joined
May 4, 2012
Messages
7
damn noobs with nothing better to do on a friday night (yes i'm calling myself that)

my version is FreeNAS-8.0.4-RELEASE-p1-x64 (11059)

isn't this the latest version?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Yes, 8.0.4-p1 is the latest, though there is going to be another security update sometime very soon. :)

Ok, under Storage -> Volumes -> View Volumes, next to each volume is a group of icons, one of those is for doing a scrub. Hold your mouse pointer over each one and it'll popup a description.

I also just got around to checking 8.2 Beta-3 and there is more detailed control over when scrubs happen.
 

rip97000

Cadet
Joined
May 4, 2012
Messages
7
ok yes there is an option there to scurb, but that seems like it is a manual scrub. if i click yes do i have options or does it start a scrub?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
It just starts a scrub, the options aren't available until 8.2, but you can also add a cron job to start a scrub at a specific time by adding the command "zpool scrub tank" where tank is the name of your pool/volume.
 

AirNewZealand15

Dabbler
Joined
Apr 10, 2012
Messages
22
thanks for your help everyone.

I'm going to do a fresh time machine backup and then note down exactly when the next corruption happens and then see if that was when the NAS was scrubbing.

If it wasn't when the the scrub was happening then I guess I have another problem.

I will keep this thread updated to my progress so others know the outcome.
 
Status
Not open for further replies.
Top