Brief Introduction to linux backup methods

Source: Internet
Author: User

There are many backup methods for Linux systems, including the commands provided by the system itself. Here we will summarize the four backup methods for Linux systems.

Linux System BackupMethod 1

Tar:
Features
1. Retain Permissions
2. Suitable for backing up the entire directory
3. You can select different compression methods.
4. If you choose not to compress, you can also perform Incremental backup and partial restoration. For details, refer to mantar.

A backup
If you want to back up the/home directory and save the backup file to/backup, you can mount an independent partition here), run the following command: Use uncompress, fast
Tar-cpf/backup/home.bak.tar/home

Gzip compression is used, and the speed is normal.
Tar-cpzf/backup/home.bak.tar.gz/home

It is compressed with bzip2, which is slow but about 5% less than that of gzip.
Tar-cpjf/hackup/home.bak.tar.bz2/home

The second parameter is described as follows:
C create
P reserve Permissions
Use gzip to process z
J processing with bzip2
F followed by the file name
You can also add v to display the backup process on the terminal.

B restore
Tar -- overwrite-xpf/backup/home.bak.tar-C/


Linux System BackupMethod 2:

K3b CD)
Features
Everything is done by yourself, which is more selective for files.
Backup and Restoration
There is nothing to say. You can use k3b to make a CD and restore the file to be restored.

Linux System BackupMethod 3:

Dd
Features
1. Perform block operations to back up the entire hard disk, including partition tables and MBR. Other file systems that are not well supported by Linux)
2. compress data)
3. Because the entire hard disk is backed up, the space that is not used in the file system will be saved, and the backup file is large.
Backup
Back up the hard disk sda and mount it to/backup on other hard disks, such as sdb)
1. The simplest, no compression:
Ddif =/dev/sdaof =/backup/sda. dd

2. Use gzip for compression
Ddif =/dev/sda | gzip-c #>/backup/sda.dd.gz

Where # is replaced by numbers 1-9, representing the shortest-minimum 3 and bzip2 compression respectively
Ddif =/dev/sda | bzip2-c #>/backup/sda.dd.bz2

# Replace the value with numbers 1-9, which respectively represent the shortest-minimum
If you want to view the progress, you can send the signal SIGUSR1 to dd:
Killall-sSIGUSR1dd

Restore
The restored target disk must be the same size as the original one, otherwise the consequences will be very serious ......
1. No compression
Ddif =/backup/sda. ddof =/dev/sda

2. gzip
Gzip-dc/backup/sda.dd.gz | ddof =/dev/sda

3. bzip
Bzip2-dc/backup/sda.dd.bz2 | ddof =/dev/sda


Linux System BackupMethod 4:

Ghost
Ghost runs in dos. We recommend that you use the Wuwei dostoolbox, a kind similar to the dostoolbox under win, which is used in linux. 1. including ghost, you can back up ext3 partition 2. use msdos7.13. to add shutdown and restart Functions

  1. How to solve Linux host intrusion Problems
  2. Linux security command 1)
  3. Detailed analysis of Linux System Network Services
  4. Three Tips for improving Linux Management Efficiency
  5. Solve Linux root password retrieval

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.