Forensicsdata recoverybad sectorsdisk imagingforensicscd dvd recovery

recoverdm

recoverdm recovers files or complete devices from disks with damaged sectors by writing empty sectors for unreadable ones and continuing. It supports RAW mode reading for CDs/DVDs and includes mergebad to combine multiple images.

Description

recoverdm is designed to recover data from disks with bad sectors, useful in forensics investigations. It can recover individual files or entire devices, replacing unrecoverable sectors with empty ones to continue the process without stopping. For CDs and DVDs, if normal reading fails, it attempts RAW mode reading without error-checking.

The toolkit includes mergebad, a utility to merge multiple images from damaged sources into one correct image, using mapfiles generated by recoverdm that list checksums and bad sectors. This is particularly valuable when multiple copies of a damaged disk are available, allowing reconstruction of a complete image.

Use cases include data recovery from scratched optical media or failing hard drives in forensic contexts, where preserving as much data as possible is critical.

How It Works

recoverdm reads the input device or file sector-by-sector, retrying failed reads a specified number of times (default 6). For unrecoverable sectors, it outputs empty sectors and logs them if -l is used, generating a mapfile with checksums and bad sector lists. For CD/DVD, it falls back to RAW mode reads (default 6 retries, advised min 3). mergebad uses mapfiles to align and merge multiple images, resolving bad blocks by selecting good data from available sources, with options to list common bad blocks or adjust output size.

Installation

bash
sudo apt install recoverdm

Flags

-t <type>Specify input type: FILE=1, FLOPPY=10, FLOPPY_IDE=11, FLOPPY_SCSI=12, CDROM_IDE=20, CDROM_SCSI=21, DVD_IDE=30, DVD_SCSI=31, DISK_IDE=40, DISK_SCSI=41
-i <file/device-in>Input file or device to recover from
-o <fileout>Output file to write recovered data to
-l <sectorsfile>Generate mapfile with checksums and list of bad sectors for use with mergebad
-n # retriesNumber of read retries (defaults to 6; advised 1 for CD-ROMs)
-s rotation speedRotation speed for CD-ROM/DVD (defaults to 1)
-r # CD/DVD RAW read retriesRAW read retries for CD/DVD (defaults to 6; advised at least 3)
-b start offsetStart offset for recovery
-p skip blocks countNumber of sectors to skip after a non-readable one (default 1; higher speeds up process)

Examples

Recover a file type image to output file with default settings
recoverdm -t FILE -i input.img -o output.img
Recover CD-ROM IDE device with 1 retry and generate bad sectors mapfile
recoverdm -t CDROM_IDE -i /dev/sr0 -o cd_image.img -l badsectors.map -n 1
Recover SCSI disk with 3 RAW retries and speed 1
recoverdm -t DISK_SCSI -i /dev/sdb -o disk_image.img -r 3 -s 1
Recover DVD IDE, skip 5 blocks after bad sectors, generate mapfile
recoverdm -t DVD_IDE -i /dev/sr0 -o dvd.img -l mapfile -p 5
Recover IDE floppy starting at offset 1024
recoverdm -t FLOPPY_IDE -i /dev/fd0 -o floppy.img -b 1024
Merge image using mapfile to create output image
mergebad -i badsectors.map damaged.img -o merged.img
Merge with verbose output and list common bad blocks
mergebad -i mapfile.img -o final.img -l common_bad.map -v
Merge and set output size to 1GB
mergebad -i mapfile.img -o resized.img -s 1G
Updated 2026-04-16kali.org ↗