11

As far as I know, WinRAR archives may contain ECC (error correction codes), so if the archive is slightly damaged, then it can be fixed by itself.

For example, I can first encode archives.tar to archives.tar.ecc, and then upload it to my server. If the file is slightly damaged after downloading by the client, then it can be fixed automatically without downloading the file again by decoding archives.tar.ecc. I think it will be a great idea if the network connection is unstable.

I wonder whether there is any (open-sourced) software run on Linux that can meet my needs.

Any suggestions?

  • to some degree, this already happens - each file's header chksum field is the sum of that header's constituent bytes - to include the size field. Many tars go further - GNU tar encodes sparse file holes in header metadata and upon extraction by any POSIX pax compatible archiver generates files containing information needed to rebuild the file, or by GNU tar to the original sparse file. It uses primarily encoded header variables definable as specified by POSIX for the pax utility w/ -o. – mikeserv Nov 30 '14 at 8:51
6

I had this same problem and found that the solutions provided in the other answer were not acceptable since the par2 program/standard involves creating separate files to do recovery and verification. I, like the original asker I think, want a single file with error correcting codes.

I found the program rsbep which used to be in the package manager and then found the necessary code here: https://www.thanassis.space/rsbep.html

This allows one to create a file with Reed-Solomon error correcting codes and then retrieve the original file from the, possibly corrupted, ECC version.

  • rsbep is great! But it's a bit different: it's an entire frozen OS, so you can add files inside but you cannot modify what is inside, and it's a bit more cumbersome to move around. But it's a really interesting approach, using FUSE, and opensource. – gaborous Dec 28 '16 at 15:08
  • @gaborous, that's not true. There is a FUSE fs implementation using rsbep transparently, but that's only on top of the scripts that work on a file-by-file basis. – nyov Mar 25 at 14:01
6

You're interested on PAR2, which uses Reed-Solomon error correction. parchive is the ECC file format specification, for Linux you will want PyPar or par2tbb, and on Windows you use a GUI called QuickPar.

  • 1
    The links for PyPar and par2tbb look broken to me. I found par2tbb here – Drist Mar 7 '17 at 19:09
  • 1
    I think PyPar is completely unrelated to error correction. – mbarkhau May 20 '18 at 18:11
2

If you want to have the ecc file separate from the archive, you can use pyFileFixity, an opensource Python project that aims to provide a next-gen PAR-like protection system against bit corruption.

If you want the ecc protection to be included directly in the archive, you can use the opensource DAR, a kind of next-gen TAR, which allows to generate both non-solid (ie, allows partial extraction of corrupted archives) and ecc (using PAR2) and catalog isolation (ie, save a backup of directory tree and filesystem meta-data) directly in the .dar archives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.