NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

ChunkySocks's avatar
Nov 11, 2019

Confused about the scrubbing function and bit rot protection feature

From reading ReadyNAS OS 6: An overview of relevant scheduled maintenance tasks available I'm a little confused about the following section:

 

Should I use scrubbing regularly?

Scrubbing is closely connected to the bitrot protection feature. If bitrot protection is turned off, regular scrubbing is not required.

 

Is that correct?

Doesn't make sense to me. Surely it should read that if bitrot protection is turned off then regular scrubbing is required OR if bitrot protection is turned on, regular scrubbing is not required?

 

Unless I am misunderstanding both settings and it isn't possible to use the latter without the former being enabled.

 

In any case, for the first time I have scheduled some regular maintenance tasks and since I have bit rot protection turned off was wondering how often the scrubbing function should be run. I have the scrubbing function scheduled to run once every three months, defrag every month and balance every month.

 

Auto-defrag is enabled on one of the shares but no others & I do not use snapshots. Again, would enabling auto-defrag on all shares make running a scheduled defrag superflous? 

 

Thanks in advance for any replies.

6 Replies

Replies have been turned off for this discussion
  • StephenB's avatar
    StephenB
    Guru - Experienced User

    ChunkySocks wrote:

     

    Should I use scrubbing regularly?

    Scrubbing is closely connected to the bitrot protection feature. If bitrot protection is turned off, regular scrubbing is not required.

     

    Is that correct?

    Doesn't make sense to me. Surely it should read that if bitrot protection is turned off then regular scrubbing is required OR if bitrot protection is turned on, regular scrubbing is not required?

     


    There's not much said about how the bitrot protection actually works, as it is a proprietary Netgear feature.  Based on some hints posted here from time to time, I think it uses a combination of the RAID parity blocks and the BTRFS checksums. 

     

    Normally RAID recovery requires prior knowledge of what block needs to be recovered. But if you want to detect blocks that have silently gotten corrupted, you don't have any way to tell which block is bad.  However,  if you assume the BTRFS checksum is correctly stored (and if the checksum doesn't match what's on the disk), then you can attempt to recover every data block in the RAID stripe using the parity block, and see if one of those recovered blocks yields the correct checksum.  Then assume that block suffered the bitrot.  Note this possibility is pure speculation on my part - Netgear hasn't described what they actually do.  But it is consistent with your link - since the algorithm I outlined depends on correctly written parity blocks.

     

    Whether the scrub is "required" or not depends on your goals.  It shouldn't be needed if the RAID array is healthy and error free.  And as Netgear points out, it does generate a lot of disk I/O.  Personally I run it every three months - because I think it also serves as a reasonable disk exerciser/diagnostic which could give me an early warning that a disk might be failing.

    • Sandshark's avatar
      Sandshark
      Sensei

      Maybe this will help: /Bit-rot-Protection-and-Copy-on-Write-COW-in-depth 

       

      Netgear has intimately linked bit rot protection and CoW.  You cannot have CoW without bit rot protection.  So if bit rot protection (and, consequenctly CoW) are disabled, you have no checksums a BTRFS scrub can use to detect and correct errors.  So, scubs are basically useless.

      • ChunkySocks's avatar
        ChunkySocks
        Guide

        Thanks for your replies.

         

        If scrubs are useless then why does it allow you to start one without a warning if you don't have bit rot protection enabled and why did the one I ran a few days ago take 15 hours to complete? What was it doing in all that time?

         

        I will double check my shares, perhaps bit rot / CoW is enabled on one or more of them though it's not something I recall ever enabling unless it is done by default. 

         

         

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More