| 
  • 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
 

Recovering from a bad up-load of an ISO file

Page history last edited by Paul G. Taylor 14 years, 1 month ago

 

Using rdiff-backup to correct a corrupted upload.

 

Scenario :

 

You have created an ISO file to distribute and uploaded it to a file server. However the file has been corrupted in the process. Can you distribute the correct file without needing to upload again, and again?

 

Answer :

 

Yes! You can accomplish this with a work-around using rsync-backup.

 

Process : –

 

You have 'yourfile.iso' locally in valid form and also 'yourfile.iso', corrupted, on-line.

 

In a Konsole window, do the following steps : --

 

 

  1. Create a new directory and navigate to it.

    mkdir /tmp/temp-iso && cd /tmp/temp-iso

     

  2. Copy the correct version of the ISO file here.

    cp /path-to/yourfile.iso ./

     

  3. Create a temporary mirror directory and use it to mirror the /tmp/temp-iso directory.

    mkdir /tmp/temp-mirror

     

  4. Use rdiff-backup to back up the directory containing the correct version of the file to the temp-working directory.

    Rdiff-backup ./ /tmp/temp-mirror

    This will create a mirror of the current directory, and include a subdirectory with the meta-data, called 'rdiff-backup-data' which will also contain the incremental file, which it is safe to delete to save space and for later use.

     

  5. Copy the corrupted version of the file into the temp-iso directory, over the top of the existing correct file.

     

  6. Now repeat the rdiff-backup process. It will complain that you have deleted that incremental file, but this will not break the process.

    Rdiff-backup ./ /path-to-/temp-iso/

     

  7. You now have all the information needed in the 'rdiff-backup-data' directory to 'revert' to the 'earlier' version of 'yourfile.iso' file, which is the correct version, and assuming that you have the corrupt version already.

     

  8. Gzip the 'rdiff-backup-data' directory and distribute this along with the corrupted version of the file to end-users.

    How to Tar a Directory

     

     

  9. End-users now repeat the last steps to 'restore' the correct version from the corrupted version that they have downloaded.

     

    Just copy the corrupt version into a /tmp/temp-mirror directory, gunzip the 'rdiff-backup-data' into the same directory and run rdiff-backup in restore mode to 'restore' the corrupt file to the correct original.

 

 

Make sense?

Comments (0)

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