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!
Have some one tried this?
Well, obviously I have tried it (and it worked exactly as advertised). If you’re having serious problems with your drive and you want to try this, you’ve probably already made a backup image of the partitions (using dd for example), so you can’t hurt much.
I did this without making any backup, since the only change it makes to the partition is to try to copy the backup boot sector over the corrupt one. If you have a corrupt boot sector anyway, what do you have to lose?
I tested it and worked like a charm.
I have configured my PC to boot both Windows and Linux and broke the windows XP partition, when I changed the grub settings and reinstalled them, by mistake, on “/dev/sda1″ instead of “/dev/sda”. The result was that I was not longer able to boot windows.
This command fixed the windows partition’s boot sector.
Thanks!
page Digged, Thankx from LigaMusic.com
[…] There are Two Copies… Filed under: Uncategorized — Mr. Mike @ 7:45 am … of the NTFS boot record. One at the beginning of the NTFS volume, one at the end. http://www.heavygravity.com/2007/01/24/easily-restore-a-corrupt-ntfs-boot-sector/ “Could not find a valid backup boot sector” […]
shop for Tramadol
If you want to shop for tramadol you must check this website