Looking at these articles we see that ZFS and BTRFS are both ROW (Redirect on write) and not COW (copy on write).
ROW – redirect on write: suffers from fragmentation down the road as all overwrites have to be written in new places
COW – copy on write: doesnt suffer from fragmentation as much as ROW as overwrites go to their original blocks, the original data is copied to another location for safe keeping (hence Copy-on-write), but suffers from performance on snapshot writes.
Is it incorrect that we call ZFS & BTRFS COW? I have incorrectly called ZFS and BTRFS in my other articles as COW. Thats what I was tought. But after reading the above articles I noticed I was incorrect. Im guessing COW has become the incorrectly coined term, kind of like MiB and MB. Consequently now COW can stand for both ROW and COW.  So when one says this filesystem is COW they could mean that its ROW or they could mean that its COW. You should probably get more answers by looking into the source code or asking more questions
Another example of a ROW filesystem: WAFL on NetApp
So whats an example of a COW system? Snapshots with LVM are COW. When creating snapshots with LVM you have to assign the size of the snapshot. Snapshots are assigned a specific amount of space from the filesystem, where the original data blocks can be written. So when you go over X bytes worth of changes the snapshot becomes invalidated and unusable. X being the size of the snapshot you allocated.

One thought on “zfs & btrfs are ROW not COW – redirect-on-write, not copy-on-write

  1. Thanks a lot for that explanation. I was wondering for quite some time now how it could be possible that even a huge number of snapshots does not affect ZFS performance. The only solution to this question I could up with was the one you described in your post – that it must be RoW instead of CoW. (As I understand it metadata of potentially each of the previous snapshots had to be updated upon a new write if CoW was used [in case you change a block of data which was in its original state from before the first snapshot])

Leave a Reply

Your email address will not be published. Required fields are marked *