Monday, May 04, 2009

Using rsync to Fix a Downloaded ISO File


I wanted to upgrade to Mandriva 2009.1 and had the .iso image, but the checksum failed. Since I was at my workshop and had only EVDO modem service, I didn't want to download the entire .iso again and I remembered that I could use rsync to "fix" the damaged .iso file.

To avoid using bandwidth at the garage, I use a USB drive at home (where I have Verizon FIOS) to mirror the current Mandriva repositories using rsync, so I knew that Georgia Tech had an rsync server. I just needed to find the path to the .iso files.

NOTE: Although Mandriva 2009 is now obsolete, the technique described here still works on any downloaded file using and rsync server.

Starting with:

$ rsync rsync.gtlib.gatech.edu::

I eventually wound up with:

rsync://rsync.gtlib.gatech.edu::mandrake/mandrake/official/iso/2009.1/

as the path.

Then, I changed directory to where I had the damaged .iso file and executed (all on one line):

$ rsync -Pz --stats --inplace --ignore-times rsync://rsync.gtlib.gatech.edu::mandrake/mandrake/official/iso/2009.1/mandriva-linux-free-2009.1-i586.iso .

Remember that the rsync paths need to end in a forward slash or rsync won't work and the file names need to be identical.


Used in this manner, rsync compares the two files and only re-downloads the pieces that have been corrupted. Result? A functional .iso file with minimal bandwidth usage.

At some point, I plan to set up an rsync server at home so that I can back up files. Since I have family members that could use some backup plan, I'll include them. Except they all use Windows, so I'll use DeltaCopy, a free, GPL-ed rsync client for Windows. With that, I can automate their backups as easily as I can on Linux.

No comments: