Backup in Linux

Source: Internet
Author: User


A common question for Linux system administrators is: how do I back up my system? For Windows systems, it is easy to back up data (you only need to click the mouse in menu mode ). Linux backup is much more troublesome. If you are not familiar with Linux system files and devices, the situation will become worse. This article Article This article discusses how to protect data and related device information in Linux.

1. What is backup?
In the simplest way, the process of backing up data is to copy important data to other media (usually movable) to ensure that the data can be restored when the original data is lost. A backup may be a simple CP command, copying a file to another directory, or using a specificProgramThe complex process of writing data streams into a specific device. In many cases, the data to be backed up is written to the tape drive, but this is not the case in some cases. In a Linux environment or other UNIX system, backup can be to copy files to an existing file system, a replaceable file system, a tape drive, and a remote file system, even the tape drive on the remote system. Of course, from the user's perspective, there is no concept of a tape drive or zip drive, but just a file.

2. Which backup device should I select?

There are many devices on the market that claim to be "perfect system backup options", including tape drives, portable disk drives, and even mysterious Internet backup systems. For backup operations, the tape drive provides the most trusted storage method. Why is it a tape drive? Of course, the Jaz or zip drive of Iomega seems to be an interesting backup tool, but they are easy to cause problems when the hard drive crashes due to the file system. For Internet backup, when you cannot access the Internet due to system crash, you cannot recover system data. Likewise, can you trust that your data is stored in another remote system?
Therefore, we chose a tape drive, but how can we access it? As mentioned earlier in the article, in Linux, from the perspective of user status, anything can be seen as a file. Therefore, you can "open" an appropriate tape drive file to write data to the file. Although it sounds too simple, this is the actual situation. In Linux, the/dev directory of the root file system contains all files associated with physical devices. These files are actually operated on the underlying physical devices. The following table describes how device files are associated with physical devices in Linux:
Device rewinding does not roll back (no-Rewind)
1st SCSI tape drive/dev/st0/dev/nst0
2nd SCSI tape drive/dev/ST1/dev/nst1
Nth SCSI tape drive/dev/ST [n-1]/dev/nst [n-1]
1st atapi tape drive/dev/ht0/dev/nht0
2nd atapi tape drive/dev/HT1/dev/nht1
Nth atapi tape drive/dev/HT [n-1]/dev/NHT [n-1]
1st floppy tape drive/dev/ft0/dev/nft0
As shown in the preceding table, the device name is based on the Logical Number of the device that is located in a layered structure for this device type, rather than its physical ID (SCSI) or IDE channel (atapi ). Therefore, even if a SCSI host is assigned ID4 as the SCSI device, if it is the first tape device of the SCSI chain, it will be/dev/st0 instead of/dev/st4, this naming convention is useful for tracking tape devices in the system, and even for tape devices with multiple drive types. Similarly, in the 2.0.x kernel, only a single atapi device is supported. In the 2.2 kernel, multiple atapi drivers (ht0, HT1,...) can be used ,...).

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.