Tips & How-To's

[How To] Fix MBR after installing/uninstalling Windows/Linux in a dual boot

Many, who do a dual boot with any Linux and Windows will face the problem of Master Boot Record (MBR). In easier words, one of them (Windows or Linux) wont boot after installing/uninstalling the other. This is a small guide I hope many would find it useful.


For Windows XP: Boot the installation CD and select repair. Enter your windows installation drive number (shown there) and enter Administrative Password. Now run these two commands there one after the other  — “fixmbr” and “fixboot”. Optionally some people also run “bootcfg /rebuild”. You’re Done.

For Windows Vista: Boot from the installation CD/DVD and enter “Repair Windows” link at the left hand bottom of the dialog. Then go to command prompt . There run “bootrec /fixmbr” and “bootrec /fixboot” commands one after the other. That does it.


1.Boot from a LiveCD and open the terminal..

2.There enter sudo grub to enter GRUB prompt.

3.Type find /boot/grub/stage1 to find out your Linux partition.

4.Then use the device name that was output in the next command, say (hd0,1). Then the command would be root (hd0,1).

5. After this, say setup (hd0). Replace hd0 with your hard drive.

Now your GRUB should be installed fine. However, your windows’ boot entry may not be in GRUB. You may choose to restore it while still being in your LiveCD or after booting into your hard-drive installed Linux.

To restore it:

1. Open /boot/grub/menu.lst of your Linux partition, in a text editor and get to the bottom where all the list of options to boot are found.

2. Add the following lines with your Windows name in the title and replace (hd0,0) with your own hard drive and partition:

title   Windows 95/98/NT/2000
root   (hd0,0)

3. Save and reboot.



After installing Windows XP after Windows Vista and after restoring Vista’s bootloader one may find that xp or older windows’ options will not be there. For this please make use of a software called EasyBCD. The installation and operation are self-explainatory. Just click on Add/Remove Entries and add your OS entry. You may also add your linux and mac entries to it. Also there is an option for having a common bootloader using NeoGrub.


  1. Hey Sathya,

    Nice post. Learnt the Unix side of the equation.

    For restoring Windows MBR, I generally dont use fixmbr as I havent yet found it on any of the OEM CD’s that I’ve used ;-).

    Instead, I use a tool called MBRFIX. However, there is a catch, you must be able to boot into the windows partition. And this guy is pretty brute-force in the way it works… :)

    Check it out here:

  2. Hey Cruise! Bharath’s the author of this post, so credits to him. The catch seems more like Catch-22 as if you are likely to Fix MBR, then your Windows partition isn’t booting, and to use this utility, your Windows must be booting ;-)
    Thanks for the comment!

  3. @ Reeteshinator

    Your linux partition = the partition where u installed ur linux and wanna restore it

    and s u shud mount it else how else can u access /boot/etcetc ????

  4. Hmm.. ok, it seems the second step is not required itself.. installing the Grub automatically detects all other installations and adds them.

    i.e a simple grub re-install and restart is more than enough to get the windows things in the list too :D

    1. I think the second step is required……….
      GRUB install doesnt identify and add other installations…….
      it may detect during linux install but not this way………..

  5. hey awesome trick to repair mbr,also i have a problem i am not able to use my inbuilt bluetooth device in linux becoz i donn’t know how to activate it.i have installed gnome* package it shows bluetooth icon bt by clicking there is nothing response…also how to connect internet using bluetooth in linux help me

  6. Pingback: unostar

Leave a Reply to manish Cancel reply

Your email address will not be published. Required fields are marked *