Archiving/transferring Extended Attributes...
Tim Kientzle
kientzle at freebsd.org
Sat Mar 11 01:17:42 UTC 2006
All,
As the developer/maintainer of libarchive and bsdtar, I've been very
interested in finding good ways to archive, transfer, and restore all
kinds of file metadata, including ACLs and extended attributes.
Libarchive/bsdtar supports ACLs (following the approach used by Joerg
Schilling in 'star', which addresses some problems with the POSIX.1e
draft), but does not yet have full support for extended attributes.
Jaakko Heinonen recently sent me some patches to add extended attribute
support for Linux (which should be easy to extend to other platforms),
but I have a few questions that people on this list might be able to
help with.
First, here is my basic understanding (if anyone can point out systems
where these assumptions fail, I'd much appreciate):
* An "extended attribute" is essentially a key/value pair.
* The value is an arbitrary block of binary data.
* Values are almost always less than a few kilobytes long. Values
longer than a megabyte are very unusual.
* The key is a text name (? see below ?).
* Keys are organized into "namespaces," which can be rendered using
dot-separated tuples: "system.foo" is in the "system" namespace,
"user.bar" is in the "user" namespace.
Here are some of my questions:
* Are keys always text? Are they limited to ASCII? Can they always
be translated to UTF-8? (Background: I'm basing my work on "pax
extended format" which uses UTF-8 very heavily.)
* What keys should be archived for single-system backup/restore? (I
would presume "all," but I fear there may be extended attributes used
internally by some systems that should not be touched or cannot be changed.)
* What keys should be archived for cross-system copying of files? (I
would assume the "system" namespace should not be copied across systems.
In particular, I know that FreeBSD's extended attribute system stores
ACLs and other standard data in extended attributes; I'm not entirely
comfortable backing up such data in two different forms.)
* Are there platform-specific namespaces that should not be archived?
(I've been told that "xfsroot" namespace on Linux should not be touched.)
* My understanding right now is that the primary client of extended
attributes on Linux and FreeBSD is the Samba file server. I believe
that just archiving the "user" namespace would suffice for Samba. Do
other applications have other requirements?
Does anyone here have experience designing a backup/restore/transfer
system for extended attributes?
Any insight or suggestions are appreciated,
Tim Kientzle
mailto:kientzle at freebsd.org
More information about the posix1e
mailing list