I’ve been playing a bit with my main PC to try to learn this. Because GNU/Linux is so easy to install, I typically only backup my data and never the OS. So this is new for me.
I tried the following line less than an hour ago, where my konsole was open in a directory on my external hard drive (where this is all one line):
dar -m 256 -zbzip2 -s 1500M -D -R / -c `date -I`_data -Z "*.gz" -Z "*.bz2" -Z ".zip" -Z "*.png" -P home -P tmp -P mnt -P var/run -P run/media -P sys -P dev/pts -P proc -P floppy -P burner -P cdrom
I put var/run, run/media, and sys with a -P option so to (1) not backup the external hard drive, and (2) avoid many permission errors with sys. I hope it is not necessary to backup sys ??
I did receive an error : “Error reading inode of file /run/user/1000/gvfs : Permission denied” which has me puzzled. After the dar was complete I saw this:
--------------------------------------------
398568 inode(s) saved
including 9453 hard link(s) treated
0 inode(s) changed at the moment of the backup and could not be saved properly
0 byte(s) have been wasted in the archive to resave changing files
0 inode(s) not saved (no inode/file change)
0 inode(s) failed to be saved (filesystem error)
8 inode(s) ignored (excluded by filters)
0 inode(s) recorded as deleted from reference backup
--------------------------------------------
Total number of inode(s) considered: 398576
--------------------------------------------
EA saved for 2 inode(s)
--------------------------------------------
and on the disk I had these backup files:
-rw------- 1 oldcpu users 1572864000 Feb 8 13:44 2015-02-08_data.1.dar
-rw------- 1 oldcpu users 1572864000 Feb 8 13:53 2015-02-08_data.2.dar
-rw------- 1 oldcpu users 1010326253 Feb 8 13:58 2015-02-08_data.3.dar
Note the files are in 1.5 GB chunks. That was me wanting to preserve the option of using a VFAT in case I can’t mount the hard drive, but rather I can use a USB stick instead.
Also note those files add up to only ~4 GBytes and to me that looks a bit small and that surprised me. … On this PC the command ‘df -Th’ gives:
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb5 ext4 48G 9.1G 38G 20% /
......
indicating 9.1GB in my /. I’m asking myself, was the compression that good, and I did I exclude that much with my various options ? I note /var and /tmp and /boot/efi are on their own partitions (as is /home).
I have a couple of old spare PCs running GNU/Linux, and I think what I need to do now is do a ‘dar’ backp of the OS on one of those PCs (using something similar to the above line) and then delete all files on the / (but not touch the /home) and see if I can recover using the backed up dar files. If I fail those PCs, there is nothing lost as I have kept them so I can ‘play’ and ‘learn’.
nrickert, many thanks for your contribution/help/suggestions here.