On Mon, Jan 4, 2021 at 7:42 PM Cerem Cem ASLAN <cerem...@ceremcem.net> wrote:
>
> I need my backups exactly same data, including the file attributes.
> Apparently "btrfs receive" ignores the CoW attribute. Here is the
> reproduction:
>
> btrfs sub create ./a
> mkdir a/b
> chattr +C a/b
> echo "hello" > a/b/file
> btrfs sub snap -r ./a ./a.ro
> mkdir x
> btrfs send a.ro | btrfs receive x
> lsattr a.ro
> lsattr x/a.ro
>
> Result is:
>
> # lsattr a.ro
> ---------------C--- a.ro/b
> # lsattr x/a.ro
> ------------------- x/a.ro/b
>
> Expected: x/a.ro/b folder should have CoW disabled (same as a.ro/b folder)
>
> How can I workaround this issue in order to have correct attributes in
> my backups?

It's the exact opposite issue with chattr +c (or btrfs property set
compression), you can't shake it off :)

I think we might need 'btrfs receive' to gain a new flag that filters
some or all of these? And the filter would be something like
--exclude=$1,$2,$3 and --exclude=all

I have no strong opinion on what should be the default. But I think
probably the default should be "do not preserve any" because these
features aren't mkfs or mount time defaults, so I'd make preservation
explicitly opt in like they were on the original file system.


-- 
Chris Murphy

Reply via email to