In this post I'll be using the term "attributes" to refer to the various properties of files. Files can include files, directories, nodes, fifos, whatever linux thinks a file is. By "attributes" I mean the read/write/etc flags, as well as ownership, group, file date, suid, and whatever other flags/stuff linux has on each file.
In the past I've used tar (booted off a livecd) to to do a complete and total backup of my linux. I've had hard drive failures and/or data migrations that caused me to restore from the tar backups (thus testing/verifying this method). They worked fine. All file attributes were correctly preserved. Whew: it worked!
Complete and total tar of a linux system is a bit of a PITA so I decided to use rsync to make a quicker weekly (or so) backup of the running system to an external drive. benefits: (1) only the files changed are written to (or deleted from) the external disk, saving a lot of time and (2) I can run it within the running linux.
I then had a hardware problem which necesitated a wipe and restore. From a livecd I copied the files from the external drive onto the new HD. To insure a proper copy (IE, to preserve ALL file attributes) I piped two tar processes instead of using cp.
In the new restored system, I've been having problems which I have been fixing, one at at time. First, there was no dev and no proc directory. I'd told rsycn to skip them for reasons that made sense at the time. Making a dev and proc allowed the kernel to boot without panic. Xorg refused to run and it turned out (from a google search) that I needed to perform a chmod for "u+s" on the actual Xorg program itself. su doesn't work for non-root and I don't have the ability to access the sound device. My guess is that some sort of protection/attribute thing was lost to some files during the rsync and that I will stumble onto additional problems.
So ... to the actual specific questions
- Can rsync be used to do a total backup (ie, all files, and all flags/attributes) that can later be used to do an total restore to a blank partition?
- If the answer to above is a "yes", what command line arguments did you pass to rsync? How did you run rsync?
- Based on all I have written, what files/dirs in my system need their attributes/protection changed? And in what way?
Thank you in advance.