How to Repair Linux Boot Loader after Windows Installation

Gone are those days where dual booting required required understanding of chain loaders. even today XOSL worth mentioning. it got lots of features – i would say most feature rich boot loader i ever seen. nowadays GRUB2 is decent enough to dual boot Linux and windows and very intuitive enough for a layman.

Oh Windows Overwrites MBR and Linux is gone!

Windows versions i ever used, never given respect to other operating system residing in the hard disk. so much selfish. it requires first primary partition itself. and overwrites MBR without any warning.

How to partition then?

With deserved contempt, better to give the first partition for Windows,  let it call “C” drive :). (many boot loaders allow us to hide partitions and trick windows). so let it be like 20GB. Next partition can be given to Linux. it hardly require 10GB space. remaining space can be common area.

I have a new disk, how to partition it properly.

Both windows and Linux comes with required partitioning tools. But Linux live CD or Live USB can give you full fledged working environment and partitioning tools with good GUI. So better to boot the system using Live CD / USB and start installation. Since partitioning must be the first steps to install OS, you can do proceed the installation until the disks are partitioned and then abort the installation if required by pressing the reset button on the machine.

Order Matters

Since windows overwrites MBR during the installation. its better to install windows first. if you are installing linux after that, most of the linux distributions are cable of detecting the other OS es and configure in the boot menu. so dual boot will be taken care automatically.

But I want to keep reinstalling windows often.

many times we may have to keep reinstalling windows after certain period because of problems like virus, deteriorating performance etc and MBR will be gone and again need to install linux also!. wait!… there is quick fix

Use a Live CD or Live USB again and boot using that. Then access all drives in your file manager (it servers 2 purpose, it mounts all those partitions and you can verify the actual content of the partition). issue following command and make sure that linux partition is listing.

df -h

Please make a note of the current mount point of the partition where linux was originally installed. Let it be /media/disk. and suppose MBR is at /dev/sda (your main hard disk which is the boot item int he BIOS)

Now take the command prompt and get into root user. and invoke grup-install

$>su

$>grub-install –root-partition=/media/disk  /dev/sda

or you can run it though sudo

$>sudo grub-install –root-partition=/media/disk  /dev/sda

thats it!. its done. new GRUB installation information will be written to MBR and your system will be dual bootable.

Aly Chiman

Aly Chiman is a Blogger & Reporter at AlyChiTech.com which covers a wide variety of topics from local news from digital world fashion and beauty . AlyChiTech covers the top notch content from the around the world covering a wide variety of topics. Aly is currently studying BS Mass Communication at University.