Parchive (file format)
From Wikipedia, the free encyclopedia
PArchive | |
---|---|
File name extension | .par, .par2, .p?? |
Type of format | forward error correction |
Parchive (or parity volume set archive) is a Sourceforge Project that was created in 2001 to design and implement an idea by Tobias Rieper and Stefan Wehlus for a Parity File format. These parity files use a forward error correction-style system that can be used to perform data verification, and allow recovery when data is lost or corrupted.
The project is currently administered by Ryan Gallagher (binerman), Roger Harrison (kbalore), Willem Monsuwe (monsuwe), and Stefan Wehlus (wehlus)
Contents |
[edit] Overview
Parchive was written to solve the problem of reliably sending large files on Usenet.
Usenet newsgroups were originally designed for informal conversations and the underlying protocol, NNTP was not designed to be a reliable transmission medium. 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 sent by breaking them into smaller files 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 whilst 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.
The 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).
[edit] History
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. An end user could use any of the recovery files to rebuild a missing file from an incomplete download.
Version 1 became widely used on Usenet, but it did suffer some limitations:
- First, it was restricted to recovering at most 256 missing files.
- Second, 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.)
- Third, the recovery algorithm had a bug, due to a flaw in the academic paper it was based on.
- Lastly, Par1 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 these ideas up in July 2002, and with additional input and ideas from Paul Nettle and Ryan Gallagher (who both wrote Par1 clients), Verion 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.
[edit] Versions
Versions 1 and 2 of the file format are incompatible. (Although many clients support both.)
[edit] Version 1
For version 1, given files f1, f2, ..., fn, the Parchive consists of an index file (f.par) 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.
Version 1 supports up to 256 recovery files. Each recovery file must be the size of the largest input file.
[edit] Version 2
Version 2 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.
Version 2 supports up to 32768 (2^15) recovery blocks. Input files are "sliced" into multiple equal-sized blocks so that recovery files do not need to be the size of the largest input file.
[edit] Limitations
- Neither Parchive versions support storing the metadata on files (e.g. owner, file permissions, etc.). If that information is necessary, a tool such as "tar" or "zip" should be run before using Par.
[edit] Other uses
This article or section may contain original research or unverified claims. Please improve the article by adding references. See the talk page for details. (September 2007) |
Parchive files can be used for other purposes than Usenet transmission.
- The DAR backup program baras uses PAR or PAR2 to ensure robust backups.
- When using inexpensive CD-R media, a user can insert additional redundancy by burning Parchives with the data.
- Some Parchive software will split a single source file into multiple smaller files to get around limitations imposed such as FAT-32 file size limitations. Even with 0% redundancy, the software can still reassemble the smaller parts into the original file.
- You can be certain that your files have not been corrupted by viruses or bad sectors on your hard disk; e.g., you could create PAR files for directories which contain your family photo albums.
[edit] Software
Note: a comprehensive list of archive software is available.
- Windows: QuickPar, parchive, SmartPAR
- Windows XP 32-bit:, ShellQueues Multithreaded for core2duo/quad
- Mac OS X: MacPAR deLuxe
- Linux: parchive, PyPar2
[edit] Other uses of the file extension
A PAR file could also be a deployable SAS Portlet file for the SAS Information Delivery Portal. The nomenclature follows from JAR, WAR, and EAR files. These files are just ZIPped files.
[edit] See also
[edit] External links
- Parchive project - full specifications and math behind it
- Slyck's Guide to The Newsgroups - PAR files
- Linux Binaries Tutorial - Advanced use of Par2 files
- QuickPar: Windows PAR2 CRC Creation & Repair Tool
- MacPAR deLuxe home page
- PAR2Lib: PAR2 Verification and Repair Library for Win32
- What is ICE ECC?
- Overview of the DVD Disaster project
- PAR & PAR2 Files Explained in Plain English