Saturday, 30 June 2012

How-to: Update ISO images with Zsync

"Zsync is a wonderful piece of software that downloads only the parts of a file that are changed, so as to avoid downloading a full copy every time."

Or more fully:

"zsync is a implementation of rsync over HTTP. It allows updating of files from a remote Web server without requiring a full download or a special remote server application. It uses a metafile, which is created on the server, to determine which parts of a file the user already has; it then downloads the remaining parts via HTTP. No special server or Web server module is needed. It also works with gzip files, and content on the server can be compressed to further reduce download times."

The zsync project is hosted on Freecode at http://freecode.com/projects/zsync

This utility is a lifesaver in the Ubuntu Quantal 12.10 testing effort, since the way the Ubuntu CDs are constructed lends itself to updating bootable ISO images using zsync. Given the daily ISO images change incrementally, often by very little, zsync can update your ISO image to a later build quite quickly.

zsync can also perform a checksum comparison making it possible to change the flavour of the ISO (e.g. you have an ISO of Ubuntu and you want to change it to Kubuntu). Zsync will download just the parts that differs between the two versions.

Zsync can be installed by searching for it in the Software Center and clicking install.

Once you acquire your first ISO image (all Ubuntu CD images are stored on http://cdimage.ubuntu.com), Ubuntu archives provide .zsync files using quite similar URIs about the various flavours. For example:

zsync http://cdimage.ubuntu.com/daily-live/current/quantal-desktop-i386.iso.zsync

will sync the server's daily build of Quantal (12.10) desktop for i386) to your local drive holding an older desktop image.

What you see when you run the zsync command is something like this:

robin@D6400:~/Downloads$ zsync http://cdimage.ubuntu.com/daily-live/current/quantal-desktop-i386.iso.zsync
#################### 100.0% 511.6 kBps DONE    

reading seed file quantal-desktop-i386.iso: ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************Read quantal-desktop-i386.iso. Target 73.4% complete.     
downloading from http://cdimage.ubuntu.com/daily-live/current/quantal-desktop-i386.iso:
################---- 80.3% 334.5 kBps         A 

downloading from http://cdimage.ubuntu.com/daily-live/current/quantal-desktop-i386.iso:
################---- 80.3% 1.1 kBps 
##################---- 92.4% 1.1 kBps 1:29 ETA
#################### 100.0% 324.0 kBps DONE     

verifying download...checksum matches OK
used 557817856 local, fetched 202220865

It runs very quickly given a decent Internet connection and has proven very reliable. RC

Image Credit: Photograph courtesy of the Exploratorium via Creative Commons.
Exploratorium: The museum of science, art and human perception at the Palace of Fine Arts 3601 Lyon Street, San Francisco, CA 94123.

No comments:

Post a Comment

At least try to be nice, it won't kill you...