Btrfs – Why is cp –reflink=auto Not Default Behavior?

btrfscoreutils

Why is cp --reflink=auto not the default behaviour? Could it cause any harm to enable it?

Is it possible to enable it at compile time, so it is used all across the system, not just in interactive shells?

Best Answer

It's not the default since for robustness reasons one may want a copy to take place to protect against data corruption. Also for performance reasons you may want the writes to happen at copy time rather than some latency sensitive process working on a CoW file and being delayed by the writes possibly to a different part of a mechanical disk. Note that from coreutils v8.24 mv will reflink by default, since it doesn't have the above constraints. Note also that the major release after v8.32 will try to reflink in cp by default, as such a change is not appropriate for a minor release.

Related Question