Fastest way to restore Windows 7's original MBR?

4

2

I have removed GRUB's partition, and I wanted to restore the original Windows boot part. WinToFlash failed again to make my pendrive bootable, thus I'm in a bit of a trouble now.

I looked all around, but I couldn't find any easy way to do this.
What is the easiest and fastest way to restore the MBR?

(I've got no Windows 7 DVD with me right now. And fetching the DVD is not really fast with a slower connection.)

Apache

Posted 2012-03-24T18:02:43.197

Reputation: 14 755

1Why not just burn one from your computer? Start -> 'Create a system repair disk' – cutrightjm – 2012-03-24T18:35:32.360

isn't there any OSs that could boot ? – hamed – 2012-03-24T19:20:48.047

You can make the system repair disk as suggested by ekaj on any W7 PC as long as the bit version matches, 32 or 64. – Moab – 2012-03-25T02:44:04.100

Note that you don't need the Windows 7 MBR in particular. Any DOS or Windows compatible MBR will do. There's bound to be a Linux tool that will write a DOS-compatible MBR; perhaps http://linux.die.net/man/1/ms-sys ?

– Harry Johnston – 2012-03-25T05:33:00.607

Answers

2

Make a System Repair Disc on another W7 PC, it needs to be the same bit version as the one you are repairing, 32 or 64bit Windows 7.

Once you have the System Repair Disc,

Insert the Windows 7 installation or System Repair DVD and boot from your DVD drive. You may have to change the boot order through system BIOS to boot from your DVD.

Choose your default "Language," "Time" and "Keyboard Input" on the first window and click "Next."

Click on the "Repair Your Computer" option to gain access to the System Recovery window. Now choose "Command Prompt" to run the Bootsect.exe utility. Bootsect is located inside the boot folder so change your directory to boot. Now run bootsect /nt60 C:\ if you had Windows 7 initially installed in the C partition. Alternatively, you can run bootsect /nt60 SYS or bootsect /nt60 ALL to repair the system partition or all partitions. Eject the DVD and restart your computer. Your computer should now boot Windows 7 again.

Source

Secondary Source

Completion:
As stated in the comments below, one has also to use the /mbr option in order to fix MBR, which is necessary to remove GRUB from MBR.

Moab

Posted 2012-03-24T18:02:43.197

Reputation: 54 203

According to the MS documentation, you must use the /mbr flag to update the MBR. Otherwise, the partition boot record (not the master boot record) is written. – Harry Johnston – 2012-03-25T03:02:50.370

They are trying to install the MBR not repair or update it. "/NT60 Applies the master-boot code that is compatible with BOOTMGR "....http://msdn.microsoft.com/en-us/library/ff794683(v=winembedded.60).aspx

– Moab – 2012-03-25T04:00:27.793

I was looking at http://technet.microsoft.com/en-us/library/dd744577%28v=WS.10%29.aspx

– Harry Johnston – 2012-03-25T05:10:02.567

It isn't really clear whether bootsect updates both the MBR and the partition boot sector by default. I'll try it out next time I get a chance. (Note, however, that in the context of the MBR, "install", "update", and "repair" all mean the same thing!) – Harry Johnston – 2012-03-25T05:12:38.040

Microsoft documentation sucks doesn't it. – Moab – 2012-03-25T19:14:20.607

OK, I've tried it. For the record, bootsect does not write the MBR unless you specify the /mbr flag. The version I tested was dated November 2010, and came from the Windows 7 version of WinPE. – Harry Johnston – 2012-03-26T01:52:23.893

@HarryJohnston thanks, good to know. So what the hell does write master "bootcode" mean then? – Moab – 2012-03-26T20:33:45.627

They're talking about the boot code on the individual partitions. IIRC, the first track of each partition contains either code to load NTLDR or code to load BOOTMGR, depending on the Windows version. I guess they call this the "master boot code" to distinguish it from the boot code in NTLDR/BOOTMGR. – Harry Johnston – 2012-03-26T22:10:25.227