Talking about the backup strategy of Linux system

Source: Internet
Author: User
Tags rewind root directory

Why should I back up the Linux system

An application of the Linux system, affected by the internal environment, the impact of the underlying hardware, the attack of foreign hackers, the problem is unavoidable, as a system management personnel, their own responsibility is not to ensure that the system will never have problems, in fact it is impossible, but in the system failure or collapse, To the fastest speed, in the shortest possible time to restore the operation of the system, to ensure data security, the failure to bring the loss to a minimum.

This requires that system administrators have a reasonable backup recovery strategy for operating systems and business applications, and that a perfect backup strategy can guarantee 0 downtime and complete recovery of data for the business. Because the business is running on the operating system, the backup and recovery efficiency of the operating system is directly related to the recovery of the entire business system. So the backup of the operating system becomes critical.

Two Linux systems need to back up the data

Under Windows There is ghost software, you can completely copy the entire system to another hard disk, Ghost is a disk mirroring technology, you can mirror all the data on the system disk to another backup hard disk, when the system problems, with a backup of the mirror disk, in a short period of time to fully restore all the system data.

Linux Although there are similar ghost tools, but due to hardware compatibility, recovery complexity and so on, ghost is not good for Linux mirrored backup, and if the Linux system disk partition is too large, backup and recovery process will be very long, Therefore, ghost is not suitable for backing up the Linux operating system.

In fact, the overall backup system is not a good strategy, the Linux operating system does not need a full backup, we only need to back up all the system's configuration files, so that the backup process quickly and recover quickly.

The files that Linux systems need to back up can be roughly divided into two categories: system-level configuration files and user-level profiles.

System-level configuration files are primarily system-wide configuration information, such as the/etc/directory,/home directory,/boot directory,/root directory, and so on. These directories are critical to system operation and vary for different system application settings, and if these files are lost, it will take longer to reconfigure the system even if the new operating system is installed quickly.

User-level profile is the user's business application and system-related configuration files, which are necessary to run the system business applications, once lost, the system business will not start, such as/usr/local the entire directory,/var/www directory,/etc the entire directory.

Important files are required to be backed up, so what directories do not need to be backed up, such as the/dev directory, the/proc directory,/mnt directory,/tmp directory are not required to back up, because these directories are either memory data, or temporary files, no important data, The principle of backup is that important data must be fully backed up, and useless data will never be backed up.

Medium and mode of three backups

To back up the data, there must be a security container for the data, and the basic requirements for storage media are generally considered in three aspects, such as access speed, storage security, and storage capacity.

Access speed is a basic requirement of storage media, data backup is a very frequent process of read and write operations, very high access to backup media, can greatly shorten the time to backup data, but also reduce the time to recover data.

Storage security is a hard requirement for storage media, unsafe storage devices are not as good as storage media, and now many storage devices have a lot of security optimizations, such as RAID disk array, cache read and write. Professional storage vendors have EMC, IBM, Sun, and so on, all have their own storage devices.

Storage capacity is also the choice of storage media must consider an aspect, too large storage space will cause the waste of storage equipment, too small storage space, resulting in data storage failure, therefore, must be based on the size of the backup data, the corresponding size of the storage media.

1. Common Backup media

The most common storage media are optical drives, disks, tape drives, floppy disks, and so on, and here is a brief introduction to how the tape drives are used:

There are many ways to use a tape drive under Linux, and the tar command is the most frequently used method, and tar is primarily used in stand-alone environments to write data directly to a tape drive. The corresponding device name of the tape drive under Linux is/DEV/STX, if the first tape drive is/dev/st0, the basic operation is as follows:

(1) Rewind, roll the tape to the starting position

Mt-f/dev/st0 Rewind

(2) Erase the contents of the tape

Mt-f/dev/st0 Erase

Newly purchased tapes, which can be used after opening, do not need to be erased, and when the data is filled with tape, the tape can overwrite the original data and continue to write, so no erasing action is required, because there is some damage to the tape due to erasing, it is not recommended to perform a wipe operation.

(3) Out band, the tape will be rolled to the initial position and then ejected from the tape drive

Mt–f/dev/st0 offline

(4) List the contents or files on the tape by tar

Tar tvf/dev/st0 [files or directories that need to be viewed]

If you do not follow any files or directories, you view all the data on the tape, and when there is no data on the tape, performing this error will not affect the use of the tape.

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.