Does restic explicitly backup or restore extended attibutes?

Hi all,

I use extended attributes in a number of application, including SAMBA (which stores metadata in extended attributes). Does restic backup and or restore these?

FYI, you probably use extended attributes too. You’d be surprised how many apps hide details in the extended attributes on linux and mac, and in “alternate streams” on windows.

On windows, the same question would go for “alternate streams”. Is this something you can even support?

To be fair, since most people don’t know they have details hidden in extended attributes, and “cp” on linux doesn’t copy them by default, most applications must assume attributes are transient and could disappear at any moment.

Many Thanks

PS
While researching this I noticed many people seem to confuse “capabilities”, “attributes” and “extended attributes”. They are all things the OS hides is filesystem inodes… but have vastly different purposes and behaviours…

  • “setcap” is for capabilities which are best NOT restored by default,
  • “chattr” is for “regular” attributes, which generally don’t need backing up
  • “getfattr”/“setfattr” under linux is for “extended attributes” which is what I’m asking about.

Check docs.

And the best way is to test.

1 Like

Thanks for that. I dont know why I didnt find it.

restic does only support POSIX extended attributes but NOT the Linux extended attributes with chattr.
2022 I have written a bug report:

chattr support is very important for me and a showstopper for using restic.
E.g. IBM Service Protect has full extended attributes support, including chattr.

Here is my test:

root@fex:~# ls -l zz
-rw-r--r-- 1 root root 41 May 10 23:31 zz

root@fex:~# chattr +i zz

root@fex:~# restic backup --tag test /root
(...)

root@fex:~# restic snapshots | grep test
7a14d879  2024-05-12 09:31:23  fex         test        /root

root@fex:# restic restore -i /root/zz -t . 7a14d879                                                                                                                                            
(...)

root@fex:~# ls -l root/zz
-rw-r--r-- 1 root root 41 May 10 23:31 root/zz

root@fex:~# lsattr zz root/zz
----i----------------- zz
---------------------- root/zz

root@fex:~# rm -v zz root/zz
rm: cannot remove 'zz': Operation not permitted
removed 'root/zz'

root@fex:~# chattr -i zz
root@fex:~# rm -v zz
removed 'zz'

==> no chattr support!! BAD!