| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Up-date an ISO file using zsync

Page history last edited by Paul G. Taylor 15 years, 5 months ago

Up-date an ISO file using zsync.

 

Once you have an ISO file for a distribution, you can use this as a basis for updating to a newer version and avoid having to download unchanged files.

 

Here's how you do it : --

 

  1. Download and install zsync on your computer, in Linux. Either use Synaptic and your distro's repositories, or source from here.

    This is easy and safe as zsync installs everything it needs in the one folder, so it will not upset anything else on your system.

  2. Locate the ISO file, or CD/DVD that you already have and make it available to be read when needed.
  3. Obtain the URL of the .zsync file for the new ISO. You will need the cooperation of someone who has the ISO and can host a small file, about 0.1% of the ISO in size. Ideally both the ISO file and the ISO.zsync file will be hosted in the same folder.
  4. In a Konsole window, locate to the folder where you wish to place the new ISO file and point zsync to the old ISO or CD/DVD and the URL for the .zsync file of the new ISO . Make sure that there is room for double the size of the ISO file as zsync creates a temporary file of equal size to the target file.

     

     

    Example : paul@PAULS:/mnt/hdb6/Klikit_Linux/ISO_File$ /usr/local/bin/zsync  -i /mnt/hdb6/Klikit_Linux/ISO_File/klikit-ff-0.1-3a.iso /mnt/hdb6/Klikit_Linux/ISO_File/klikit-ff-0.1-5b.iso.zsync

     

     

     

    Breaking that down : --

    The user is 'paul' on the computer called 'PAULS' and Konsole is located in the folder '/mnt/hdb6/Klikit_Linux/ISO_File'

    Because I was in Linspire, I had to use the full path of the installed zsync program, ' /usr/local/bin/zsync'

    The -i option indicates that there is an earlier version of the ISO file that can be reused. Without this, the entire ISO file will be downloaded de novo.

    The old ISO is located, with full path, at '/mnt/hdb6/Klikit_Linux/ISO_File/klikit-ff-0.1-3a.iso', this is the source of unchanged files, and 

    The 'recipe' for the new ISO is found at '/mnt/hdb6/Klikit_Linux/ISO_File/klikit-ff-0.1-5b.iso.zsync, since in this case I had previously downloaded the .zsync file,

     for the sake of the exercise, although you don't usually do it that way.  Ususlly, this will be the URL of the .zsync file posted somewhere on the Internet - either as an ftp or an html site.

     

                      Example 2 : In another folder and with the original URL replacing my local file's location.

     

    paul@PAULS:/downloads/ISO_File$ /usr/local/bin/zsync  -i /downloads/klikit-ff-0.1-3a.iso http://-Substitute-the-hosting-domain-.com/klikit/klikit-ff-0.1-5b.iso.zsync 

     

  5. Here is the rest of the output in my Konsole window, showing how zsync downloaded six segments, rebuilt the updated ISO and finished, saving 66.6% of the download in the process It did not save 66.6% of the time, though, because it took quite some time to calculate which segments were needed to be downloaded, but it did save about half the time on my T1 speed DSL connection. It would be much more on a dial-up connection and less on a faster connection.

     

     

    paul@PAULS:/mnt/hdb6/Klikit_Linux/ISO_File$ /usr/local/bin/zsync  -i /mnt/hdb6/Klikit_Linux/ISO_File/klikit-ff-0.1-3a.iso http://-Substitute-the-hosting-domain-/klikit-ff-0.1-5b.iso.zsync

    reading seed file /mnt/hdb6/Klikit_Linux/ISO_File/klikit- ff-0.1-3a.iso: *********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************Read /mnt/hdb6/Klikit_Linux/ISO_File/klikit- ff-0.1-3a.iso. Target 66.6% complete.

    downloading from http://-Substitute-the-hosting-domain-/klikit/klikit-ff-0.1-5b.iso:

    #############------- 66.6% 4.7 kBps

    ##############------ 72.0% 214.2 kBps         A

     

    downloading from http://-Substitute-the-hosting-domain-/klikit/klikit-ff-0.1-5b.iso:

    ###############----- 76.1% 212.9 kBps         A

     

    downloading from http://-Substitute-the-hosting-domain-/klikit/klikit-ff-0.1-5b.iso:

    ################---- 84.4% 214.3 kBps

     

    downloading from http://-Substitute-the-hosting-domain-/klikit/klikit/klikit-ff-0.1-5b.iso:

    ###################- 95.5% 215.8 kBps

     

    downloading from http://-Substitute-the-hosting-domain-/klikit/klikit-ff-0.1-5b.iso:

    ###################- 97.6% 206.5 kBps

     

    downloading from http://-Substitute-the-hosting-domain-/klikit/klikit-ff-0.1-5b.iso:

    #################### 100.0% 199.9 kBps DONE

     

    verifying download...checksum matches OK

    used 554741760 local, fetched 278284520

    Note : This saved downloading 554741760 bytes (529 MB) of unchanged files, meaning that only 278284520 bytes (265 MB) were required, not (794 M) . This could have been greater savings if I had been updating from the previous version and not the one previous again.

     

    From the author of zsync : --

     

     

    Advantages of zsync

    zsync fills a gap in the technology available for large-scale file distribution. Three key points explain why zsync provides a genuinely new technique for file distribution:

  6. Client-side rsync — zsync uses the rsync algorithm, but runs it on the client side, thus avoiding the high server load associated with rsync.
  7. Rsync over HTTP — zsync provides transfers that are nearly as efficient as rsync -z or cvsup, without the need to run a special server application. All that is needed is an HTTP/1.1-compliant web server. So it works through firewalls and on shared hosting accounts, and gives less security worries.
  8. Handling for compressed files — rsync is ineffective on compressed files, unless they are compressed with a patched version of gzip. zsync has special handling for gzipped files, which enables update transfers of files which are distributed in compressed form.

The special handling of compressed files is, as far as I know, entirely new and unique to zsync. The combination of client-side rsync and HTTP is also unique to zsync, to the best of my knowledge.

 

 


 

One point not mentioned in the discussion above is the URL from which the 'missing' bits of the ISO are downloaded.

 

Depending on how the .zsync file is prepared, this may be included in this file. Alternatively, it may be relative to where the .zsync file is hosted.

In any case, if zsync does not find the 'target' ISO, then you can tell it where to find it using the -u option followd by the url, like this,  for the latest version of Klikit-Linux 0.1-7B.

 

-u http://silverstrandsolutions.com/klikit/klikit-ff-0.1-7B.iso

 

Another point, is that the .zsync file need not be held locally i.e. downloaded first, since zsync will do this when started if told where to find this file with a URL.

http://www.klikit.org/klikit-ISOs/klikit-ff-0.1-7B.iso.zsync

 

So the full command-line would become : --

 

 

/usr/local/bin/zsync  -i /mnt/hdb6/Klikit_Linux/ISO_File/klikit-ff-0.1-3a.iso http://www.klikit.org/klikit-ISOs/klikit-ff-0.1-7B.iso.zsync

 

-u http://silverstrandsolutions.com/klikit/klikit-ff-0.1-7B.iso   [all on one line]

 

 

If you want to keep track of how long this process takes, you can put 'time ' at the start, like

 

 

time /usr/local/bin/zsync etc...

 

 

 

 

A final point to note, is that you do not have to have the exactly preceeding ISO for this to work. You can skip a release or two quite easily with little effect. In fact, for a release of Klikit, which is based on KUbuntu, you could use as your seed file either a recent release of Ubuntu or KUbuntu and zsync would reuse any parts that are in common with the latest release of Klikit-Linux.

 

Comments (0)

You don't have permission to comment on this page.