Fixing Windows MBR from Linux

By Pratik Shivarkar | Labels: , , , ,

First we Install Windows then Linux.
But there are some newbies who just Install Linux with their existing Windows Installation.
Whenever you want to dual boot it is recommended to install those OS on different Hard drives not the Partition.
Reason for this - A hard drive will always have one MBR, Though you can install grub completely on a second/inactive partition.
but you cant make it boot directly or from Microsoft's Initial Program Loader.

Once a user Installs Linux, GRUB replaces the MBR entry for Windows, However GRUB keeps Windows bootable.
But as soon as user deletes the Linux partition, or Re-formats it. Windows becomes un-bootable.

One way to get the Windows MBR back is very common, using the Windows Set-up CD.
All you have to do is put the Windows CD in, Boot the machine.
On the first setup menu press "R" and jump to Recovery Console.
And type in "FIXMBR" (without quotes) confirm and exit.

There is one problem in this method, for some people Windows setup crashes/exits while booting.
That is because Windows can't recognize the Grub MBR. It will need eaither corrupted Windows MRB or blank MBR.

The Easy way to Fix it is, using ms-sys
You can get the ms-sys here --> DEB RPM

Install ms-sys

List the Drives and Locate your Windows Drive.

fdisk -l

Will output something Like this

/dev/sda1 * 1 15666 125837113+ 7 HPFS/NTFS
/dev/sda2 15667 30401 118358887+ 83 Linux

Then fire the ms-sys command on /dev/sda (/dev/sda may change as per your HDD setup)

ms-sys /dev/sda

That will do everything. Remember that this procedure will only work for Windows XP/2000/2003 MBR.

Technorati Tags: , , , , ,

Reblog this post [with Zemanta]

blog comments powered by Disqus


Your Ad Here