Recoverer

Recoverer is a project to create a generic way to recover files without relying on the filesystem. The impetus for this project was a camera memory card that I formatted prematurely. I never subsequently filled up the card, so the data theoretically would still exist. Using the first version of this program, I was able to find about 40 photos that I'd previously lost. This sort of recovery can only work, automatically, if the files have some common factors. Recoginizing this, Recoverer works in two steps.

The first step, called fingerprinting, involves providing any number of sample files. Fingerprint will examine the start and end of the files to determine what they all have in common. You'll be asked to name the fingerprint and indicate a minimum and maximum file size.

The other step is to run the recoverer program. Passing in the fingerprint file and a disk (or any file) name, it will search for any patterns that match the fingerprint and restore them to new files in the current directory. The minimum and maximum file sizes are used to prevent false positives on the end pattern and to prevent incomplete files from preventing further recovery.

Why You Should Format!

If you're working with anything important while photographing, I have a few recommendations for you. First, format every memory card each time before you use it. The "delete all" option may or may not work as well, and definitely will not if you have any protected images. Next, don't delete any photos while shooting. Finally, if you absolutely must erase, try not to fill up the memory card.

The reason I suggest this is to provide the best chance that your data will be saved in complete chunks. By formatting, you're giving the card a complete slate. Even if the camera is using a greedy algorithm to allocate space, there will only ever be one block of free space to draw from. By not erasing, you ensure that no other blocks of free space are created. Consider the case where you delete an image. Once you fill up the rest of the card, the camera will have to try to use any other available free space. If the new image is any larger than the deleted image, it won't fit into the hole unless it's split into two chunks. Now, not only does that image become unrecoverable, the image directly after it becomes harder to find as well (because recoverer will find the partial image header first, but no trailer).

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Download
Recoverer 0.0.1
Posted 2007-11-10

Go back...