Preserving ext2-4 attributes

Ciprian Dorin Craciun ciprian.craciun at gmail.com
Tue Dec 17 12:58:52 UTC 2019


On Fri, Dec 13, 2019 at 7:44 PM Alan Stern via rsync
<rsync at lists.samba.org> wrote:
> What is the reason for this behavior?  Is there any way for rsync to
> preserve these attributes?  If not, how can rsync be used to make a
> reliable complete system backup?


[I'll touch only the "reliable complete system backup" topic.]

For backups I regularly use `rdiff-backup` and `rsync` depending on
the occasion.  (`rdiff-backup` mainly for "regular usage"
file-systems, meanwhile `rsync` for archival purposes, or
"snapshots".)

However, besides relying on them I always create an MD5 sums file
before doing the backup, and copy that file as part of the backup.

Also if I care a lot about the file-system meta data (i.e. anything
besides the file name and file content), I employ a different tool
depending on the occasion:
* usually a simple `find` with proper `-printf` usage (including `%U
%G %T@ %n %i %l`, etc.) which can help afterward easily recover
meta-data or hard-links, etc.;
* alternatively `rdup` can be used for this purpose;
* any other tool that outputs the meta-data in machine-readable format;

I do this because the file-system meta-data is so "brittle" that it
can easily be "mangled" by even the simplest commands.


Also, I don't know of any usage of such attributes.  (Are you
encountering an actual real-world use-case?)

In fact I'm glad that `rsync` doesn't touch the immutable attribute,
as such if I know that a certain folder was not touched, (and given
that after a backup I always mark the backup files as immutable), it
can serve as a fail-safe.

Ciprian.



More information about the rsync mailing list