I've just recovered several GB of data using photorec from a family friend's dead NAS backup box. So far so good.
But as is common with the methods used by photorec it can generate some very large files which are largely rubbish. Eg tiny gif files being recovered as >1GB because photorec hasn't detected the end of the file.
I'm looking for tools that can postprocess these files, but looking around I'm seeing people discussing the problem as if it's just one of those things. Does anyone have any experience of this sort of thing?
My typical strategy is to use "find" to locate recovered files by file extension and move them to a directory per file type, then hand the results over to whoever's disk it was. But I know I can do better!
For example: The 1GB+ GIF file can be "fixed" using convert or mogrify (from ImageMagick): convert recovered.gif fixed.gif As far as I know that effectively loads the file and re-saves it without making any changes (but all the rubbish gets stripped in the process) - can anyone confirm this? If so: cd recovered/gif && mogrify * .. is a safe way to fix the recovered files.
Similarly, .zip files (and related files, such as LibreOffice docs) can have this problem; extracting the zip and recreating it fixes it.
Any other tricks I should be aware of? Anyone aware of any tools to automate this? Ideally this should happen in tandem with the recovery; all those wasted GB are reducing the capacity of the destination drive, sometimes to the point that the recovery fails to complete.
Mark
On 24 October 2014 11:19, Mark Rogers mark@quarella.co.uk wrote:
I'm looking for tools that can postprocess these files, but looking around I'm seeing people discussing the problem as if it's just one of those things. Does anyone have any experience of this sort of thing?
There's something about asking a question that makes me think of other ways to search for information, and that lead me here: http://www.cgsecurity.org/wiki/After_Using_PhotoRec
That (a) tells me there are some tools to automate the sort and (b) still nobody seems to be looking at the post-processing aspect. However, the scripts there would work as a starting point to add the post processing in. What I really need are ways to fix files that I am absolutely sure don't throw away any data. I'm pretty sure "mogrify file.gif" is OK (the resulting file is identical to the original up to the point where the rubbish is stripped, for the files I've tested) but (for example) I need to be sure that no meta info is lost.
On 24/10/14 11:30, Mark Rogers wrote:
On 24 October 2014 11:19, Mark Rogers mark@quarella.co.uk wrote:
I'm looking for tools that can postprocess these files, but looking around I'm seeing people discussing the problem as if it's just one of those things. Does anyone have any experience of this sort of thing?
There's something about asking a question that makes me think of other ways to search for information, and that lead me here: http://www.cgsecurity.org/wiki/After_Using_PhotoRec
That (a) tells me there are some tools to automate the sort and (b) still nobody seems to be looking at the post-processing aspect. However, the scripts there would work as a starting point to add the post processing in. What I really need are ways to fix files that I am absolutely sure don't throw away any data. I'm pretty sure "mogrify file.gif" is OK (the resulting file is identical to the original up to the point where the rubbish is stripped, for the files I've tested) but (for example) I need to be sure that no meta info is lost.
There's a program called exiftool (and I'm sure many others) that if you say exiftool jpegname.jpg will output the exif info to the console. I'm sure you could knock up a script to output the exif info from the bad and the fixed files and then compare them, and stop on any errors.
HTH Steve
On Fri, Oct 24, 2014 at 06:27:32PM +0100, steve-ALUG@hst.me.uk wrote:
There's a program called exiftool (and I'm sure many others) that if you say exiftool jpegname.jpg
There's a tool linked in the page above called jhead which allows you to name photos based on EXIF data without needing to do any scripting, I was going to suggest it when I saw the original mail. Currently I use jhead on all my photographs to give them a unique name based on the time+date, image number and the camera used to take them, simply as it's easier to store all the photos in a tree by YYYY/MM.
Adam
On 24 October 2014 18:43, Adam Bower adam@thebowery.co.uk wrote:
On Fri, Oct 24, 2014 at 06:27:32PM +0100, steve-ALUG@hst.me.uk wrote:
There's a program called exiftool (and I'm sure many others) that if you say exiftool jpegname.jpg
There's a tool linked in the page above called jhead which allows you to name photos based on EXIF data without needing to do any scripting, [...]
Sorry, I meant to say thanks for the pointers. However I had another crack at recovering the disk image via dd (actually I used myrescue, not one I've tried before) and got a good enough image to do a filesystem restore and recovered the directory structure and filenames, making this direction redundant for now. But it's not the first time I've needed it and it won't be the last!