NOTE: This project is no longer supported: It has been renamed to MockFS. Please go to http://rubyforge.org/project/mockfs. [edit]
It doesn’t matter how it happened, it doesn’t matter why, blame can (and probably will) be placed later. What matters now is that your production MySQL database was just deleted from the filesystem while the MySQL daemon was running. The good news is that the server, somehow, is still running fine, and the system is still up. The bad news is that the directory where MySQL stores the database is now empty.
Take a deep breath, you are running Linux, here is what to do:
Default operating system installs on a server are almost always wrong. Unfortunate, but true. In an attempt to build a generic system that appeals to as many situations as possible, the default install is often overloaded with software that is not necessary, and a filesystem layout that would allow one rogue daemon to fill up the entire drive. This is wrong, but easily remedied. A little extra care during the installation and initial setup of the server will result in a system that is smaller, cleaner, easier to maintain, and more secure than what ships on a default install.
If you open nautilus and browse to the root filesystem, you’ll see something that looks like the image to the left.
This is the default layout of the filesystem in Ubuntu 10.10, and is a peek into the ancient (by computer science standards) history and genealogy of Linux. The directories listed above are holdouts from one of the oldest standards, the Filesystem Hierarchal Standard, FHS.