The development of Linux is very rapid, and there is a tendency to catch up with Microsoft. Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. Today we will talk about tar compression for Linux system backup. We hope you will remember tar compression for Linux system backup. After a successful system experiment with tar compression on Freebsd, I also tried it in Linux. The experiment environment is In debian of vmwarevm.
However, the following methods also apply to freebsd. Process:
Back up the file in the directory with the largest space in the system. First use df-h to check the space used and roughly estimate whether the tar file can be placed in the remaining space.
For example, if my directory with the largest available space is/usr, the operation is:
# Mkdir/usr/bak
# Cd/usr/bak
# Vim extfile.txt <= generate this file as a tar file to exclude non-pressure upload. Enter
/Usr/bak
/SeLinux <= if the system is centos, add
/Proc <= This is not required for the freebsd system
/Sys <= freebsd system does not need this
Exit vim and save the file. The above is the directory that requires no pressure on the supervisor.
Then the command is
# Tar czf/usr/bak/backup.tar.gz-X/usr/bak/extfile.txt/
In this way, the backup of the entire system can be generated, a bit like the backup of the Windows ghost clone file.
In the future, you can use this line for system replies, as long:
# Cd/
# Tar xzf/usr/bak/backtar.gz-C/
This can be restored.
Another situation:
Linux livecd and other systems can be used to start the disk, and then mount the original hard disk partition on the command line. The structure should be the same as the/etc/fstab file structure, for example, mount to/mnt, the command is changed:
# Tar xzf backtar.gz-C/mnt/
In fact, if you want to use Linux livecd to partition a new hard disk, you can find the backup.tar.gz to the livecd or the new partition of the new hard disk, and then execute the preceding decompression to create a new system. However, after decompression, run the following command, as for the point solution, I don't know. I want to do this anyway:
# Cd/
#/Bin/touch/. autorelabel
In this way, you can easily use Linux to back up ghost.
- Linux Operating System Operation Note: Add dynamic extensions to PHP
- Operation tips: Linux Desktop OS
- Teach you how to use the PS3 Controller in a Linux operating system
- Differences between Linux and Microsoft
- Easy to learn about LILO configuration in Linux