Operation notes: Linux system backup tar Compression

Source: Internet
Author: User

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.

  1. Linux Operating System Operation Note: Add dynamic extensions to PHP
  2. Operation tips: Linux Desktop OS
  3. Teach you how to use the PS3 Controller in a Linux operating system
  4. Differences between Linux and Microsoft
  5. Easy to learn about LILO configuration in Linux

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.