3 ms·
I've had a hard time finding a low-end backup solution (i.e., for personal use) that retains and restores all metadata. Long ago, I assumed that backup (and mo
by hackuser 10y ago
I've had a hard time finding a low-end backup solution (i.e., for personal use) that retains and restores all metadata.
Long ago, I assumed that backup (and move) applications are relatively simple. But it has never seemed to work out that way.
- pdkl95 10y agoTraditionally tar(1) was used as it preserves most metadata. Modern versions even include optional support for ACLs and extended atributes (xattr). It used to be common to see command lines and scripts that piped "tar c" into "tar x" directly as a way of copying files while utilizing tar's metadata-preserving features. Today, back-to-back tar is rarely needed, as cp itself already has options to preserve metadata. In particular, "-a","--archive" turns all the normal features (including --recursive), making metadata-preserving backups as easy as: cp -a $SRC $DST which is a shorthand for cp --recursive --no-dereference \ --preserve=context,links,mode,ownership,timestamps,xattr Just the "-a" option is enough for most simple local backups. Fancier backups are possible with cp's "--backup=numbered" and --reflink=auto features, but my favorite just-works solution for backups is rdiff-backup[1]. It preserves everything, uses rsync internally for minimal data transfer on incremental backups, and many more features. [1] http://www.nongnu.org/rdiff-backup/ http://www.nongnu.org/rdiff-backup/
- jhallenworld 10y agoI still use tar, for example to copy an entire Linux distribution to a new drive is just: mount /dev/sdb1 /m tar cf - . --exclude=./m --exclude=./proc --exclude=./sys | (cd /m; umask 0; tar -xf -) mkdir /m/proc /m/sys grub-install --root-directory=/m /dev/sdb (except you must also adjust UUIDs in /etc/fstab)
- jbronn 10y agoI'm a big fan of fsarchiver (https://www.fsarchiver.org/ https://www.fsarchiver.org/). I've successfully used it for restoring full Windows 7 systems (NTFS), which implicitly requires getting all the metadata correct (e.g., alternate data streams).
- hackuser 10y agoThanks; it looks great on first impression. I'll give it a try.