Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 had a server crash and it took with it the hard drive. I put the hard drive in a USB enclosure, but the main partition would not mount because the partition was corrupted. I was able to see the USB hard drive, just not mount it. Using the "dd" command, I was able to find a super block and I was able to do an image of the old hard drive.

From that image, I was able to retrieve my web files but what I really need is the database, so I used "e2fsck" and it dumped everything into a lost+found directory, and there is a lot in there.

I have gone through the entire lost+found directory and first sorted out all the MySQL files, then sorted out the ones that were date and time stamped to match up to the database I'm trying to retrieve.

Each file name is the inode number of the original file, and it looks like they're in some sort of sequential order, so the tables were probably created all at once, one after each other. However, there is no pattern, and why the breaks in sequence of the inode numbers?

The files marked "MISAM" are the .MYI files.

The files marked "Definition" are the .FRM files. Some are showing version 9 and some are version 10 - does this make a difference?

The files marked "Data" are the .MYD files. Some are showing "data" and some show "DBase 3 data file" - does this make a difference?

I can use the "cat" command to view the file contents, but it's nearly impossible to determine which table it belongs to. If I have a list of the table names, is there a way to find out which files belong to what tables?

Even still, how can I determine if an frm, myi, and myd file belong to the same table?


share|improve this question

It would be a lot easier to restore the database from your backup.


share|improve this answer
And if there is no backuo, send it off to a professional for recovery while praying to a favorite deity... – Oskar Duveborn Sep 18 '10 at 11:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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