Ubuntu offers several different ways to backup and restore your operating system. There are backup methods that take snapshots of your directories, such as TimeVault or Flyback, and they allow you to restore your computer to a previous state from the past. These methods are graphical in nature, and very popular with certain people.
Backing up your Ubuntu system from the command line may sound like a daunting task and many beginners may shy away from such a thing but they need not to. Backing up the Ubuntu OS from the command line is not only fast, but it is also perhaps the easiest method available.
So if you find yourself at the point where you like how your Ubuntu system is set up and would like to save it in case you need to do a system restore, then open a terminal window and enter the following:
| sudo su |
| cd / |
| tar cvpzf ububackup.tgz –exclude=/ububackup.tgz –exclude=/proc –exclude=/lost+found –exclude=/sys –exclude=/mnt / |
Note: For some reason the above command is not accurately displayed; the dash in front of every “exclude” command is a double dash.
What the above commands do is “tar” your entire system, except the directories that were excluded, into a compressed file in your root directory named “ububackup.tgz”. It will also preserve the file permissions in their original state. This could take a little while depending on the size of your system. You can take your backup file and transfer it to an external hard drive, DVD, or flash drive.
Later, if you need to restore your Ubuntu system, take the backup file you made and move it to your root directory. Then from the command line enter this:
| tar xvpfz backup.tgz -C / |
By doing this, you will overwrite every single file on your system partition with the ones in your backup file. It’s been said that after restoring your Ubuntu system this way from a backup file you will need to manually create the folders that were excluded, such as /sys, /proc, etc.. but I never seemed to have the need to; the residual folders were fine.
Backing up your Ubuntu system in this manner is a good idea if you’re a tinkerer like me. That way you can totally wreck your system and still have the ability to resurrect your system back to it’s original splendor.





Leave a Reply