cmd:par2 

Basic Info 

cmd:par2create Usage 

par2 create -r10 test.mpg par2 create -r10 stws1-vertigo.par2 stws1-vertigo.*

-u     Uniform recovery file sizes

Info 

par2cmdline is a PAR 2.0 compatible file verification and repair tool.

Description 

par2cmdline is a program for creating and using PAR2 files to detect damage in data files and repair them if necessary. It can be used with any kind of file.

Features 

WHY IS PAR 2.0 better than PAR 1.0?

Dissadvantages? 

Yes, there is one dissadvantage:

This dissadvantage is considerably mitigated by the fact that you don't need to create as much recovery data in the first place to provide the same level of protection against loss and damage.

Source 

http://parchive.sourceforge.net

Related Urls 

Help 

Quick Help 

par2 c(reate) [options] <par2 file> [files]
par2 v(erify) [options] <par2 file> [files]
par2 r(epair) [options] <par2 file> [files]

Also:

par2create [options] <par2 file> [files]
par2verify [options] <par2 file> [files]
par2repair [options] <par2 file> [files]

Options:

-b<n>  : Set the Block-Count
-s<n>  : Set the Block-Size
-r<n>  : Level of Redundancy (%)
-m<n>  : Memory (in MB) to use
--     : Treat all remaining CommandLine as filenames

Detail Help 

With PAR 2.0 you can create PAR2 recovery files for as few as 1 or as many as 32768 files.

Creating par2 files 

To create PAR 2 recovery files for a single data file (e.g. one called test.mpg), you can use the following command:

par2 create test.mpg

If test.mpg is an 800 MB file, then this will create a total of 8 PAR2 files with the following filenames (taking roughly 6 minutes on a PC with a 1500MHz CPU):

test.mpg.par2          - This is an index file for verification only
test.mpg.vol00+01.par2 - Recovery file with 1 recovery block
test.mpg.vol01+02.par2 - Recovery file with 2 recovery blocks
test.mpg.vol03+04.par2 - Recovery file with 4 recovery blocks
test.mpg.vol07+08.par2 - Recovery file with 8 recovery blocks
test.mpg.vol15+16.par2 - Recovery file with 16 recovery blocks
test.mpg.vol31+32.par2 - Recovery file with 32 recovery blocks
test.mpg.vol63+37.par2 - Recovery file with 37 recovery blocks

The test.mpg.par2 file is 39 KB in size and the other files vary in size from 443 KB to 15 MB.

These par2 files will enable the recovery of up to 100 errors totalling 40 MB of lost or damaged data from the original test.mpg file when it and the par2 files are posted on UseNet.

The total quantity of recovery data created was 40 MB (which is 5% of 800 MB). If you wish to create a greater or lesser quantity of recovery data, you can use the "-r" option.

To create 10% recovery data instead of the default of 5% and also to use a block size of 300 KB (recommended to be the same as the posting article size), you would use the following command:

par2 create -s307200 -r10 test.mpg
Creating par2 files for multiple data files 

When creating PAR2 recovery files form multiple data files, you must specify the base filename to use for the par2 files and the names of all of the data files.

If test.mpg had been split into multiple RAR files, then you could use:

par2 create test.mpg.rar.par2 test.mpg.part*.rar

The files filename "test.mpg.rar.par2" says what you want the par2 files to be called and "test.mpg.part*.rar" should select all of the RAR files.

verifying 
par2 verify test.mpg.par2

This tells par2cmdline to use the information in test.mpg.par2 to verify the data files.

par2cmdline will automatically search for the other par2 files that were created and use the information they contain to determine the filenames of the original data files and then to verify them.

If all of the data files are ok, then par2cmdline will report that repair will not be required.

If any of the data files are missing or damaged, par2cmdline will report the details of what it has found. If the recovery files contain enough recovery blocks to repair the damage, you will be told that repair is possible. Otherwise you will be told exactly how many recovery blocks will be required in order to repair.

Repairing 

To carry out a repair use the following command:

par2 repair test.mpg.par2

This tells par2cmdline to verify and if possible repair any damaged or missing files. If a repair is carried out, then each file which is repaired will be re-verified to confirm that the repair was successful.

If par2cmdline determines that any of the data files are damaged or missing and finds that there is insufficient recovery data to effect a repair, you will be told that you need a certain number of recovery blocks. You can obtain these by downloading additional recovery files.

In order to make things easy, par2 files have filenames that tell you exactly how many recovery blocks each one contains.

For the following recovery files,

test.mpg.par2
test.mpg.vol00+01.par2
test.mpg.vol01+02.par2
test.mpg.vol03+04.par2
test.mpg.vol07+08.par2
test.mpg.vol15+16.par2
test.mpg.vol31+19.par2

The first file in this list does not contain any recovery data, it only contains information sufficient to verify the data files.

Each of the other files contains a different number of recovery blocks. The number after the "`" sign is the number of recovery blocks; the number preceding the "`" sign is the block number of the first recovery block in that file.

If par2cmdline told you that you needed 10 recovery blocks, then you would need "test.mpg.vol01+02.par2" and "test.mpg.vol07+08.par". You might of course choose to fetch "test.mpg.vol15+16.par2" instead (in which case you would have an extra 6 recovery blocks which would not be used for the repair).

Version 0.3 

This version of par2cmdline does not support recording path information for files. Whilst you can create recovery files for files from multiple locations, it will expect all files to be in the current directory when verifying and repairing. This limitation will be corrected in an update.

Build & Installation 

./configure
make
make check
strip par2
make install

No details available for recoverable file number 1 

Synopsis 

Would the par2 files worthwile to keep when there is

"No details available for recoverable file number 1."

error?

Conclusion 

No, if there is such error, par2 can't even rename files.

Symptom 

Everything seems fine except the error message:

Verifying source files:
No details available for recoverable file number 1.

Analysis 

par2 and data files are AOK 

$ nice -n 16 par2verify Recovery\ Set.par2
par2cmdline version 0.4, Copyright (C) 2003 Peter Brian Clements.

Loading "Recovery Set.par2".
Loaded 21 new packets
Loading "Recovery Set.vol031+32.par2".
Loaded 32 new packets including 32 recovery blocks
Loading "Recovery Set.vol007+8.par2".
Loaded 8 new packets including 8 recovery blocks
Loading "Recovery Set.vol063+64.par2".
Loaded 64 new packets including 64 recovery blocks
Loading "Recovery Set.vol127+65.par2".
Loaded 65 new packets including 65 recovery blocks
Loading "Recovery Set.vol001+2.par2".
Loaded 2 new packets including 2 recovery blocks
Loading "Recovery Set.vol015+16.par2".
Loaded 16 new packets including 16 recovery blocks
Loading "Recovery Set.vol003+4.par2".
Loaded 4 new packets including 4 recovery blocks
Loading "Recovery Set.vol000+1.par2".
Loaded 1 new packets including 1 recovery blocks

There are 10 recoverable files and 0 other files.
The block size used was 350000 bytes.
There are a total of 1912 data blocks.
The total size of the data files is 667400630 bytes.

Verifying source files:

No details available for recoverable file number 1.
Recovery will not be possible.
 Target: "CD 1.mp3" - found.
 Target: "CD 2.mp3" - found.
 Target: "CD 3.mp3" - found.
 Target: "CD 4.mp3" - found.
 Target: "CD 5.mp3" - found.
 Target: "CD 6.mp3" - found.
 Target: "CD 7.mp3" - found.
 Target: "CD 8.mp3" - found.
 Target: "CD 9.mp3" - found.

rename data files 

Rename "CD ?.mp3" to "Renamed CD ?.mp3".

mv "CD 1.mp3" "Renamed CD 1.mp3"
mv "CD 2.mp3" "Renamed CD 2.mp3"
mv "CD 3.mp3" "Renamed CD 3.mp3"
mv "CD 4.mp3" "Renamed CD 4.mp3"
mv "CD 5.mp3" "Renamed CD 5.mp3"
mv "CD 6.mp3" "Renamed CD 6.mp3"
mv "CD 7.mp3" "Renamed CD 7.mp3"
mv "CD 8.mp3" "Renamed CD 8.mp3"
mv "CD 9.mp3" "Renamed CD 9.mp3"

check again 

$ nice -n 16 par2verify Recovery\ Set.par2 Renamed\ CD\ *
There are 10 recoverable files and 0 other files.
The block size used was 350000 bytes.
There are a total of 1912 data blocks.
The total size of the data files is 667400630 bytes.

Verifying source files:

No details available for recoverable file number 1.
Recovery will not be possible.
 Target: "CD 1.mp3" - missing.
 Target: "CD 2.mp3" - missing.
 Target: "CD 3.mp3" - missing.
 Target: "CD 4.mp3" - missing.
 Target: "CD 5.mp3" - missing.
 Target: "CD 6.mp3" - missing.
 Target: "CD 7.mp3" - missing.
 Target: "CD 8.mp3" - missing.
 Target: "CD 9.mp3" - missing.

Because "recovery will not be possible", par2verify doesn't even bother to check the rest of command line files.

Working History 

cmd:par 

Usage 

  par c(heck)   [options] <par file>         : Check parity archive
  par r(ecover) [options] <par file>         : Restore missing volumes
  par a(dd)     [options] <par file> [files] : Add files to parity archive
Advanced:
  par m(ix)    [options] : Try to restore from all parity files at once

Info 

Par uses Reed-Solomon coding to make multiple parity volumes from the same set of files.

What this means is that you can recover as many files as you have recovery volumes. Any recovery volumes for that set will do.

Typical example of use 

create 

You are uploading a rar-archive, Archive.rar to a newsgroup, split into 40 files. You decide to make a parity archive with five recovery volumes:

  1. >par add -n5 Archive.PAR Archive.r

    You machine rattles for a minute or two, resulting in one (small) Archive.PAR file, and five files Archive.P01 - P05. You upload these.

check 

People download your files, and the Archive.PAR file to check if they downloaded correctly. Someone runs par to check if he got all files:

>par check Archive.PAR
recover 

It reports that three files are missing, and he would need three parity volumes to recover them. He tries to download these, and he gets Archive.P02, .P04 and .P05. Then he runs par to recover those files:

>par recover Archive.PAR
His machine rattles for a minute or two, and all his files are restored.

Work on corrupted files 

$ par recover -m eBooks_collection.part139.par
Checking eBooks_collection.part139.par
 eBooks_collection.part001.rar            - OK
 eBooks_collection.part002.rar            - OK
 eBooks_collection.part003.rar            - OK
 ...
  eBooks_collection.part108.rar            - OK
 ERROR: eBooks_collection.part109.rar: Failed md5 sum
 eBooks_collection.part109.rar            - CORRUPT
 eBooks_collection.part110.rar            - OK
 ERROR: eBooks_collection.part111.rar: Failed md5 sum
 eBooks_collection.part111.rar            - CORRUPT
 eBooks_collection.part112.rar            - OK
 ...
Restoring:
    Rename: eBooks_collection.part109.rar -> eBooks_collection.part109.rar.bad
 Rename: eBooks_collection.part111.rar -> eBooks_collection.part111.rar.bad
 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
 eBooks_collection.part109.rar            - RECOVERED
 eBooks_collection.part111.rar            - RECOVERED