Article Title: Use rsync to repair incomplete Linux CD image files. 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.
1. Causes of Verification Code problems during the download process of the CD image;
Sometimes the download tool is not supported. For example, some download tools do not support files larger than 2 GB, so a file originally 3 GB is displayed, and then 2 GB is downloaded, if the file is incomplete, the verification code is inconsistent. On the other hand, sometimes there is a problem with the file we selected, it will also cause the downloaded file. iso is inconsistent with the Verification Code provided by the official team;
Example:
For example, The SHA1 Verification Code of Fedora Core 5.0 officially seen in Fedora is as follows:
Ed9a852cf77250c3ae111c621d350af5c0b0a29b FC-5-i386-DVD.iso
When an FTP download is found to be inconsistent with the official one, the result is completely unavailable. Can we download it again or find a solution? The answer is of course to find a solution. So we introduced rsync;
2. Use rsync to solve the problem of incomplete images;
We all know that the main function of rsync is to synchronize backups and images, provided that the rsync server is available. What I mean is that rsync cannot synchronize content on the ftp server, I think you should understand this. Currently, most Linux releases have rsync servers, so we can use the sources on rsync servers to synchronize incomplete CD images;
Of course, we can also use rsync to download files on the rsync server. We use rsync's synchronization repair function to solve our problems. Actually, this function is really good;
2.1 find the rsync server of the Linux release version;
Because rsync cannot synchronize the image files on ftp and web servers, we cannot use the FTP or WEB server address of the CD image; we need to find an address similar to the following;
Rsync: // mirrors.kernel.org
You can only find the desired image on the rsync server. You can find the desired image on the server list provided by the official release;
2.2 rsync access method to the server;
For example, I have a problem with the FC-5-i386-DVD.iso downloaded through wget, I want to use rsync to solve the problem; So first I need to find the rsync server with the FC-5-i386-DVD.iso; so I went to the Fedora.redhat.com download list to find, this file is found on rsync: // mirrors.kernel.org; so we need to enter this server first; Do not omit/behind the address so that files in the server or server directory will not be listed;
[Root @ localhost beinan] # rsync: // mirrors.kernel.org/
Mirrors All mirror sites debian Debian Linux distribution mirror redhat RedHat mirror fedora-RedHat community project Fedora. us fedora. us-Additional stuff for Fedora centos CentOS-An Enterprise-class Linux distribution opensuse OpenSUSE-Novell's community project
We found that there was a fedora image on this server; so we went in at the first level; execute the following command;
[Root @ localhost beinan] # rsync: // mongodrwxr-xr-x 4096 2005/02/03 08:05:26. drwxr-xr-x 4096 2006/03/17 00:41:43 core drwxr-sr-x 4096 2006/03/18 03:05:05 extras
...... ......
[Root @ localhost beinan] # rsync: // mirrors.kernel.org/fedora/core/5/ I #/iso/ drwxr-xr-x 4096 13:39:03. -rw-r -- 3253669888 2006/03/15 12:49:55 FC-5-i386-DVD.iso-rw-r -- 687235072 2006/03/15 12:47:10 FC-5-i386-disc1.iso-rw-r -- 700618752 2006/03/15 12:48:05 FC-5-i386-disc2.iso-rw-r -- 721016832 2006/03/15 12:50:35 FC-5-i386-disc3.iso-rw-r -- 720910336 2006/03/15 12:51:46 FC-5-i386-disc4.iso-rw-r -- 387753984 2006/03/15 12:52:16 FC-5-i386-disc5.iso-rw-r -- 79122432 2006/03/15 12:31:59 FC-5-i386-rescuecd.iso-rw- r -- 671 2006/03/15 13:38:25 SHA1SUM
We found the FC-5-i386-DVD.iso, then we will proceed to the next process, synchronization file;
2.3 use rsync to synchronize the File Syntax;
First we have to go to the local machine to store the directory of the previously downloaded, but there is a problem with the FC-5-i386-DVD.iso (or continue with the previous example), and then execute commands similar to the following;
The command format is as follows:
Rsync-the rsync address of the vzP image file you downloaded earlier
For example, I had a problem with the FC-5-i386-DVD.iso I downloaded before, and now I want to use rsync synchronization to fix it, so I put the FC-5-i386-DVD.iso file into a directory named fc5iso;
[Root @ localhost beinan] # cd fc5
[Root @ localhost fc5] # ls-la drwxr-xr-x 2 root 136. drwxr-xr-x 20 beinan 472 ......
-Rwxr-xr-x 1 beinan 2276458496 FC-5-i386-DVD.iso
Then execute;
[Root @ localhost fc5] # rsync-vzP rsync: // mirrors.kernel.org/fedora/core/5/ I ?/iso/fc-5-i386-dvd.iso FC-5-i386-DVD.iso
It may take several minutes for the relevant information to appear, or a download prompt or something like that. If there is a download or something like that, you don't have to worry about it. This indicates that it is working properly; we only have to wait. If we look at what this directory has, we will understand. The principle of rsync is to first download files from the local existing files, and then compare the files on the server. If the downloaded files are incomplete, the files will be downloaded from the server. If there is an error, it will generate a temporary file, which is similar to the following ...... ......
[Root @ localhost fc5] # ls-la total usage 5253889 drwxr-xr-x 2 root 136. drwxr-xr-x 20 beinan users 472 ......
-Rwxr-xr-x 1 root 2276458496 FC-5-i386-DVD.iso-rwx -- 1 root 3103522816. FC-5-i386-DVD.iso.SI37yU
After the operation is complete, a prompt similar to the following will be displayed, and rsync will be automatically deleted. File temporary file, update FC-5-i386-DVD.iso.
FC-5-i386-DVD.iso 3253669888 100% 164.78kB/s 5:21:22 (1,100.0% of 1)
Wrote 381831 bytes read 953051797 bytes 48730.35 bytes/sec total size is 3253669888 speedup is 3.41
After this simple process, we updated the problematic files synchronously. Then we can check the integrity of the file. In this way, we can correct the problematic file. Can this problem be solved? Only after trying;
Note: a larger space is required for file synchronization. During synchronization, rsync creates a temporary file of the same size as the downloaded file;
3. Brief Introduction to rsync versions;
Rsync has a Windows version. Most of the Linux releases come with their own versions. It is okay to install rsync. But I have to talk about the Windows version. Just download the client;
Http://www.samba.org/rsync/download.html
4. About this article;
Everything is for application. After downloading the FC5 DVD a few days ago, I found that the DVD is not usable. So I thought that rsync may synchronize and fix it, so I tried it and the result was good. So I wrote this article. Oh ...... I have written too much, but it is actually a single sentence, but I have written a lot. It seems that the level ...... ...... :(
5. references;
Http://www.samba.org/rsync/documentation.html