Linux backup
The principle is to make a single archive containing all files on the hard disk to make a backup.
Under Linux, it is possible to access all the files and modify them even if they are in use. It is theoretically not necessary, therefore, to run on a Live-CD for backup or restore.
To create and to restore our archive, we will just use tar.
Important
- Before doing the backup: make sure not to include unnecessary files:
- empty the Recycle Bin for each user,
- if you want a backup system, do not include personal documents ...
- also empty the cache folder of fitness: When downloading a packet, it remains on the disk, they must be abolished to win (a lot) of space. For this, type in a terminal:
sudo aptitude clean
- It is very important if you follow this trick directly from the system restore (no Live-CD for example) not to use other software during the backup: do not modify files on the disk during reading tar.
The ideal is to do the backup after installing the system, after installing its software and the like updates like this, the system is clean.
Backup
To get full access to system files, let us root user by typing in a terminal:
sudo su
Then go to where you want to create the archive: here we take the root of the drive: /
cd /
Well, we can create our archive using the following command:
tar cvpzf backup.tgz --exclude=/backup.tgz --exclude=/lost+found --exclude=/media /
Explicitons a bit:
- cvpzf: what are the options: to create (c) showing an archive (v) the scroll on the screen. Each file will retain its permissions (p) using gzip (z) to create the file (f) backup.tgz.
- The records and files after - exclude / are the records that we do not want to include in the archive:
- backup.tgz: we can not of course include the archive itself failing to create a loop ...
- / lost + found, these files are not used to much.
- / media: we must not include the other file systems.
- As we want to save, it puts "/" to include the root file system.
Run the command and then wait as it might take time.
At the end, you end up with a file backup.tgz in the root file system containing all the files in "/" we have not excluded.
Bookmarks