Hi.
From the chattr man page:
A file with the 'C' attribute set will not be subject to copy-on-write
updates. This flag is only supported on file systems which perform
copy-on-write. (Note: For btrfs, the 'C' flag should be set on new or
empty files. If it is set on a file which already has data blocks, it is
undefined when the blocks assigned to the file will be fully stable. If
the 'C' flag is set on a directory, it will have no effect on the
directory, but new files created in that directory will have the No_COW
attribute set.)
Question 1)
If /var/lib/mysql is a own subvolume and chattr +C /var/lib/mysql is set
and mysql is configured to use one directory for every database, will
nodatacow apply for a new dir which is created when a new db is created?
Just asking, because the last sentence of the man above which states
"...new files created in that directory...". Is a dir a file in the
context of chattr?
Question 2)
I guess CoW will still happen, if I hold a snapshot of the subvolume
which will be mounted to /var/lib/mysql. Is this correct?
Question 3)
How to solve this and avoid defragmentation if my assumption in 2) is
correct?
Thanks,
Steffi