On Sun, Jan 10, 2021, 3:52 AM Patrick O'Callaghan <pocallaghan@gmail.com> wrote:


On Sat, 2021-01-09 at 18:01 -0700, Chris Murphy wrote:
> > Does this mean that my VM image subvolume is being included in the
> > compression? If that's the case I'll cease and desist.
>
> Did you set 'chattr +C' for nodatacow on the enclosing
> directory/subvolume for the VM images? Nodatacow implies no
> compression and no checksums.

Probably but I don't remember. I've now set it just in case, but lsattr
doesn't show it:

$ sudo chattr +C /home/Windows
$ lsattr -l /home/Windows
/home/Windows/wimage         ---


Is this a bug or a feature?


If you're using libvirt, creating a new pool on Btrfs will automatically set +C attribute.

It's not possible to set this attribute once a file has data in it, it's not retroactive. You'll need to duplicate the file, in that same directory. Because the directory has the attribute now, the duplicate will inherit the attribute.

--
Chris Murphy