Projects / safecopy


safecopy is a data recovery tool which tries to extract as much data as possible from a seekable but problematic (i.e., damaged sectors) source like floppy drives, hard disk partitions, CDs, etc., where other tools like dd would fail due to I/O errors.

Operating Systems

RSS Recent releases

  •  11 Mar 2012 00:02

Release Notes: Safecopy can now wait for a disappearing source device to come back with the --forceopen option, which is useful in case USB devices temporarily vanish during renumeration. It is now possible to explicitly tell safecopy where to continue a previous session, which allows incremental mode when writing directly onto a target device. Safecopy now reports meaningful exit codes. "0" is reported in case of a 100% successful copy, "1" in case of non-recoverable read errors, and "2" in case of a serious error or an otherwise aborted process.

Release Notes: This release fixes a bug regarding badblock include file handling.

Release Notes: Safecopy now features a benchmark suite, ready to test-run data recovery tools in a controlled environment. This includes simulation of permanent and occasional IO errors, realistic read and seek timing characteristics, and sample presets for simulating a small number of faulty devices. The safecopy main program has been enhanced to be able to read from /dev/raw devices or open files with O_DIRECT if requested. New command line switches generate debug output and collect statistic information on damaged devices to be used for simulation with the benchmark utility.

Release Notes: Some compilation issues on AMD-64 systems have been fixed and the test suite shipped with safecopy has been rewritten to be more modular, portable, and reusable. There are also some fixed typos in safecopy documentation, program output, and code. Base functionality wise, however, this release behaves the same as version 1.3. Therefore, for end users, upgrading from 1.3 to 1.4 is optional. Package maintainers are encouraged to validate their 1.3 binary with the 1.4 test suite, should the old test suite have failed to compile or execute. The tests themselves are binary compatible between the versions.

Release Notes: Safecopy has been internally redesigned to improve reliability and predictability of behavior. It now comes with a textual behavior specification and a self test suite, complete with a glibc wrapper library to simulate IO errors on virtual files. Blocksize autodetection now also works in combination with low level device access. Blocksizes can now be specified as a percentage of the file size or as multiples of the hardware blocksize, making these options much easier to use. New option presets provide shortcuts for multi-stage data rescue with minimum commandline typing effort.

RSS Recent comments

31 May 2012 01:22 Sepero1 Thumbs up

Unbelievable, I just spotted your email address on the page. I guess what I should have asked is to have it placed near the very top or bottom of the page so it can readily be seen. Cheers!

31 May 2012 01:15 Sepero1 Thumbs up

I really like safecopy. When copying optical discs it is NOT like dd_rescue at all, because it actually works (instead of failing on I/O errors). I have a request though. Could you please, please, please put an email or some contact on the safecopy webpage.

I spent an hour looking over the page and through all your source code trying to find a way to contact you.

17 Jul 2009 11:46 Avatar CorvusVCorax Thumbs up

You might also want to look at GNU ddrescue here. They do a similar thing however with different emphasis.

1. ddrecue does the equivalent of a safecopy 'multi stage rescue' fully automatically in a single run, partitioning the source file semi-intelligently depending on found IO errors, but IMHO gives the user less feedback and control over the copying process and occuring errors.

2. ddrescue is more optimized for overall copying speed, especially on non erroneous data. Whether its actually faster than safecopy on real data depends on hardware, error distribution and parametrisation. You can usually find parameters for safecopy to make it faster than ddrescue but ddrescue tries to be optimal on its own without the need of tweaking parameters. Generally, doing safecopy --stage1 plus --stage2 is roughly comparable in speed. Also doing a --stage3 makes safecopy considerable slower but also potentially rescues more data.

3. ddrescue to my knowledge has no low level IO capabilities on its own, but does support accessing /dev/raw devices for bypassing kernel level caching (raw device "mounting" needs to be done manually though. You should be able to do that with safecopy too, but honestly I didn't try that yet. Please give me a bug report if there are any problems :)

4. ddrescue's sector logfiles are not compatible to fschk, mkfs or safecopy badblock lists. That should be workaroundable with a simple perl or bash translator script though.

I have not yet done extensive tests and benchmarks to compare safecopy with other tools.
Safecopy has big advantages when it comes to damaged CDs thanks to lowlevel IO, and might be better suited for an experienced user, wanting fine control, while ddrescue might be better suited for users who don't know what they are doing and still want to get maximum data with minimum hardware harm and time.

13 Jun 2005 07:50 Avatar CorvusVCorax Thumbs up

Re: and dd_rescue?

yes I have - unfortunately after I already wrote the code, so indeed while it seems like the wheel has been reinvented just another time, lucky we are this tech is at least not patented (i hope), so we actually CAN do this ;)

while searching for alternatives I would also note:

dd_rhelp - a frontend for dd_recover which tries to speed up the retrieval of valid data

recoverdm - a tool that works slightly more low level on the hardware and therefore maybe more effective

cdrdao - together with further tools like bin2iso probably the best alternative while working on CDs

13 Jun 2005 00:15 rdawes

and dd_rescue?
Have you looked at dd_rescue? It does largely the same things that you are doing . . . .


Project Spotlight


A security audit and hardening tool.


Project Spotlight


A commandline password manager based around GnuPG.