Easily Restore a Corrupt NTFS Boot Sector
Permalink » 01/24/2007: Easily Restore a Corrupt NTFS Boot Sector
A friend of mine brought a NTFS (Windows XP) hard drive that had been “erased” by a virus of some kind. I said I’d try to recover the lost data, which was unreadable to Windows.
After wasting some time undeleting a bunch of garbage on some other unimportant partitions, I realized that the main NTFS partition had not been automatically mounted for me - meaning there might be a problem with the partition itself. After manually attempting to mount the partition, I got a message that the boot sector was corrupt. So what to do?
NTFS partitions have a backup of the boot sector located on the last sector of the NTFS partition. There are probably various programs out there that one can pay for to restore this backup copy to its rightful place. There might even be a “Microsoft way” of doing things, which I can only guess requires you to agree to the terms of some EULA and give away any rights you have to your great collection of polka MP3s. Instead, all you need to do is this one line (as root):
mount -t ntfs /dev/sdg1 /media/tmp -o errors=recover
where you need to replace “/dev/sdg1″ with your NTFS partition location (I connected this drive with an external USB carrier) and “/media/tmp” with the location you’d like to mount the fixed partition. That’s all! Once you’ve mounted it, it’s fixed automatically and might even be bootable again (if this is the only problem you have).
This will even work if you accidentally begin to copy data over the beginning of your NTFS partition, since the copy of the boot sector is at the end of the partition. Note: This only works with kernel versions 2.6 and newer. Can’t get a much easier fix than that!














