Closed sanderjo closed 4 years ago
Ah, https://github.com/animetosho/ParPar/issues/18#issuecomment-536574313 gave the answer: -d pow2
(power of 2). So:
$ parpar -d pow2 -s 1M -r 64 -o my_recovery.par2 *rar
Multiply method used: XOR JIT (128 bit), 4 threads
Generating 64 MiB recovery data (64 slices) from 500 MiB of data
Calculating: 100.00%
PAR2 created. Time taken: 4.738 second(s)
$ ll *par2
-rw-rw-r-- 1 sander sander 15420 jan 13 22:45 my_recovery.par2
-rw-rw-r-- 1 sander sander 1064064 jan 13 22:45 my_recovery.vol00+01.par2
-rw-rw-r-- 1 sander sander 2112708 jan 13 22:45 my_recovery.vol01+02.par2
-rw-rw-r-- 1 sander sander 4225300 jan 13 22:45 my_recovery.vol03+04.par2
-rw-rw-r-- 1 sander sander 8435180 jan 13 22:45 my_recovery.vol07+08.par2
-rw-rw-r-- 1 sander sander 16839636 jan 13 22:45 my_recovery.vol15+16.par2
-rw-rw-r-- 1 sander sander 33633244 jan 13 22:45 my_recovery.vol31+32.par2
-rw-rw-r-- 1 sander sander 1064064 jan 13 22:45 my_recovery.vol63+01.par2
I still don't understand the -s 1M -r 64
, but based on a few tries my rule of thumb / guesstimate is "smallest par2 with size 1MB, and go up to 64MB max". And with the -d pow2
parpar will create par2's in between, each time doubling in size
For ParPar v0.3.0, the closest you could get is probably:
parpar -s2000 --min-input-slices=1 -r10% -d pow2 -o somerandombin-500MB *rar
This creates 8 volumes instead of 7, so slightly different.
For ParPar v0.3.1 (current Git), you can use:
parpar -s2000 --min-input-slices=1 -r10% --slices-first-file 2 -o somerandombin-500MB *rar
This puts the volume count at 7, so should match par2cmdline.
Explanation of differences:
--min-input-slices=1
tells it to automatically find a lower count if the requested count can't be matched-d pow2
isn't required in 0.3.1-n
parameter. For power-of-2 distribution, it just seems to double the first file's block count until it gets the number of requested files, and in your particular example, will always be 2. ParPar 0.3.1 has the --slices-first-file
option to set this. Note that this calculation may not hold if you change the recovery percentageI still don't understand the -s 1M -r 64, but based on a few tries my rule of thumb / guesstimate is "smallest par2 with size 1MB, and go up to 64MB max".
PAR2 works off the notion of blocks or slices. Essentially, your input is divvied up into these pieces when it is processed. The -s
parameter (in both ParPar and par2cmdline) is used to specify the size of each block/slice. -s 1M
in ParPar is equivalent to -s1048576
in par2cmdline (-s1048576
also works in ParPar) and just means that the input data is interpreted as a series of 1MB blocks.
-r 64
in ParPar is equivalent to -c64
in par2cmdline - it says how many recovery blocks to generate. 64*1MB will, hence, generate a total of 64MB of recovery data. This total is distributed among all volumes, so a "64MB max" is technically correct, but probably not an intuitive way to think about it.
I would like to switch from par2 to parpar, but I don't know how to: which CLI command to use (so related to https://github.com/animetosho/ParPar/issues/2)
I always use
par2 create -r10 -n7 mypar2files *rar
with the output at the bottom of this post.I tried a few parpar command, but can't generate the same result.
and
Tips appreciated