hddsaver.com

Backing Up Ubuntu

 

Ubuntu is quickly becoming the Linux distribution of choice for home desktop users. As such, people need to learn quick and easy methods by which they can protect their data. Despite Ubuntu's stability, catastrophic failures do happen, and when they do it is important to have a back up so that your data can be recovered.

Like most tasks in Ubuntu, backing up and restoring data is easy enough for any user to attempt. This article is going to run through a mock back up so readers can get an idea of one method of backing up. This is not the only way to do it, but it is one which can be infinitely customized to fit anyone's needs. Code will be in bold.

1) Open the terminal.
This is the your console, where the commands are entered. Your prompt will read something like "username@ubuntu:~$". This will be disregarded for the rest of this article.

2) sudo su
Use the sudo tool to access the privileges of the root user.

3) cd /
Move to the root directory.

4) tar cvpzf mybackup.tgz / --exclude=/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys
We are using the tar tool, with options cvpzf (create archive, verbose mode, retain permissions, zip archive, etc). Then there is the name of the file to be created, mybackup.tgz, though it is always a good idea use the date for easy reference. We will be placing it in the root directory so it is easy to find. The "/" indicates the root of the directory that we want to back up, in this case we chose the root so everything will be stored. We could have just as easily chosen something else so as to limit our backup, say, to just personal data. Next are the objects which need to be excluded- the most important of these is our back up file. After this, it is really your call but by excluding directories you can cut down on the size of the ultimate file, at the risk of possibly losing something.

5) The back up process may take awhile, but when it is done your work is not over. The file should then be moved to a safe location, preferably on not on your local system. A DVD or external device would be the best option.

Expect the back up process to take at least 15 minutes, depending on your system and how much information you have. The file sizes vary from system to system, but a basic, current Ubuntu system with some extras will probably be over a gigabyte. If you want to do a higher compression method the command "tar cvpjf mybackup.tar.bz2" can be used in place of "tar cvpzf mybackup.tgz". This will bzip2 to do the compressing (as indicated by the j option). This method will take longer but should leave you with a smaller file.

Page 2