Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tar not preserving extended attributes of 'trusted' namespace

Tags:

tar

xattr

Explanation

I am using tar for creating an archive containing a folder and some of its files have extended attributes.

Including these:

  • trusted.size=5
  • trusted.test

I created and extracted the archive this way:

sudo tar --xattrs --xattrs-include='trused\.' -cf file.tar archive_folder .
sudo tar --xattrs --xattrs-include='trused\.' -xvf file.tar -C extracted_folder

The problem

After extracting the files I try to view the attributes:

sudo getfattr -n trusted.size file

But the attributes are always missing. How do I preserve those attributes?

like image 956
Yarden Avatar asked Sep 18 '25 01:09

Yarden


1 Answers

After a little play with the tar creation and extraction lines, iv'e found that tar --xattrs --xattrs-include=* Must be used in order to save and extract xattributes

like image 138
Yarden Avatar answered Sep 21 '25 23:09

Yarden