How to backup system root with tar

Feb 11, 2014 00:00 · 100 words · 1 minute read Linux

Backup and recovery is essential. All my data are backuped every week by cron, but what about my system root? It is easy. There are lots of backup types and methods (e.g. check Ubuntu help). I use good old tool - tar.

So, how to make a backup of the root:

tar -cpJf /mnt/backups/backup.txz --one-file-system /

You can restore the root in easy way too:

tar -xvpJf /mnt/mackups/backup.txz -C / --numeric-owner

If you restore the root and want to have a bootable system, do not forget to restore grub (or another boot loader) and missed folders (tmp, proc, sys) :)