Parchive (a portmanteau of parity archive, and formally known as Parity Volume Set Specification) is an erasure code system that produces par files for checksum verification of data integrity, with the capability to perform data recovery operations that can repair or regenerate corrupted or missing data.
Parchive was originally written to solve the problem of reliable file sharing on Usenet, but it is now commonly used for protecting any kind of data from data corruption, disc rot, bit rot, and accidental or malicious damage. Despite the name, Parchive uses more advanced techniques that do not use simplistic parity methods of error detection and correction.
As of 2014, PAR1 is obsolete, PAR2 is mature for widespread use, and PAR3 is an experimental version being developed by MultiPar author Yutaka Sawada. The original SourceForge Parchive project has been inactive since November 9, 2010.
Video Parchive
History
Parchive was intended to increase the reliability of transferring files via Usenet newsgroups. Usenet was originally designed for informal conversations, and the underlying protocol, NNTP was not designed to transmit arbitrary binary data. Another limitation, which was acceptable for conversations but not for files, was that messages were normally fairly short in length and limited to 7-bit ASCII text.
Various techniques were devised to send files over Usenet, such as uuencoding and Base64. Later Usenet software allowed 8 bit Extended ASCII, which permitted new techniques like yEnc. Large files were broken up to reduce the effect of a corrupted download, but the unreliable nature of Usenet remained.
With the introduction of Parchive, parity files could be created that were then uploaded along with the original data files. If any of the data files were damaged or lost while being propagated between Usenet servers, users could download parity files and use them to reconstruct the damaged or missing files. Parchive included the construction of small index files (*.par in version 1 and *.par2 in version 2) that do not contain any recovery data. These indexes contain file hashes that can be used to quickly identify the target files and verify their integrity.
Because the index files were so small, they minimized the amount of extra data that had to be downloaded from Usenet to verify that the data files were all present and undamaged, or to determine how many parity volumes were required to repair any damage or reconstruct any missing files. They were most useful in version 1 where the parity volumes were much larger than the short index files. These larger parity volumes contain the actual recovery data along with a duplicate copy of the information in the index files (which allows them to be used on their own to verify the integrity of the data files if there is no small index file available).
In July 2001, Tobias Rieper and Stefan Wehlus proposed the Parity Volume Set specification, and with the assistance of other project members, version 1.0 of the specification was published in October 2001. Par1 used Reed-Solomon error correction to create new recovery files. Any of the recovery files can be used to rebuild a missing file from an incomplete download.
Version 1 became widely used on Usenet, but it did suffer some limitations:
- It was restricted to handle at most 255 files.
- The recovery files had to be the size of the largest input file, so it did not work well when the input files were of various sizes. (This limited its usefulness when not paired with the proprietary RAR compression tool.)
- The recovery algorithm had a bug, due to a flaw in the academic paper on which it was based.
- It was strongly tied to Usenet and it was felt that a more general tool might have a wider audience.
In January 2002, Howard Fukada proposed that a new Par2 specification should be devised with the significant changes that data verification and repair should work on blocks of data rather than whole files, and that the algorithm should switch to using 16 bit numbers rather than the 8 bit numbers that PAR 1 used. Michael Nahas and Peter Clements took up these ideas in July 2002, with additional input from Paul Nettle and Ryan Gallagher (who both wrote Par1 clients). Version 2.0 of the Parchive specification was published by Michael Nahas in September 2002.
Peter Clements then went on to write the first two Par2 implementations, QuickPar and par2cmdline. Abandoned since 2004, Paul Houle created phpar2 to supersede par2cmdline. Yutaka Sawada created MultiPar to supersede QuickPar. Multipar uses par2j.exe (which is partially based on par2cmdline's optimization techniques) to use as MultiPar's backend engine.
Maps Parchive
Versions
Versions 1 and 2 of the file format are incompatible. (However, many clients support both.)
Parity Volume Set Specification 1.0
For Par1, the files f1, f2, ..., fn, the Parchive consists of an index file (f.par), which is CRC type file with no recovery blocks, and a number of "parity volumes" (f.p01, f.p02, etc.). Given all of the original files except for one (for example, f2), it is possible to create the missing f2 given all of the other original files and any one of the parity volumes. Alternatively, it is possible to recreate two missing files from any two of the parity volumes and so forth.
Par1 supports up to a total of 256 source and recovery files.
Parity Volume Set Specification 2.0
Par2 files generally use this naming/extension system: filename.vol000+01.PAR2, filename.vol001+02.PAR2, filename.vol003+04.PAR2, filename.vol007+06.PAR2, etc. The +01, +02, etc. in the filename indicates how many blocks it contains, and the vol000, vol001, vol003 etc. indicates the number of the first recovery block within the PAR2 file. If an index file of a download states that 4 blocks are missing, the easiest way to repair the files would be by downloading filename.vol003+04.PAR2. However, due to the redundancy, filename.vol007+06.PAR2 is also acceptable. There is also an index file filename.PAR2, it is identical in function to the small index file used in PAR1.
Par2 specification supports up to 32768 source blocks and up to 65535 recovery blocks. Input files are split into multiple equal-sized blocks so that recovery files do not need to be the size of the largest input file.
Although Unicode is mentioned in the PAR2 specification as an option, most PAR2 implementations do not support Unicode.
Directory support is included in the PAR2 specification, but most or all implementations do not support it.
Parity Volume Set Specification 3.0
The Par3 specification was originally planned to be published as an enhancement over the Par2 specification. However, till date, it has remained closed source by specification owner Yutaka Sawada.
Software
Multi-Platform
- par2+tbb (GPLv2) -- a concurrent (multithreaded) version of par2cmdline 0.4 using TBB. Only compatible with x86 based CPUs. It is available in the FreeBSD Ports system as par2cmdline-tbb.
- Rarslave (GPLv2)
- Original par2cmdline -- (obsolete). Available in the FreeBSD Ports system as par2cmdline.
- par2cmdline maintained fork by BlackIkeEagle.
- par2cmdline-mt is another multithreaded version of par2cmdline using OpenMP, GPLv2, or later. Currently merged into BlackIkeEagle's fork and maintained there.
- ParPar (CC0) is a high performance, multithreaded PAR2 client and Node.js library. Does not support verifying or repair, it can currently only create PAR2 archives.
Windows
- MultiPar (freeware) -- Builds upon QuickPar's features and GUI, and Yutaka Sawada's par2j.exe as the PAR2 backend. MultiPar supports multiple languages by Unicode. The name of MultiPar was derived from "multi-lingual PAR client". MultiPar is able to add recovery data to ZIP and 7-Zip files, with a few minor caveats. MultiPar is also verified to work with Wine under TrueOS, and may work with other operating systems too. Although the Par2 components are (or will be) open source, the MultiPar GUI on top of them is currently not open source.
- QuickPar (freeware) -- unmaintained since 2004, superseded by MultiPar.
- Par-N-Rar (GPL)
- phpar2 -- advanced par2cmdline with multithreading and highly optimized assemblercode (about 66% faster than QuickPar 0.9.1)
- SmartPAR (freeware) -- Unmaintained since 2002 and obsolete as this application written for Microsoft Windows only works with the original Par1 (PAR) Parchive format parity files. Superseded by QuickPar. It uses Reed-Solomon error correction to create new recovery files. SmartPAR is able to correct errors and recover missing parts of distributed files from PAR files. Last stable release 0.13d1 dated January 22, 2002 (2002-01-22)
- Mirror -- First PAR implementation, unmaintained since 2001.
Mac OS X
- MacPAR deLuxe 4.2
- UnRarX
POSIX
Software for POSIX conforming operating systems:
- Par2 for KDE 4
- PyPar2 1.4, a frontend for par2.
- GPar2 2.03
See also
- Bit rot
- Disc rot
- Data corruption
- Checksum
- Comparison of file archivers - Some file archivers are capable of integrating parity data into their formats for error detection and correction:
- RAID - RAID levels at and above RAID 5 make use of parity data to detect and repair errors.
References
External links
- Parchive project - full specifications and math behind it
- Introduction to PAR and PAR2
- Slyck's Guide To The Usenet Newsgroups: PAR & PAR2 Files
- Guide to repair files using PAR2
- par2+tbb
- Par-N-Rar
- Rarslave
- UsenetReviewz's guide to opening par files
Source of article : Wikipedia