# Dvdisaster

dvdisaster is a computer program aimed to enhance data survivability on optical discs by creating error detection and correction data, which is used for data recovery. dvdisaster works exclusively at the image level. This program can be used either to generate Error-Correcting Code (ECC) data from an existing media or to augment an ISO image with ECC data prior to being written onto a medium. dvdisaster is free software available under the GNU General Public License.

## Recovery modes

When an optical disc is physically damaged (such as by scratching), or has begun to deteriorate, some parts of the data on the disc may become unreadable. By utilizing the ECC data previously generated by dvdisaster, damaged parts of the disc data can be recovered.
The two modes of ECC data generation in dvdisaster make use of Reed–Solomon codes. In RS01 mode, the generated data is created from a disc image and is stored in a separate file, which must be written on some other medium. Alternatively, in RS02 mode, the ECC data is appended to the end of the disc image before the image is burned to disc.
When a CD or DVD has been augmented in RS02 mode, the 'augmented' section of the data remains invisible to the normal user, and the disc remains fully compatible with computers without knowledge of or installation of dvdisaster. In this way a damaged disc may be fully recoverable by installing the software, accessing the Reed-Solomon error correcting code using dvdisaster and rebuilding the image (to hard disk).
dvdisaster can be helpful to recover the contents of a damaged disc even when no ECC data is available. The entire disc can be read into an image, skipping damaged parts. dvdisaster can then repeatedly rescan just the missing parts, attempting to retrieve correct data.

## Difference with other Reed-Solomon implementations

dvdisaster applies an image-based approach to data recovery. It does not apply a file-based data recovery, as reading a defective medium at the file level means trying to read as much data as possible from each file. But a limitation of the file-based approach arises when data sectors are damaged which have book-keeping functions in the file system. The list of files on the medium may be truncated. Or the mapping of data sectors to files is incomplete. Therefore, files or parts from files may be lost even though the respective data sectors would still be readable by the hardware. In contrast, reading at the image level uses direct communication with the drive hardware to access the data sectors.
It is important to point out that each unit of ECC data dvdisaster places at the end is calculated from sectors of the original data spread around in the original image. Each group of original data sectors and the added ECC sector(s) forms a "cluster". Any part of the cluster can be recovered as long as the amount of damages in that cluster is smaller than the amount of added ECC data in that cluster, therefore the location on disk of the ECC data doesn't matter.
Clusters are different in Parchive, since each file is considered as a single block: with dvdisaster data loss begins when one of the clusters has more than about 15% of errors (unlikely to happen but theoretically possible with few KiB of data), while Parchive can recover any error, provided that the PAR2 files are intact and that the number of corrupted files (it doesn't matter how much corrupted) is smaller than the number of available ECC files. dvdisaster also has a mode with separate ECC files.