Ubuntu system backup

Source: Internet
Author: User
Ubuntu system backup is well known to be a frequent cause of system crashes during ubuntu system upgrades. to prevent this, it is necessary to back up the system properly. I upgraded the system after this vacation and spent the screen. after one afternoon, I was unable to fix it. I will run/boot/grub. change cfg... ubuntu system backup is well known to be a frequent cause of system crashes during ubuntu system upgrades. to prevent this, it is necessary to back up the system properly. After returning from this vacation, I upgraded my system, and the screen took a long time, so I couldn't fix it all the time. I will run/boot/grub. cfg was changed and tried to restore the kernel to the previous kernel. Finally, the uname-I prompt was unknown, so I had to reinstall the system. I will not talk about it unless I have tried it. it is quite simple to back up the system in linux. First, let's take a look at my disk partition structure: $ df-H file system capacity in use % available mount point/dev/sda6 5.0G 433 M 4.3G 10%/udev 995 M 380 K 994 M 1%/devnone 995 M 12 K 995 M 1%/dev/shmnone 995 M 84 K 994 M 1%/var/runnone 995 M 0 995 M 0%/var/locknone 995 M 0 995 M 0%/lib/init/rw/ dev/sda1 198 M 37 M 151 M 20%/boot/dev/sda3 15G 2.7G 12G 20%/usr/dev/sda5 7.4G 856 M 6.2G 12%/var/dev /sda7 5.0G 139 M 4.6G 3%/tmp/dev/sda8 113G 80G 28G 75%/home/dev/sdb4 63G 4.7G 55G 8%/media/sys_bak according to the above running results, my system is backed up by four partitions, namely: // boot/usr/var. in other partitions,/home can be backed up./media/sys_bak is my mobile hard disk, the commands tar-cvpzf/media/sys_bak/laptop_sys/boot.tar.gz/boottar-cvpzf/media/sys_bak/laptop_sys/root.tar.gz -- exclude =/ media -- exclude =/home -- exclude =/usr -- exclude =/var -- exclude =/tmp -- exclude =/boot -- exclude =/mnt -- exclude =/proc-exclude = /Lost + found/tar-cvpzf/media/sys_bak/laptop_sys/usr.tar.gz/usrtar-cvpzf/media/sys_bak/laptop_sys/var.tar.gz/var take the second command as an example: tar is the command name used for backup. c. create a backup file v verbose mode, and output the tar runtime to the screen p to save the license, apply to all files and use 'gzip' to compress the backup files. if you need to use 'bzip2' to compress the backup files, then, you can use jf to describe the storage location of the backup file./media/sys_bak/laptop_sys/root.tar.gz is the storage location of the backup file, the "-- exclude = xxx" option on the mobile hard disk indicates the subdirectory that does not need to be backed up. the "/media" and "/mnt" options are mainly used to mount other storage media. -- exclude must be used here, perform an infinite recursive backup with several other partitions. Note that the directory name should not be followed by/. for example,/media cannot be written as/media/. if you want to, you can write the preceding four commands to a file for execution. The following is the Restore command tar-xf/media/sys_bak/laptop_sys/boot.tar.gz-C/boot and above. the-C parameter specifies the directory to which the tar program is extracted. In this example, it is/boot.
Related Article

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.