Dude wrote:COW is happening all the time. That's the whole point of btrfs. Everything is COW'd unless/except if you mount with nodatacow (or flag a particular file as not to be COW'd).
I was wondering why there is such an option. Isn't COW required for Btrfs in order to support snapshots? Since COW can be disabled, does it mean that COW is happening all the time, regardless of snapshots?
Doesn't this mean data will end up pretty much scattered all around in case there are a lot of changes to files?
If there are no snapshots, is Btrfs reusing data blocks/metadata when the disk runs out of fresh/unused blocks?Yes. btfrs also maintains a space cache to know where it can write.
Is Btrfs suitable for multimedia editing, storing VM images, swapfile, datafiles, etc.?Yes and no. A lot of work has been done in the mainline btrfs development that's not in UEK2 (yet) that improves btrfs' performance in a lot of areas, particularly with direct I/O, but it probably won't beat XFS or ASM for a while yet. Unless you turn off datacow, I guess. But that kinda defeats the purpose of btrfs. You could flag particular files as nodatacow though, to get the benefits generally, but not specifically for some files.