patrickpkt
10th of November 2007 (Sat), 23:12
I accidentally formatted a memory card a few weeks ago (fortunately, it wasn't anything that was terribly important). I only filled up about half the card while using it after the format, so I thought I'd write a program to try to recover the old images. I did just that, recovered my files, and all was good with my world. Cutting to the chase, I thought it might be useful, at least to people who use Linux or, presumably, a Mac, so I've posted it up at http://patrickmcneill.com/projects/recoverer/.
As an aside, I wanted to reiterate the common wisdom that you should use the "format" option on your memory cards instead of just deleting everything. My reasoning, though, is that it will give you the best chance possible of recovering images if anything should happen to the card. Here's what I wrote up, from the link above:
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).
As an aside, I wanted to reiterate the common wisdom that you should use the "format" option on your memory cards instead of just deleting everything. My reasoning, though, is that it will give you the best chance possible of recovering images if anything should happen to the card. Here's what I wrote up, from the link above:
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).