On Mon, Apr 06, 2009 at 02:08:18PM -0400, John Almberg wrote:
> Okay, so my new database server is running with backup data and I am  
> trying to salvage the old database, or what's left of it.
> Unfortunately, it seems like what's left of it, is not much.
> the /var/db/mysql directory tree is now a file:
> qu# ls -l /var/db/mysql
> -rwx------  2 mysql  wheel  1024 Jul  5  2008 /var/db/mysql

Normally it shouldn't be possible to turn a directory into a file. Using
open(2) to create a file that already exists as a directory should
result in an error.

> The situation looks hopeless to me. Is it?

It might not be. Unless the data was actively wiped or overwritten, the
data is probably still there on the disk in unallocated
sectors. Forensic analysis programs like the sleuth kit
[http://www.sleuthkit.org/sleuthkit/desc.php] _might_ be able to get
some of the data back. But don't hold you breath. It's practically
impossible to get data back from a modern drive once it has been overwritten.

> Another question: given that the file system took a major hit, should  
> I try to fix it, or just do a clean install? I'm leaning towards the  
> clean install since I've been meaning to upgrade this machine to 7.1  
> anyway.

I would advise you to make a copy of the disk contents with dd, so you
can poke around in it at your leisure. Then check the disk with e.g.
smartmontools or the tools provided by the manufacturer and to a clean

> Is there anyway to fix the file system, reliably? fsck doesn't seem  
> to be able to solve all the problems.

Is that with fsck_ffs running in preen mode? If so, try it without the
-p option. If that doesn't work you might contemplate using the -D
option, but this can be dangerous; see fsck_ffs(8). If fsck_ffs even
then cannot repair the damage, there's not much you can do except wipe
the disk and reinstall. Also, check for loose (S)ATA cables. This can
cause g_vfs_done errors while the disk is fine. If there are no obvious
errors of that kind I'd be extra suspicious about disk hardware
failure. If the drive is still in warranty, I'd have it replaced. If
not, you might still think about replacing it. buying a new disk is
almost certainly cheaper that trawling through a diskload of data trying
to make sense of it...

R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

Attachment: pgpX6jAuUhmyD.pgp
Description: PGP signature

Reply via email to