Friday, December 02, 2005

SMART monitoring tools

This week I had to fix a problem with a hard disk that wouldn't have its partition mounted. Actually, Linux would hang the mount command (the system call mount(), actually) and Windows would give me an error message telling that the hard disk is inaccessible.

After running some tools (testdisk and gpart), I found that the hard disk was acessible running dd and copying some sectors. Then I plugged it in my desktop, which had SMART monitoring tools and when I logged into KDE, I had an email telling me about a bad block in the disk. It was amazing. I learned how to use smartctl and other tools to run self-tests in the hard disk, but still didn't solve (I couldn't relocate the block as mentioned in the BadBlockHowto).

In the end, I ran Maxtor software that checked the full surface and fixed the bad block. Even then, I still wanted to try to access the partition. I checked the partition table with diskprobe (from Microsoft System Tools) and saw that the partition table was corrupted. I based that on the NTFS boot block information, what you are also able to see with this tool. Fixing the partition table size made me access the partition, but for some reason, windows tried to fix the filesystem and blew up all my files.

In order to try to recover some files, I ran PhotoRec, that was amazing at recovering most of the needed files. Finally, I ran a low level formatting and now the disk is back working.

I suggest that, if you run Microsoft Windows systems, you install SMART monitoring tools to warn you if something happens with your hard drive, before it is too late.
Post a Comment