Now that I got my hard drives sorted, I followed Old-Polack's beautiful
instructions from another post for backing up my system using rsync.
Here are O-P's crystal-clear directions:
You would want to do the copying from either a root login, or from the liveCD, logged in as root. I recommend the latter. If you have a separate /home partition, you need to know beforehand which partition that is, and also the partition on which you wish to store the copied directory. It is always best to have the backup partition formatted with an ext3 or ext4 filesystem (whichever is the same as the /home partition) so that permissions for all the files and directories are properly preserved.
Assuming the /home partition to be /dev/sda5 and the backup partition to be /dev/sdb1, if done from a liveCD, the first things you would need are mount point directories. I like /here and /there as they are short, and only exist in memory as part of the liveCD directory tree anyway. We use the mkdir command for this. (make directory)
[root@localhost ~]# mkdir /here /there <Enter>
Now we mount the /home partition on /here and the backup partition on /there.
[root@localhost ~]# mount /dev/sda5 /here <Enter>
[root@localhost ~]# mount /dev/sdb1 /there <Enter>
To check the mounts;
[root@localhost ~]# ls -l /here <Enter>
[root@localhost ~]# ls -l /there <Enter>
The first command should show your ray directory, and the second command whatever is already on the backup partition, if anything.
To copy the entire ray directory as well as all its contents;
[root@localhost ~]# rsync -av /here/ray /there <Enter>
You will see a lot of text lines describing what is being copied, as it happens. When the process is complete you will be returned to the root prompt.
To check the copy;
[root@localhost ~]# ls -la /there/ray <Enter>
You could also navigate to the /there/ray directory with Dolphin, or whatever file manager is on the liveCD, and look around to see if everything looks normal and complete. If all looks good, you have your backup.
Report to moderator Logged
In my case, I first backed up my home partition (same device mounts as above).[root@localhost ~]# rsync -av /here/barry /there <Enter>
This saved my home partition onto my sdb1 drive in a directory named barry
Next, I mounted my root partition:[root@localhost ~]# mount /dev/sda1 /here <Enter>
I next did the same operation to back up my root folder with the following command:[root@localhost ~]# rsync -av /here /there <Enter>
This created a directory named 'here' on my sdb1 drive and saved all the root folder files to that directory.
I now have two new folders on my sdb1 drive -- 'barry' (home) and 'here' (root dir)
Now, I'm getting confused about how to handle the reverse operation to restore the files
if the system gets borked. Not sure whether I'm 'here' or 'there'.
Should I have named the root partition in the rsync command to /here/root or /here/root/ as the source?
Is renaming the 'here' directory on my sdb1 drive to 'root' a good idea to avoid confusion? With, or
without a trailing slash? And what would be the proper parsing of the rsync command for the root
As far as the actual backups, they worked flawlessly and super fast, error-free.
What is your suggestion for the restore operation using rsync?