I lost an important file. I know what bytes the file begins with. How can I search the partition for the sequence of bytes?
|
feedback
|
migrated from stackoverflow.com Aug 17 '10 at 13:16
This question came from our site for professional and enthusiast programmers.
|
You might be interested by packages such as ext3grep and magicrescue. | |||
|
feedback
|
You can open partition device (such as /dev/hdc1) as a file in any hex editor/viewer your distribution has available (for example, midnight commander should be able to do that). Just make sure that you opened device in read-only mode and that your hex editor can handle files of that size. Also, one byte won't be enough to find the file. | |||||||||
feedback
|
|
There is a forensics tool called foremost which can help recover files. | |||
|
feedback
|
|
I'm quite sure that it isn't the best solution, but you can grep the device, for example:
This will search the byte string | |||||||||
feedback
|
