As a rookie, in the process to Linux, the Linux often lead to a variety of errors, recoverable or unrecoverable (at least in the present case), so, for me, backup and restore on Linux particularly important.
1. Backup
a) directly backup the entire file system ( '/') through the tar, but there are few points to note:
i. can not back up the following files (directory)
1. The current archive
2. / proc folder
3. / lost + found folder
4. / mnt folder
5. / sys folders
6. / media folder
b) Therefore, the command is:
cd cd / tar cvpzf backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.gz --exclude=/mnt --exclude=/sys --exclude=/media /
1. Note: p option to save the current authority on behalf of
2. Restore
a) Linux can then travel system is to restore the system, if the current startup can not start, can be started by live cd and perform recovery operations
b) operating below
cd cd / takes xcpfz backup.tar.gz -C /
c) the need to create additional directory
i. mkdir proc
ii. mkdir lost+found
iii. mkdir mnt
iv. mkdir sys
mkdir proc mkdir lost+found mkdir mnt mkdir sys
Reference Links: https://blog.csdn.net/xuxuchuan/article/details/81411809