Tuesday, September 18, 2012

MultiPar (the spiritual successor to QuickPar)

We archive a lot of data onto CD/DVD, which has never been a reliable medium even if you use the high quality Taiyo Yuden media.  As a result of this issue where a CD/DVD can become unreadable over the course of years / decades, you have to take one of two approaches:

1) Burn a second (or third) copy of every CD/DVD that you create.  The primary downside is that you double the number of disks that you have to keep track of.  If you store the disks in two separate geographical locations, this is not necessarily a bad thing.  But back when media was far more expensive, this also drove up your costs a lot.  You still need to create some sort of checksum / verification data at the file level so that you can validate your archives down the road (such as MD5 or SHA1 hashes).

2) Add some sort of parity / error recovery data to the disk contents.  While CD/DVD media both include Reed-Solomon error correction at the sector level, you can't always get information about how clean the disc is and whether or not it is failing.  In many cases, the first sign of trouble occurs after the point where the built-in error correction is no longer able to do its job.  So you use a program like WinRAR, QuickPAR, par1 or par2 command line programs, or something else to create additional error correction data and add it to the data being written to the media.

An important concept when dealing with long term archival is "recovery window".  In most cases, when media starts to fail, it is a progressive condition where only a few sectors will have issues at the start.  As time goes on, more and more sectors will fail verification and less and less data will be recoverable.  The exception to this is if the TOC (table of contents) track goes bad, which will then require the use of special hardware in order to read any data off of the media.

In the case of the above approaches:

1) Multiple copies -- The recovery window is from the point that you find out that one of the copies has failed until you make a copy of one of the remaining copies that is still valid. Depending on where the physical media is located, this might be a quick process, or it might require a few days to transport media between locations.  The problem comes when multiple copies are experiencing data loss, because you will need to hope that the same files/sectors on both media are not corrupt on all copies.

Note that the multiple copies approach is only recoverable at the "file" level in most archive situations.  Most verification codes are calculated at the file level, which means a file is either completely good or completely bad.  Unless the file contains internal consistency checks, you cannot combine two damaged files to create a new undamaged copy.

2) Error correction data -- Again, the recovery window starts at the point in time where you first discover an issue.  But because the error correction data lives on the disk next to the raw data, you are able to immediately determine whether the media has failed to the point where data is actually lost.  Some of the tools (QuickPar in particular) used to create verification data can even recover disks where the file system has been corrupted by digging through the block level data and pulling out good blocks.

Note that the two approaches are not exclusive to each other.  For the truly paranoid, creating two copies of the media along with dedicating 5-20% of the media's capacity to error correction will give you lots of options when dealing with "bit rot".

So, back to the original point of the posting...

We used to use QuickPar to create our recovery data.  It was written for Windows XP and had a nice GUI which made it quick to bundle up a bunch of files and create recovery data for those files.  Speed was fairly good, but it never did multi-threading nor did it ever support subdirectories.  It has also not been updated since the 2003-2004 timeframe, so is a bit of a "dead" project.

The successor to QuickPar, for those of us wanting a Windows program with a GUI, seems to be MultiPar.  I stumbled across this from Stuart's Blog posting about MultiPar.  Even though the download page is written in Japanese, MultiPar does have an English GUI option.  Just look for the green button in the middle of the page which says "Download now" and look at the filename (such as "MultiPar121_setup.exe").

3 comments:

Anonymous said...

Whoo-hoo!
I wasn't aware of MultiPar, and have been using QuickPar since it was introduced.

A couple of long-standing problem RAR sets have been corrected using MultiPar, finally!

Thanks for the tip!

Anonymous said...

Storing PAR files on the same optical disc as the files themselves is not a particularly useful solution.

If the optical disc is degraded to the point where the stored data is corrupt, then the PAR files themselves will likely be corrupt also. PAR files do not work if they are corrupt.

PAR files should be stored elsewhere. Preferably a different optical disc brand/MID or a different storage medium entirely.

Thomas said...

Not really that important, and you're missing the point of PAR2/PAR3 (and that it works at a block level).

The purpose of PAR2 on the same disc as the media is to extend the "recovery window" which is the time between "hey, I found corruption" and "it's too corrupt to recover". It allows you to recover from some percentage of corruption, in cases where you aren't willing to invest in a full duplicate of the data on another medium. It's not a replacement for making a full backup on a second set of media.

Optical discs already use Reed-Solomon error correction at the sector level in order to recover from basic bit errors. Which is great. Except that unless you use an advanced tool to scan your optical disc, you won't know that the Reed-Solomon error correction is being used until the sector has degraded so far that it can no longer be corrected by RS. For most end-users, that is the first time that they notice that a particular disc is failing. If the disc has reached that point of its life, then the user has no choice but to repeatedly attempt to read the disc sector and hope that RS error correction gets a different result.

By putting 1% / 5% / 10% parity data on the same disc, you give up a little bit of space in exchange for being able to recover from bad sectors on the disc. How much damage you can recover from varies based on the block size in your PAR2/PAR3 files and how much space you gave over to parity data. For the less paranoid, 3-4 PAR2/PAR3 files that are about 1-2% of the original data size is enough to catch most issues. For the more paranoid, go with 5-10% parity and split those recover blocks over 10-20 files.

It also doesn't matter whether the corruption occurs within the data file or within the PAR2/PAR3 files. Because data is analyzed at the block level, a PAR2/PAR3 file can be partially corrupt and still contain useful recovery blocks. And with multiple recovery files, even if one of the PAR2/PAR3 files are completely corrupt, you still have a few other recovery files to choose from. The PAR2/PAR3 tools are also careful to examine the data contained within the recovery file and will detect bit-rot.

About the only fatal error that would prevent recovery is a disc where the TOC track is damaged. Recovering from a corrupted TOC track requires a special optical drive.