Forensicsdata recoverydisk rescueforensicsdamaged media

myrescue

myrescue rescues readable data from damaged hard disks, CD-ROMs, DVDs, and flash drives. It prioritizes undamaged areas first, unlike dd_rescue, and is useful for data recovery and forensics investigations.

Description

myrescue is a program designed to extract still-readable data from damaged storage media such as hard disks, CD-ROMs, DVDs, and flash drives. It operates by quickly skipping over damaged areas to first recover data from undamaged sections, returning to problematic areas later. This approach makes it particularly effective for partial recoveries where complete reads would fail.

The tool is valuable for general data recovery scenarios and forensics investigations, where preserving evidence from compromised media is critical. It generates bitmap files tracking block statuses, which can be analyzed for insights into media health.

Companion tools like myrescue-bitmap2ppm for visualization and myrescue-stat for statistics enhance its utility in assessing recovery progress and media condition.

How It Works

myrescue reads blocks from the input file using a configurable block size (default 4096 bytes), starting from a specified start block and up to an end block. It employs strategies like exponential skipping of errors (-S), aborting on errors (-A), skipping blocks with excessive failures (-f), and retrying reads (-r). Options like -G focus on areas around good blocks, -F skips around failed ones, and -T avoids slow-reading blocks. A bitmap file tracks block states: 0 (unhandled), 1 (successfully copied), 2 (slow success, near-dead), negative (failed attempts). Direction can be reversed (-R), and USB resets are supported (-U).

Installation

bash
sudo apt install myrescue

Flags

-b <block-size>block size in bytes, default: 4096
-B <bitmap-file>bitmap-file, default: <output-file>.bitmap
-Aabort on error
-Sskip errors (exponential-step)
-f <number>skip blocks with <number> or more failures
-r <retry-count>try up to <retry-count> reads per block, default: 1
-s <start-block>start block number, default: 0
-e <end-block>end block number (excl.), default: size of <input-file>
-G <range>only read <range> blocks around good ones
-F <range>skip <range> blocks around failed ones
-J <number>randomly jump after reading a few sectors
-Tmake -A, -S and -F avoid blocks that took long to read
-Rreverse copy direction
-U <dev-file>USB device reset after read error (something like /dev/bus/usb/XXX/XXX !)
-h, -?usage information

Examples

Display usage information and available options
myrescue --help
Basic usage: rescue data from input-file to output-file with default settings
myrescue <input-file> <output-file>
Show usage for myrescue-bitmap2ppm, which visualizes the block bitmap
myrescue-bitmap2ppm -h
Generate PPM visualization from a myrescue bitmap file
bitmap2ppm <bitmap-file> <width> <rows> <width> ...
Print block bitmap statistics including counts and percentages for conditions like unhandled, success, slow success, and failures
myrescue-stat bitmap-file
Rescue with 2048-byte blocks and up to 3 retries per block
myrescue -b 2048 -r 3 /dev/sda damaged.img
Skip errors exponentially and blocks with 5+ failures
myrescue -S -f 5 input.img output.img
Updated 2026-04-16kali.org ↗