Several Methods for backing up Linux OS

Source: Internet
Author: User
Article Title: several methods for backing up the Linux operating system. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Several backup methods are introduced here:

  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 more information, see man tar.

A backup

If you want to back up the/home directory and save the backup file in/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/

 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.

Dd

Features

1. Perform block operations to back up the entire hard disk (including partition tables, MBR, and file systems not supported by other Linux systems)

2. compression is supported (a little effort)

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 (/backup is mounted to another hard disk, such as sdb)

1. The simplest, no compression:

Dd if =/dev/sda of =/backup/sda. dd

2. Use gzip for compression

Dd if =/dev/sda | gzip-c #>/backup/sda.dd.gz

Where # is replaced by numbers 1-9, representing the shortest-minimum 3 and bzip2 compression respectively

Dd if =/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-s SIGUSR1 dd

Restore

The restored target disk must be the same size as the original one, otherwise the consequences will be very serious ......

1. No compression

Dd if =/backup/sda. dd of =/dev/sda

2. gzip

Gzip-dc/backup/sda.dd.gz | dd of =/dev/sda

3. bzip

Bzip2-dc/backup/sda.dd.bz2 | dd of =/dev/sda

 Ghost

Ghost runs in dos. We recommend that you use the Wuwei dostoolbox. It is similar to the Windows dostoolbox in linux.

1. Contains ghost, which can back up ext3 partitions

2. Use msdos7.1. 3. Add the shutdown and restart functions.

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.