I plan to create two subvolumes on a BTRFS-formatted spinning disk. I plan to mount one of those subvolumes with nodatacow so that I can efficiently store virtual machine images and database files there.
Is there any problem using snapper to enable snapshots of the subvolume mounted with nodatacow?
What should I be aware of when taking snapshots of volumes that don't use COW?
All I have found so far is a sentence in the BTRFS FAQ:
Can copy-on-write be turned off for data blocks?
Yes, there are several ways how to do that.
Disable it by mounting with nodatacow. This implies nodatasum as well.
COW may still happen if a snapshot is taken.
Best Answer
Regarding the nodatacow option, Ohad Rodeh's paper titled BTRFS: The Linux B-tree Filesystem states:
There is no problem with creating a snapshot of a subvolume mounted with nodatacow. But since cow is required to create a snapshot, when you create one on a subvolume with nodatacow it will essentially ignore nodatacow; acting as it normally would.
That does however bring up an interesting question: Is the nodatacow ignored permanently? Does creating a snapshot of a subvolume with COW disabled, reenable COW until it's manually disabled again?
Luckily, no. From the btrfs mailing list...