How To Really Mess Up a Hard Drive (Then Fix It)

Posted by Max Dunn Fri, 07 Jul 2006 18:05:00 GMT

Yesterday, I almost lost everything on my hard disk – very scary. I was playing around with Ubuntu 6.06 and it ran well from the CD, so I let it install itself to the hard disk. I knew that it was going to partition the disk and add a boot loader, but I figured that the worse thing that could happen was that I would have a boot menu and be able to select to boot from Windows each time. Wrong. I almost lost all my data, but in the end, was able to restore the original partition information. Here is my tale and how I recovered.

The Long Story

It wasn’t really Ubuntu’s fault that it didn’t work. I have a Averatec 3260 laptop which is a little screwy. For instance, it turns off the wireless when coming out of hibernation, which is a real pain. Also, the hard disk keeps slipping back into PIO mode, which makes it really slow and requires that I frequently need to delete the Primary IDE driver and reboot twice. Lastly, the SD Card reader also uses PIO mode, which means when I am transferring large files to or from it, the mouse gets really jerky. But the laptop is very lightweight, just about 3 lbs, and it was cheap, under $900 from Staples, which is about half the price of a similar laptop from Dell.

Well after installing Ubuntu to the hard disk, I rebooted and Grub reported Error 18. No problem, I thought, and Googled this and found that it could usually be fixed by specifying the hard drive in the BIOS rather than letting it auto-detect. So I pressed Del while booting up to get to the BIOS setup and started looking around the BIOS setup menus. Hmm, nothing about setting the hard drive. As a matter of fact, there were almost no advanced settings in the BIOS at all. Ok, no problem, I will just boot back to Windows and see about updating the BIOS.

Only, there was no way to boot back to Windows. I started up Ubuntu from the CD again and went back into the GParted partitioning software and saw that the extended partition was marked as bootable, but there was no way to mark another partition as bootable.

Hmm. Googling around, I saw that you can fix the Master Boot Record (MBR) by booting up a Windows CD, selected “r” for the Recovery Console and running “fixmbr”. When I did this, fixmbf gave a warning message about a non-standard boot sector and how it might corrupt the partition and yada yada yada, but I ignored it because I figured it was just upset at seeing a non-Windows boot sector. Boy, was I wrong!

Now when I booted, I got a “data read error” message. Uh, oh, that doesn’t look good. I had heard about the possibility of corrupting the MBR and losing everything on the hard disk, but I didn’t think it could happen to me. But now I started to seriously consider the possibility of having to reinstall Windows, recover as much of my data from my backups as I could, and then reinstall all the software. However, even though I am good at doing backups, I know that I don’t backup everything (like music and pictures) and would also lose some of the recent programming work I had been doing. Not good. Calming myself down, I thought it would be better to spend some time trying to fix the partition corruption rather than installing from scratch.

Okay, I should be able to use my Norton Partition Magic 8.0 to fix this right? So I booted it up from the CD but all it could report that it couldn’t find any valid partitions. Gulp. Nowhere in the menus was there anything about fixing a bad partition.

Next I tried using Partition Table Doctor 3.0. It found a problem with the partition table and fixed it. Or at least it thought so. Upon reboot, I now got a “NTLDR is missing” message. Was this progress?

Booting back to the Recovery Console, it now asked me to login to “C:\Windows”, which seemed a good sign. But nothing I then did in the Recovery Console fixed the error.

Next, I tried running Paragon Partition Manager 7.0 (PPM) from a CD. I first booted this into its Linux mode and did all the repair options, but still nothing. Finally out of desperation, I booted it into its DOS mode, and then ran its Repair option. (Unfortunately, I don’t remember the exact command names, so these are guesses). Now, unlike when booting PPM in Linux mode, it found the Windows partition. There was no drive letter attached to this partition, so I deleted the C: letter from the weird partition it was attached to, and then attached it to the first partition and let PPM update the registry.

Finally, I was able to boot into Windows. Hurrah! The whole repair process took about 3 hours, and much of this was due to waiting for the computer to boot each time, and also because I tried quite a few other things I didn’t mention above. However, I know from experience that re-installing Windows would have taken a day, and I would have lost quite a lot of files.

Here is a summary of what I did.

The Short Story

How To Really Mess UP a Hard Disk

  1. Install Ubuntu onto a laptop with an old BIOS. => Get “Grub Error 18” upon booting.
  2. Boot the Windows Recovery Console and run “fixmbr” and “fixboot”. =>Get “data read error” on boot.

How To Fix a Messed Up Hard Disk

  1. Run Partition Table Doctor and let it fix the MBR. => Get “NTLDR is missing” message.
  2. Run Paragon Partition Manager in DOS mode, select the Repair option, then assign it a drive letter. => Boot into Windows, Yea!

Moral

So the moral of this story is that if you screw up your partition table or MBR, if you keep working at it, you might be able to get it back.

Since I wrote all this down from memory, I am sure I didn’t recall everything correctly. If anyone has corrections to make to this, please let me know – because who knows when I might mess up my hard disk again!

Posted in  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment