Backup and restoration of Linux operating systems

Source: Internet
Author: User

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 linux package program cvpzf: parameter c-create new document v-output related information during processing p-indicates to keep the same permission z-call gzip to compress the archive file, call gzip to decompress the package. tgz: name of the file to be packaged -- exclude =/pro C: exclude the/proc directory. If you do not package this directory, remember to exclude the packaged file name/: To package all the files in the linux root directory, of course, the entire process of excluding excluded files means 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

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.