Disabling ZFS Scheduled Scrubbing

Discussion in 'Storage' started by AirNewZealand15, May 3, 2012.

  1. AirNewZealand15 New Member

    Member Since:
    Apr 10, 2012
    Message Count:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    IT
    Location:
    Tauranga
    Home page:
    AirNewZealand15, May 3, 2012

    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.
  2. Joshua Parker Ruehlig Well-Known Member

    Member Since:
    Dec 5, 2011
    Message Count:
    1,143
    Likes Received:
    30
    Trophy Points:
    48
    Location:
    Sacramento, California, United States
    Joshua Parker Ruehlig, May 3, 2012

    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?
  3. AirNewZealand15 New Member

    Member Since:
    Apr 10, 2012
    Message Count:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    IT
    Location:
    Tauranga
    Home page:
    AirNewZealand15, May 4, 2012

    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."
  4. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, May 4, 2012

    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.
  5. James FreeNAS Core Team

    Member Since:
    May 24, 2011
    Message Count:
    298
    Likes Received:
    21
    Trophy Points:
    18
    Occupation:
    iXsystems, Inc.
    Location:
    San Jose, CA
    Home page:
    James, May 4, 2012

    The wiki version of the Guide is mostly up-to-date with 8.2's new features.
  6. Joshua Parker Ruehlig Well-Known Member

    Member Since:
    Dec 5, 2011
    Message Count:
    1,143
    Likes Received:
    30
    Trophy Points:
    48
    Location:
    Sacramento, California, United States
    Joshua Parker Ruehlig, May 4, 2012

    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.
  7. AirNewZealand15 New Member

    Member Since:
    Apr 10, 2012
    Message Count:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    IT
    Location:
    Tauranga
    Home page:
    AirNewZealand15, May 4, 2012

    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?
  8. warri Active Member

    Member Since:
    Jun 6, 2011
    Message Count:
    867
    Likes Received:
    29
    Trophy Points:
    28
    Location:
    Germany
    warri, May 4, 2012

    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 (text):
    1. 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 (text):
    1.   skipping scrubbing of pool 'tank1':
    2.      last scrubbing is 6 days ago, threshold is set to 35 days
  9. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, May 4, 2012

    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.

    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.
  10. rip97000 New Member

    Member Since:
    May 4, 2012
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    1
    rip97000, May 4, 2012

    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?
  11. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, May 4, 2012

    Rip970000,

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

    That is the FreeBSD version.
  12. rip97000 New Member

    Member Since:
    May 4, 2012
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    1
    rip97000, May 4, 2012

    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?
  13. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, May 4, 2012

    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.
  14. rip97000 New Member

    Member Since:
    May 4, 2012
    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    1
    rip97000, May 4, 2012

    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?
  15. ProtoSD Active Member

    Member Since:
    Jul 1, 2011
    Message Count:
    3,359
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Leaving FreeNAS
    ProtoSD, May 4, 2012

    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.
  16. AirNewZealand15 New Member

    Member Since:
    Apr 10, 2012
    Message Count:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    IT
    Location:
    Tauranga
    Home page:
    AirNewZealand15, May 5, 2012

    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.

Share This Page