Well, here’s what happened with my little webserver that this site resides upon. About 2 weeks ago, the site went down. Not sure why exactly, but when I got upstairs to check on it, it had rebooted and was sitting at “freeing unused kernel memory: 224k freed.” Hmmmmmmm…this is not a good thing. I powered the box down and brought it back up, it went through the boot sequence, decompressed the kernel image and then, as it was about to run init, it stopped at the same “freeing unused kernel memory…” message. Soooooooo I hit Google and there wasn’t much that was helpful when I looked up that error message. Most of the articles/posts I found did say it was probably a problem with init. So I decided to experiment.

First of all, I popped in my Knoppix CD and booted into Knoppix 3.1. I was able to mount the drive that was giving me problems and copied over the Knoppix version of init in place of the RedHat 7.1 version I had on my box. Then I shut it down and rebooted…different error this time…kernel panic b/c init was thinking it was from Knoppix. OK…so init programs aren’t interchangeable. I learned something.

So I put the original init back and decided I’d try to upgrade the OS with either RedHat 8 or 9. Well, neither of them would upgrade successfully b/c the file system had not been unmounted cleanly. I tried to boot into recovery mode and run fsck on it but it didn’t fix anything.

I resigned myself to the fact that I’d probably have to reformat the drive and reinstall…but I had all this data on the drive that I could SEE when I was in Knoppix, so I needed to get that off of there. I took the drive to work with me on a Saturday when I had to go in anyhow and mounted the drive in a Linux box I have running there. I connected to a Windows machine via Samba and copied off all the pertinent data from my home directories that run this website and burned them onto a DVD.

OK…that worked great. EXCEPT I had several MySQL databases on the old box that weren’t backed up and I didn’t know how the heck to recover them. I looked all over for ways to recover MySQL data and was pretty disappointed in what was out there. So, I posed the question to my local LUG and got back a pretty vague but ultimately helpful response. All it said was “look in /var/lib/mysql”. So, I did…sure enough, each DB had a sub-directory with 2 files in them for each table. I copied those files off of the old drive and stopped the MySQL daemon on the new server, copied the files into /var/lib/mysql, set the ownership and permissions to match what was there originally, restarted the server and BINGO it just all worked!!

So, I guess I put this up here as a means to document what I did for myself, and with the hope that the Google bots will catalog it so that the next person who searches for “recovering MySQL databases” might come up with something that helps them!!