1: Backing-up
To do this, become root with
sudo su
and go to the root of your filesystem
cd /
Now, below is the full command I would use to make a backup of my system:
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /
'cvpfz' are the options we give to tar, like 'create archive' (obviously),
'preserve permissions'(to keep the same permissions on everything the same), and 'gzip' to keep the size down.
Next, the name the archive is going to get. backup.tgz in our example.
Next comes the root of the directory we want to backup. Since we want to backup everything; /
tar zcvf backup.tgz --one-file-system /
Mounted folders wont be part of the backup. Easier than previous method.
2: Restoring
tar xvpfz backup.tgz -C /
WARNING: this will overwrite every single file on your partition with the one in the archive!
Create the excluded folders
mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys
etc...