Roger Whittaker

View Roger Whittaker's profile on LinkedIn

Valid XHTML 1.0 Transitional

NTFS corrupt partition

Monday 20th December 2004

A Windows story...

Someone (they know who they are) asked me to add a hard disk and a Linux installation on it to their home computer. This turned into an interesting saga.

The computer was a nice Athlon 64 machine from Evesham. It had a single SATA disk and was running Microsoft Windows XP Home with Service pack 2. Windows was booting OK, but running very slowly and there had been a number of problems. So anyway, I bought a second SATA disk and cable and installed SUSE 9.2 64-bit on the second disk.

At the start of the installation in the partition setup I chose to mount the Windows partition (/dev/sda1) on /windows/c/ as is normal for a dual boot setup. The SUSE installer said that it couldn't mount /dev/sda1. At this point I should have got worried (not that anything I might have done would have changed anything), but carried on, knowing that nothing I was doing was destructive to that partition.

When I finished the installation I did grub-install /dev/sda, having added the necessary lines to the grub menu to boot Windows.

Then the problems began: Windows wouldn't boot. At first I thought that this was just an error in the grub configuration, but it was worse than that: I couldn't mount the Windows partition (NTFS) from the new Linux installation. Nor could I mount it if I booted the system from Knoppix.

This looked bad - it looked like one of those "a man with a beard installed Linux on my computer and now Windows won't boot" stories. But I knew that nothing I had done had affected the Windows partition - I had only changed the MBR of the first disk. (Later I restored the MBR from grub's backup and nothing changed).

I tried to create an XP boot floppy, but it wouldn't boot the system (because it didn't know about SATA disks). I then created a new XP installation on a spare partition on the second disk. (This was a challenge because at first we couldn't find the drivers for the SATA controller "press F6 ..."). Once this new installation was there, the NTFS partition on the first disk showed up as F: but with size 0, and "this disk is not formatted: would you like to format it now?".

I tried a couple of utilities that claimed to be able to boot the system from floppy and read a damaged NTFS partition, but they showed nothing, or nonsense (and they probably didn't know about SATA either).

Then I discovered FindNTFS. By running samba on another machine and mapping the share to a drive on my new XP installation, I was able to run this on the share and recover most if not all of the data from the disk across the network.

Then I discovered TestDisk. I downloaded the Linux version of this: it was able to test the partition, discover that the partition's boot record and its back-up boot record were not consistent, and replace the boot record with the back-up. At this point the partition became mountable, both from Linux and from Windows. But it still wouldn't boot. To make that happen I also had to go through the Windows XP installation as far the point where it gives you the opportunity to run a recovery console (press R): then the fixboot command did the trick.

I still don't know what kind of hard luck it was that the NTFS partition decided to die just at the point that I was about to install Linux, but there you go.