Contributed by Forrest Taylor
In Red Hat® Enterprise Linux® 4,
tar could not handle the extra information stored in ext2 and ext3 file systems called Extended Attributes (EAs or xattrs). This is a potential problem for backups, because SELinux and ACLs use these Extended Attributes to store the security contexts and access control lists respectively. star shone brightly as it has options for backing up and restoring each of these attributes.
Great strides have taken place in rebuilding tar to acknowledge these Extended Attributes, and with Red Hat Enterprise Linux 5 comes a new tar with options for xattrs. tar now has three options for creating an archive with xattrs in mind:
--selinux Archive the SELinux attributes of the files and directories
--acls Archive the ACL attributes of files and directories
--xattrs Archive all Extended Attributes of files and directories.
This includes both SELinux and ACL attributes, as well as any other xattr.
Optionally, if you don’t want to use the xattrs there are three other options:
--no-selinux Do not use the SELinux attributes
--no-acls Do not use the ACL attributes
--no-xattrs Do not use any xattrs, including SELinux and ACL.
tar does not archive the xattrs, thus the previous three options are normally used at the time of restore.
Additionally, newly created file systems in Red Hat Enterprise Linux 5 now contain the
user_xattr default mount options, so these tar options are necessary for good backups.