safecopy
Safecopy is a data recovery tool for problematic or damaged media that extracts as much data as possible by skipping bad areas and using low-level operations. It generates images similar to ddrescue and is useful for forensics and disaster recovery.
Description
Safecopy is designed to rescue data from sources causing IO errors, such as floppy disks, hard disk partitions, CDs, DVDs, and tape devices where tools like dd fail. It identifies damaged areas, skips them, and fills corresponding destination areas with zeros or a recognizable pattern. This makes it valuable in forensics investigations and disaster recovery scenarios.
The tool employs an incremental algorithm to precisely locate the beginning and end of bad areas, balancing minimal access to damaged sectors with thorough data recovery. Multiple passes can be performed, starting with fast recovery of most data and progressing to more aggressive attempts on remaining unreadable sections.
Safecopy includes a low-level I/O layer for raw CDROM reading, device resets, and other operations on specific device classes, enhancing recovery from hardware failures.
How It Works
Safecopy uses an incremental algorithm to detect exact boundaries of bad areas, skipping them with configurable block sizes and resolutions. It supports multiple passes via badblock files, low-level device calls (e.g., CDROM raw reads, resets), retries, head realignment seeks, and synchronized reads. Unrecovered areas are zero-filled or marked, with output symbols indicating progress like successful reads (.), skips (X), and backtracking (<).
Installation
sudo apt install safecopyFlags
Examples
safecopy [options] <source> <target>safecopy --stage1 /dev/sdX image.imgsafecopy --stage2 -I stage1.badblocks /dev/sdX image.imgsafecopy --stage3 -I stage2.badblocks /dev/sdX image.imgsafecopy -I badblocks.txt -o newbadblocks.txt /dev/cdrom image.isosafecopy -b 2048 -f 10% -r 512 -L 2 /dev/fd0 floppy.imgsafecopy -s 1000000 -l 5000000 /dev/sda damaged_partition.img