Enterprise AV Home WiFi Mobile Wifi Support Shop Deals

The benefits of disabling or enable Bit-rot Protection / Copy-on-write.

Btrfs is a copy-on-write (COW) filesystem. Copy-on-write means all writes are preserved. Btrfs likes to avoid deleting/overwriting data; it would rather write in a new spot, which is where it gets the name copy-on-write. COW is the biggest feature of the filesystem with a few stipulations.

Btrfs is unique in that it stores all of its information in B-tree fashion, making data mathematically easier to access when you have lots of it. Btrfs stores COW information about files in B-trees. Metadata and the actual data of the files are stored in their own B-trees as well. COW information includes checksums, so data can be checked for corruption. Bit-rot Protection takes advantage of this system and along with the other information stored on the NAS, it can fix corruption of bits.

Since COW always writes in new spots, old data can be found on the drives, and there is metadata pointing to it. This allows infinite snapshots to be possible. Data is quick to access because of the benefits of storing it in a B-tree fashion.

The benefit of having COW enabled is that you have data integrity, because along with COW, you have Bit-Rot Protection. Your data can be fixed when silent corruption, also known as bit rot, is occurring. One bad effect of COW is that always writing in new spots tends to spread data across out on the drives thus causing fragmentation. This is generally not a big effect, unless you have a very specific use case (i.e. Virtualization or anything that has small and random write patterns). Fragmentation is detrimental to performance when it exists in virtualized environments, because latency goes up. Since the data is more scattered, it takes longer to find and access the entirety of files, causing latency.

Disabling COW will remove the checksums of new data, thus disabling bit rot protection on your new data. On the other hand, all writes are kept within the extents of the files, thus lowering fragmentation. The end result is you have less fragmentation and more performance.

If you are planning to use Virtualization, or have lots of small writes random writes (ex: a store of millions of accessed and updated tiny picture files), disable COW.

To Enable or Disable COW on the ReadyNAS, simply enable or disable Bit-rot Protection. This is done per share or per lun. When Bit-rot Protection is enabled, COW is enabled. When Bit-rot Protection is disabled, COW is disabled as well.

What is bit rot protection in detail? It fixes corrupt bits as long as you have more then one drive in the raid. It fixes them when it detects them on reads, or when you do a filesystem scrub.

What is Bit-rot: http://arstechnica.com/information-technology/2014/01/bitrot-and-atomic-cows-inside-next-gen-filesystems/

Does disabling COW disable snapshots?

On a normal COW filesystem, the answer is yes; however, btrfs implemented COW and B-trees intelligently. Therefore, having COW disabled or enabled does not affect the snapshotting ability, making this answer No.

On the ReadyNAS device, With COW disabled or enabled, you can still take as many snapshots as volume space allows.

Caveat

Only new files and files with no data (empty files) can be changed to COW ON. Once COW has been enabled, it cannot be turned off unless the file is recreated.

  • To disable COW (COW OFF):Uncheck Bit-rot protection.
  • To enable COW (COW ON): Enable Bit-rot protection. Bit rot protection relies on COW.

ReadyNAS OS 6 COW and Bit-rot settings

  • 6.0.0 to 6.1.8: everything had COW ON. Bit-rot Protection feature was not yet developed.
  • 6.1.9: Had COW ON for everything aside from Thick LUNs. Thick LUNs had COW OFF. Bit-rot Protection feature was not yet developed.
  • 6.2.0+: Bit-rot Protection is introduced, enabling the ability to toggle on/off COW.

How toggling Bit-rot Protection affects files and folders in shares.

  • When toggling Bit-rot Protection on and off, it toggles COW on and off, on the entire share. It takes a moment for the changes to propagate through the entire share (especially with many files and folders).
  • It’s important to understand that a file that has already been written to / has data cannot change its status of COW / Bit-rot Protection.
  • Meaning that if a file with data has COW enabled, changing COW to disable on the share will not disable COW on the file. The file will remain with COW enabled. However new files in that share will have COW disabled.
  • Likewise if a file with data has COW disabled, changing COW to enable on the share will not disable COW on the file. The file will remain with COW disabled. However new files in that share will have COW enabled.
  • Empty files that are of size 0, will change from COW ON to COW OFF, and vice-versa.
  • It’s important to realize that folders themselves aren’t affected by COW on or COW off, because folders don’t hold data, files hold data.

Switching COW on to COW off on a file that has data

So if you have a file that has COW enabled, and you want to switch it to COW disabled (or vice-versa), the only way to do it:

  1. Disable COW on the share (or enable COW if you're doing the reverse operation)
  2. Copy the file to a new location in the share (it can be within the same folder), just make sure the new copy has a different name.
  3. Confirm the copy is good.
  4. Afterwards, delete the original file.
  5. Rename the new copy to the original name.

How Toggling Bit-rot Protection affects LUNs

LUNs are files on the filesystem, and files with data can’t change their COW on/COW off status. Thus, LUNs can’t change from COW on to COW off, or vice-versa, after creation.

The LUN should be initialized with the correct COW setting when the LUN is created.

Summary

  • It is best to decide if you need COW ON (Bit-rot protection on) or COW OFF (Bit-rot protection off) at the beginning of creating a SHARE or a LUN.
  • Decide if that share/LUN will be perceptible to lots of small random writes, if so disable COW (in-turn disabling Bit-rot protection), and therefore benefit for not having performance issues down the road from fragmentation.
Last Updated:07/07/2025 | Article ID: 26091

Our team is here to help!

Phone
Chat
Email