Is there any good reason to not use the
tar command on the root directory for a full system backup? Alternatively, is there a better way to create a full copy of your Linux system?
Whether a tar based backup works for you depends on what kind of meta data you like to archive and what tar implementation you are using.
GNU tar recently added support for Linux ACLs, but the support is defective and it may be that files are extracted with ACLs that are not in the archive, but have been inherited from the parent directory. This may give access to users that should not have this access.
Similar problems apply to the SELinux support in GNU tar.
If you do not rely on this kind of meta data and if you do not plan to make incremental backups, you may use GNU tar.
BTW: the most recent version of
star (in schilytools) added SELinux support.
People who believe that it is possible to use GNU tar for incremental backups, should run this script to verify that it does not work. A related bug report has been send to the GNU tar maintainers in September 2004, in 2011 and in 2016, this bug is known since 14 years:
if [ "$gtar" ]; then # # Permit: gtar=/tmp/tar-1.30/src/tar sh gnutarfail.sh # GT=`"$gtar" --help 2> /dev/null | grep GNU` else GT=`gtar --help 2> /dev/null | grep GNU` if [ "$GT" ]; then gtar=gtar else # Some systems have "gtar" installed as "tar" GT=`tar --help 2> /dev/null | grep GNU` if [ "$GT" ]; then gtar=tar fi fi fi if [ -z "$GT" ]; then echo No gtar found exit 1 fi echo gtar installed as $gtar # Preparation complete #----------------------------------- cd /tmp mkdir test.$$ cd test.$$ set -x mkdir test mkdir test/dir1 mkdir test/dir2 echo dir1-file > test/dir1/dir1-file echo dir2-file > test/dir2/dir2-file $gtar -g/tmp/test.$$/listed-incr -c -f /tmp/test.$$/full.tar test rm -rf test/dir2 mv test/dir1 test/dir2 $gtar -g/tmp/test.$$/listed-incr -c -f /tmp/test.$$/incremental.tar test mv test orig $gtar -x -g/dev/null -f /tmp/test.$$/full.tar $gtar -x -g/dev/null -f /tmp/test.$$/incremental.tar