Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way to search a raw block device for file type patterns on linux. The partition type is known and the partition table exists.

I want a linux based (open source maybe?) programm that allows me to search for known file types (by looking for file type patterns or header data).

Is there anything you can think about to do this?

share|improve this question

closed as not constructive by Michael Hampton, pauska, MDMarra, ewwhite, Tom O'Connor Oct 2 '12 at 15:09

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Why? What are you attempting to do? – ewwhite Oct 2 '12 at 12:55
Trying to find deleted (no links in the partition table) but still existing (not overwritten) files and saving them to another medium. I found that magicrescue is looking for the magic number of files and should be able to perform this task on a mounted device. – masi Oct 3 '12 at 10:50
up vote 2 down vote accepted

photorec does this. I am sure there are other tools as well, but this one is likely to already be present on your Live CD, or installable to it.

share|improve this answer
Beat me to it! It's also possible to add your own signatures if necessary. – afrazier Oct 2 '12 at 12:53

"photorec" was already mentioned, so I would like to add foremost. You can just add header and footer (and size limit) to a .conf, and search for anything you wish - easier if you're searching for non-standard file formats.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.