Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to reinstall the Windows MBR. My first hard drive is as follows:

(hd0,0): fedora 15/ext4
(hd0,1): windows 7 x64

I have GRUB installed on it right now, which allows me to boot Fedora just fine. However I'd like to reinstall the Windows MBR so I can boot Windows sometime in the future. I've booted from the install CD, selected Command Prompt and tried a few things like:

bootrec /fixmbr
bootrec /nt60 all /mbr
fdisk # command not found
fixmbr # command not found

What should I do to fix this? I can burn Fedora/Ubuntu/Windows recovery discs as needed, but would like to fix this eventually.

share|improve this question
You can setup GRUB to recognize and boot from Windows partition. Windows won't support Linux installations. – Xaqron Jun 14 '11 at 0:47
I know, but I thought you needed to install windows' mbr, then grub so it can point at windows' mbr – 123980809312 Jun 14 '11 at 0:48
up vote 0 down vote accepted

If your ultimate goal is truly to reinstall the Windows MBR, using a WinPE cd, and running fdisk /mbr should do the trick. However, if your real goal is to be able to dual boot, then add the chainload information into your grub config. You don't need to re-install the Windows MBR to get grub to chainload.

As a case in point, when I build a dual boot system, I install windows first on what ends up being /dev/sda1. Then I install Linux on the rest of the drive (generally with /boot on /dev/sda2). As soon as grub installs during the linux install process, then the windows partition becomes unavailable. I finish by configuring the chain load in grub, and everything is golden.

To setup the chainloader, according to what you have in your question, you would need to add a section like this to your grub.conf (or menu.lst) in /boot:

title Windows
rootnoverify (hd0,1)
chainloader +1

This should work in grub. If you are using grub2, it would be different.

share|improve this answer
how can I get a windows pe disc? The only one I found on ms' site was 900mb and requested I put in a key to be able to download it – 123980809312 Jun 15 '11 at 0:52
There are lots of things out there that are alternatives.… is one example. BartPE is another example. – Kirk Jun 15 '11 at 1:00
I don't have a windows install that I can boot to. Is there some iso I could use? – 123980809312 Jun 15 '11 at 1:16
Another option might be to download a freedos CD or Thumbdrive image, and boot do that, since all you really need is fdisk. – Kirk Jun 15 '11 at 2:41
got that, but fdisk /mbr 1 (it's the first partition) leaves my computer unbootable, what should I do? am I running the command wrong? – 123980809312 Jun 16 '11 at 1:28

A solution would be using TestDisk to write a "Windows-like" MBR code.

Note that you can use grub to boot your Windows, using chainloader.

share|improve this answer
that seems like it should work. however when I select the correct disk running testdisk for fedora 15 as root (/dev/sdb) and say 'write new mbr code' I still can't boot to it – 123980809312 Jun 15 '11 at 0:55
Has the windows partition the active flag set? – Turbo J Jun 25 '11 at 10:48

Start your computer with the Windows CD and choose repair. This will fix your Windows MBR and you will lose your Fedora GRUB. To fix that just follow these instructions:

share|improve this answer
I did that, it said it couldn't find any problems and suggested I 'send a report' to microsoft – 123980809312 Jun 14 '11 at 1:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .