March 28, 2024, 03:44:09 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to my personal forum. The site is still undergoing some maintenance. I'm sorry for the inconvenience.
 
  Home Help Login Register  

Creating and using 'PAR2 recovery files' to repair corrupt data

Shoutbox
June 08, 2021, 01:46:19 am velkoon: jk I found it hehe http://www.pspthemecentral.com/PSP/download/PSP-Game-themes/Metal_Gear_Solid_3.8.aspx
June 08, 2021, 01:11:30 am velkoon: Hi, a user was looking for a Metal Gear Portable Ops theme here: https://www.reddit.com/r/PSP/comments/nug9h3/guys_where_can_i_find_this_theme_though_i/ It seems you may have had it in this collection: http://downloadpspgames.smfforfree4.com/index.php/topic,11.msg114.html . It would be SO awesome if you could share it if you still have the ptf file! Thank you! Smiley
October 12, 2017, 03:29:52 pm jcpantola: I'm glad my website is still active. It's been a long time since my last visit. my filetrip account had been closed and i lost all of my uploads. i'm sorry for the inconvenience. i will update all the details here soon. Thank you and God Bless.
February 28, 2015, 01:47:13 am jcpantola: Kamen Rider Black http://downloadpspgames.smfforfree4.com/index.php/topic,1354.msg2296.html#msg2296
February 18, 2015, 10:51:46 am jcpantola: Kamen Rider Black RX http://www.orendsrange.com/2014/07/kamen-rider-black-rx-now-fully-subbed.html
August 12, 2014, 11:58:12 pm jcpantola: 6.20/6.35/6.39 PROMOD C1 Fix3 and 6.60 PROMOD C1 Fix4 http://downloadpspgames.smfforfree4.com/index.php/topic,1709.msg2773.html#msg2773
View Shout History
Members Online
3 Guests, 0 Users
Pages: [1]   Go Down
  Print  
Author Topic: Creating and using 'PAR2 recovery files' to repair corrupt data  (Read 1311 times)
0 Members and 1 Guest are viewing this topic.
jcpantola
Site Owner
Administrator
Hero Member
*

Reputation: +61/-0
Offline Offline

Gender: Male
Posts: 3044


PS3 4.65


View Profile WWW
« on: December 26, 2009, 09:07:38 pm »

Creating and using 'PAR2 recovery files' to repair corrupt data

Creating and using 'PAR2 recovery files' for your files
source: http://www.pspiso.com/showthread.php?t=461023

credit goes to Android

Ever downloaded a big RAR file and then find out that one or more parts got corrupted during the download?
Usually you would have to re-download the parts again, which can take some time on slower connection...
(and can also waste your 'download limit' if you have a connection with a download limit like I do...)

If the uploader has included some 'PAR2 recovery files' in a seperate download link, then you can fix the
corruption in the RAR file which will save you from having to re-download the entire file / part again.

This guide has been written for both uploaders and downloaders.
for Downloaders it will show you how to use the 'PAR2 recovery files' to repair your corrupted download.
for Uploaders it will show you how to make and include a 'PAR2 recovery set' for the files you upload.

Hopefully more people will start using the PAR2 standard and will save a LOT of bandwidth from re-downloading a corrupt file.
It does take a few minutes extra for the uploader to make and upload the repair files, but I think its worth it...


Software Programs that can use PAR2 files

You can download these programs by searching google for the program name.
They are all open source and are freely available for download.


For Windows Operating Systems:
QuickPAR for Windows - Can make and repair files using PAR2 files.
'QuickPar-0.9.1.0' (489kb EXE): http://www.mediafire.com/?nydyqgtyyqn

For Macintosh Operating Systems:
MacPAR deLuxe - Can make and repair files using PAR2 files and apparently extract RAR files too.
For Mac OS X 10.4 or 10.5 (1.6mb DMG): http://www.mediafire.com/?zuewmmz2xdj
For Mac OS X 10.3.9 (1.4mb DMG): http://www.mediafire.com/?mjzyjjtzyzi

The DMG files above was downloaded on a windows computer and re-uploaded, I'm not sure if it will still work on a MAC.

Note: For MAC users who have UnrarX installed, the program seems to have a built-in PAR2 repair program:
extract the PAR2 files into the same folder as the RAR files and open the first RAR file with UnrarX.
Drag one of the PAR2 files from the repair files onto the UnrarX window and UnrarX should repair the file.


For Linux Operating Systems:
Ubuntu:

To install PAR2 on Ubuntu, open a console window and type:

Code:
sudo apt-get install par2To start a PAR2 repair, open a console and type in:

Code:
par2 r filename.par2
--OR--
par2repair filename.par2Quickpar should work fine with the latest version of 'WINE' if you don't want to or know how to use a command line program.
For other Linux Distros, it should be similar to the above, try searching your linux package manger for 'PAR2' or 'Parity archive'


Note: The PAR2 creation and repair guides have been written using 'QuickPAR' but it should be very similar in other programs too.



Repairing Corrupted Files with PAR2

If you get an error when extracting your RAR files and there are PAR2 repair files available for download,
you can use them to fix the corruption, If there are no 'PAR2 files' included, then you will not be able to repair the files
maybe you can ask the uploader if they still have the original RAR files they uploaded to make and upload 'PAR2 files'.

The error will usually look something like this picture below and will contain the words "Volume is corrupt" or something similar:




The repair process is pretty simple:

1) Make a new folder somewhere on your computer, the folder can be named anything you like...
2) Put ALL the rars files (even if they are not corrupted) into that folder. (You need all the RAR files in the 'par2 set' to start a repair)
3) Place the 'PAR2 files' into the same folder with the RAR files. if they are in a RAR file you will need to extract them

The uploader may have a few sets of repair RAR files, just download the first one that contains the 'index' file and a few repair blocks.
Later on, if you find that you need more blocks to repair your files, then you can download and use the additional repair files.

If the repair RAR file is corrupted, it doesn't really matter, as long as you have at least 2 or more PAR2 files you will still be able to repair.
(Except that you will be missing a few of the recovery blocks, but you might not need all of the blocks to repair the files)

This is what the folder should look like after you have placed the RAR and PAR2 files into the same folder:



4) Open your PAR2 repair program (e.g Quickpar / Macpar Deluxe etc)

5) Click the 'open' button and open the small index PAR2 file. (the index file is usually named something like 'filename.par2')
(On windows, you can choose to associate the 'PAR2' extension with Quickpar using 'open with', so double clicking 'PAR2' files will open them directly)

6) Let the program scan the files for errors, this can take a few seconds. Once its done you should see the status of each file.
Green files are perfect, Orange files are damaged and Red files are missing.

If some or all of your RAR files are marked 'red' then make sure that
- All the RAR files and PAR2 files are in the same folder
- The RAR files are named correctly (e.g "filename_part_2.rar" will not match "filename.part.2.rar"
- The PAR2 files are the ones that were made for the RAR files you downloaded.

Here is a screenshot of my results, as you can see part 2 is not complete but since I have 136 repair blocks I can repair the file using the PAR2 files.
Click here for the Screenshot: http://img189.imageshack.us/img189/3074/par2damage.jpg

If you don't have enough blocks to repair, its likely that one of your files didn't fully finish downloading...
You can usually tell which part it is as it will have a low number of available blocks. (e.g 52/272 blocks available)
These incomplete files will need to be re-downloaded as there is too much missing or damaged data in the file.

Some uploaders may include an extra repair file with more repair blocks,
If you are missing less the amount of blocks in that file, download it and extract it
into the folder with the other PAR2 files, then close and reopen the index PAR2 file.
e.g If you are missing 30 blocks, but the uploader has an additional RAR file with 32 more blocks
you can download it, extract it to the same folder as the other PAR2 files and reopen the index PAR2 file.

7) If you can repair the file, click the 'Repair' button and wait for it to finish.
the program should then recheck the file and if the repair was a success
you should see a message like "Repair Succeeded in ## seconds @ ### MB/s"

Note: on windows you may find the corrupted files in the recycle bin or in the folder with the original file but renamed.
The corrupted files will usually be renamed to have a file extension of ".1", the corrupted files can be safely deleted after repair.

Cool Click on 'Exit' to close the PAR2 program.

9) you can extract the RAR files and there should be no file corruption errors.
(If you still get errors then the PAR2 files were probably made from 'damaged' RAR files)




Making PAR2 repair files


A PAR2 file is made from a 'set' of files on your computer, the downloader needs ALL the files in a set to start repair.

If you have say a 'multiple disc' game or music album, make each disc a seperate PAR2 repair set,
Some people may only want to download 'disc 2' as they it be missing or damaged, or they might have disc 1 already etc...
If their RAR gets corrupted they won't be able to repair using the PAR2 because they will be missing the files from disc 1.


1) Open your PAR2 Creation program and click the 'Options' button.
A new window opens with the settings, change the 'Preferred block Size' to 'Exact - 32,768 bytes'.
This makes each block a multiple of 32kb, which makes the PAR2 files able to repair more data errors.
Note: Some settings here will only need to be done once and they will be saved for all future creation jobs.

2) Drag and drop (or use the add button) to put the files you want in the 'set' into the "source files" window.
You can use ANY filetype it doesn't have to be RAR files, you can make a set from MP3 files, PNG files etc

A set of files is usually all the parts for your upload:
filename.part1.rar
filename.part2.rar
filename.part3.rar
filename.part4.rar

Screenshot example using drag and drop: http://img21.imageshack.us/img21/755/par2dragdrop.jpg


3) Tick the "Restrict Block Size to multiples' box so it is turned ON.
Untick the "split files' option as your source files should be split into parts already.

4) Next set the amount of repair data to include using the "Redundancy" slider.

Remeber that the bigger the set of files, the more chance it has to become corrupted.
you will want to adjust the amount of recovery data depending on the size of your files

I like to use
1% for files between 1mb to 2gb
2% for files between 2gb to 4gb
4% for files bigger then 4gb

1% is 1mb of repair data for every 100mb data in the set.
A 2gb set of files with 1% repair data will be able to repair up to 20mb of damage.

5) In the Recovery file size box, choose 'Variable - Limited to largest data file'
This will make multiple PAR2 files with a variable amount of repair data in each one.

the reason for this is, if you only have a single PAR2 repair file and the file gets corrupted during the download, the entire file is useless.
winrar will not extract files from the RAR if they are damaged, if you pack multple PAR2s file in a RAR and part of it is corrupted,
the downloader can still use the 'good' files that were sucessfully extracted from the RAR and they will still get some repair blocks.


6) Next, set the block size using the "Source Block Count" slider.

Smaller blocksize will make creation time longer and repairing quicker

Bigger blocksize will make the creation time shorter and the repairing will be longer
but you will also have less blocks and you will also have more repair data 'waste'.

example: If the Block size is 512kb, and only 12kb of the data in that block was corrupted,
the program will use 512kb of repair data to repair that block of data which will waste 500kb of repair data.
if you had used say a 64kb block size, you would only waste 52kb of repair data, which is more efficient.

I find that having between 4000 to 6000 blocks in total for the set works pretty well.
This usually gives a block size of between 32kb and 256kb which is a good size.

Here is a screenshot of my settings for a set of 5 files, totaling 500mb, you can use these settings as a reference:
Screenshot: http://img5.imageshack.us/img5/3447/par2create.jpg


7) Click the 'Create' button and wait for the program to create the PAR2 files.
This will take a few minutes, as it depends on the block size and the size of the files.

Cool Once done, pack the 'PAR2' files into a RAR file and name the RAR something like: '<filename of uploaded files>-repair.rar'
so the downloader will know that the PAR2 files are for that set of files that you have uploaded.
e.g files are named '1823.part##.rar' then your the repair files could be named '1823-repair.rar'

9) Upload the PAR2 repair RAR file as well as the normal RAR files.
(you might want to add how much repair data is included)
e.g PAR2 files with 1% repair data: <download link>



If you have a huge PAR2 set with say 20mb or more of repair data
you can choose to pack the repair data into multiple RAR files:

example: the index PAR2 and say the first 4 repair files into 'repair data 1' RAR file
and the rest of the PAR2 files into a 'repair data 2' RAR file.

This way, the downloader won't need to download ALL the PAR2 files to fix a small error.
and if they need more repair blocks, they can download the second archive.

If you want to find out how many blocks are in each archive,
just add the numbers after the plus sign in the PAR2 filenames.

e.g
Repair set 1:
filename.par2
filename.vol000+01.PAR2
filename.vol001+02.PAR2

01 + 02 = total of 03 repair blocks and the index file.

Repair set 2:
filename.vol003+04.PAR2
filename.vol007+06.PAR2

04 + 06 = total of 10 additional repair blocks.


If the downloader had more then 4 damaged blocks in their downloaded files,
they would also need to download the 2nd file repair as well as the first.

If you do split the repair file into multiple RARs, put the amount of blocks that each RAR file has.
This way the downloader will know if the file has enough blocks to repair their file.


You might also want to include a link to this guide in your topic so the downloaders will know how to
use the PAR2 files, Direct them to the "Repairing Corrupted Files with PAR2" section of this guide.

~~~


What is PAR2 and how does it work?

PAR2 stands for 'Parity ARchive Version 2'

It is an open source software that makes 'parity' files using "forward error correction' which
can be used to perform data verification and allow recovery when data is lost or corrupted.

If the 'original' RAR files were named something like:

filename.part01.rar
filename.part02.rar
filename.part03.rar

the 'Parity Archive files' would be named something like this:
(note that the file extension for these files are 'PAR2')

filename.par2
filename.vol000+01.PAR2
filename.vol001+02.PAR2
filename.vol003+04.PAR2
filename.vol007+06.PAR2
and so on...

The first file acts as an index file and contains no repair data,
it just contains the checksum of the blocks of the 'original files' in the set.
(just like a torrent contains the filenames and 'checksums' of the files in it)

All files after the first file will contain repair data. (all the files with 'VOL' in their filename)
The number before the + sign is how many blocks were in previous PAR2 files.
(e.g the forth file has 'vol007', which shows that in all the previous files, there are 7 blocks total)

The number after the + sign is how many blocks that specific PAR2 repair file contains if it was used on its own.
(if you only had the index and the very last file of the PAR2 set above, you could repair up to 6 blocks of data)
Report Spam   Logged

Share on Facebook Share on Twitter

Pages: [1]   Go Up
  Print  
 
Jump to:  

B l a c k - R a i n V.2 by C r i p
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy