Backup and restoration of the Linux operating system will be performed on the Linux operating system in the past two days. after checking some information, we will record the backup and restoration commands: 1. backup: # switch to root [plain] sudosu # enter the system root directory [plain] cd/# run the packaging command [pla... backup and restoration of the Linux operating system will be performed on the Linux operating system in the past two days. after checking some information, we will record the backup and restoration commands: 1. backup: # switch to root [plain] sudo su # enter the system root directory [plain] cd/# run the packaging command [plain] tar cvpzf linuxbackup. tgz -- exclude =/proc -- exclude =/lost + found -- exclude =/linuxbackup. tgz -- exclude =/mnt -- exclude =/sys/command explanation: tar: Common package program in linux cvpzf: type tar Parameter c-create a new document v-output related information during processing p-indicates that the same permission is maintained z-call gzip to compress the archive file, call gzip to decompress the package. tgz: name of the file to be packaged -- exclude =/proc: exclude/proc directory. if this directory is not packaged, remember to exclude the packaged file name /: indicates packaging all the files in the linux root directory. of course, the excluded files are not included. the whole process is understood as creating a new file named linuxbackup. tgz compresses the file. it stores the file after the specified directory is excluded and saves the original permission settings. here, you must write down the excluded directory and create it manually when restoring it. If you want to exclude directories, you must select different environments and work. After the command is executed, it will take some time to copy linuxbackup. tgz to other places. The backup is complete. Note: do not perform any operations during the packaging process. otherwise, some files will be modified. after the backup, tar will prompt an error. The same is true for restoration. 2. restore # switch to root [plain] sudo su # enter the root directory [plain] cd/# decompress and restore the system [plain] tar xvpfz linuxbackup. after running tgz-C/and so on, do not rush to restart the system. remember to create the directories excluded during the backup and manually create them. for example, we excluded them above, we need to create [plain] mkdir proc mdkir lost + found mkdir mnt mkdir sys and then restart the system. Recovery completed
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service