4

We're recoverying bunches of data from a crashed partition of which we had no backup, using a data recovery software. Files are getting recovered, but file names are lost.

Is there any software or method we could use to automatically scan the file headers to try to determine its type (between the most common ones: image types, different kind of source code text files, compressed files, etc) and automatically put an extension on its random name, to help then processing the data?

Maybe this PHP function will help?

Thanks in advance.

7
  • 4
    What OS are you using? Linux has the 'file' command which will identify the file type from the contents. You'd need to wrap a script around it to make it automagic, but that's not a big task... See linux.die.net/man/1/file for man page.
    – BobT
    Jan 7, 2013 at 17:14
  • 1
    in addition to file, as @BobT said, you can also, on unix, read the original filenames (including their eventual extension, if any) from the (recovered) directory entries. The tricky part being to match file entry in a directory with a recovered file under another name... Jan 7, 2013 at 17:20
  • 1
    @BobT we don't depend on a particular OS to do this task, we can adapt. Your suggestion seems useful. Jan 7, 2013 at 17:39
  • @OlivierDulac, directory entries are unrecoverable, data recovery software is giving random names to files. Thanks anyway ;) Jan 7, 2013 at 17:40
  • 1
    Maybe you can recover the dir themselves (ie, the inode who contained a dir entry. That inode will, in turn, contain the former list of files+dirs "directly underneath it", and can be read by several means). The soft maybe rename those directories names too, but their content should still contain the former lists. Jan 7, 2013 at 23:32

1 Answer 1

3

You can use TrID for that. There are versions for both Windows and Linux. It can scan multiple files and with the "-ae" switch it can rename each one adding the guessed extension.

Disclaimer: I'm TrID's developer.

2
  • thanks @Mark0, such an interesting project! Am I missing a -r recursive parameter for asterisk-dot-asterisk mask? Jan 9, 2013 at 9:27
  • Thanks @Áxel. Indeed, no directories recursion at the moment; it's coming in a next versions.
    – Mark0
    Jan 9, 2013 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .