README file for dd_rescue ========================= (c) garloff@suse.de, 10/99, GNU GPL Description of dd_rescue ------------------------ Like dd, dd_rescue does copy data from one file or block device to another. You can specify file positions (called seek and Skip in dd). There are several differences: * dd_rescue does not provide character conversions. * The command syntax is different. Call dd_rescue -h. * dd_rescue does not abort on errors on the input file, unless you specify a maximum error number. Then dd_rescue will abort when this number is reached. * dd_rescue does not truncate the output file, unless asked to. * You can tell dd_rescue to start from the end of a file and move backwards. * It uses two block sizes, a large (soft) block size and a small (hard) block size. In case of errors, the size falls back to the small one and is promoted again after a while without errors. Purpose of dd_rescue -------------------- The latter three features make it suitable for rescuing data from a medium with errors, i.e. a hard disk with some bad sectors. Why? * Imagine, one of your partitions is crashed, and as there are some hard errors, you don't want to write to this hard disk any more. Just getting all the data off it and retiring it seems to be suitable. However, you can't access the files, because the file system is damaged. * Now, you want to copy the whole partition into a file. You burn it on CD-Rom, just to never lose it again. You can setup a loop device, and repair (fsck) it and hopefully are able to mount it. * Copying this partition with normal Un*x tools like cat or dd will fail, as those tools abort on error. dd_rescue instead will try to read and if it fails, it will go on with the next sectors. The output file naturally will have holes in it, of course. You can write a log file, to see where all these errors are located. * The data rate drops very low, when errors are encountered. If you interrupt the process of copying, you don't lose anything. You can just continue at any position later. The output file will just be filled in further and not truncated as with other Un*x tools. * If you have one spot of bad sectors within the partition, it might be a good idea, to approach this spot from both sides. Reverse direction copy is helpful. * The two block sizes are a performance optimization. Large block sizes result in superior performance, but in case of errors, you want to try to salvage every single sector. So hardbs is best be set to the hardware sector size (most often 512 bytes) and softbs to a large value, such as the default 64k. Does it actually work? ---------------------- Yes. I wrote a predecessor program (dw) and saved most of the data of two crashed hard disks. The current program also helped me secure the data of one beginning to have problems. A good approach is first to copy all those sectors which are working without problems. For this, you approach the critical regions from both sides. It is a good idea to take notes on which sectors are still missing. If you are lucky, you will be able to reconstruct your file system, already. Otherwise, you should try to fill in more of the critical sectors. Some of them might be readable and provide some more useful data. This will take a long time, however, depending on how hard your hard disk tries to read bad sectors. Limitations ----------- The source code does use the 64bit functions provided by glibc for file positioning. However, your kernel might not support it, so you might be unable to copy partitions larger then 2GB into a file. This program has been written using Linux and only tested on a couple of Linux systems. It should be possible to port it easily to other Un*x platforms, but I have not tried. Currently, the escape sequence for moving the cursor up is hard coded in the sources. It's fine for most terminal emulations (including vt100 and linux), but it should use the terminal description database instead. Due to the way the program works (input and output are always written to the designated position, i.e. a seek() is done before the I/O operation is actually performed), char devices can not be read from or written to. Therefore you can't redirect output to stdout. This limitation has been lifted in version 1.10; though with non-seekable in- and our output, you can't recover from errors on that channel. Copyright --------- This little program is protected by the GNU General Public License (GPL). (See the file COPYING, which probably exists a few hundred times on your computer. If not: I will send you one.) To summarize: * You are free to use this program for anything you like. However, if you release a program that uses code from this program, your program must be released under the terms of the GNU GPL again. * You are allowed to put this program on CDs or other media and charge a fee for copying and distributing it. You have to provide the source code (or a written offer to provide it) and the GPL text, too, then. * There is no warranty whatsoever for this program. If it crashes your disks, it's at your risk. * This summary does not replace reading the GNU GPL itself. Feedback -------- ... is always welcome. Just send me an e-mail. The web page of this program, BTW, is http://www.garloff.de/kurt/linux/ddrescue/ Have fun! (Hopefully you don't need this program. But if you do: I wish it will be of some help.) Kurt Garloff , 2000-08-30 $Id: README.dd_rescue,v 1.9 2004/08/28 21:45:09 garloff Exp $