WindowsErasesGrub
Introduction
You have just installed Linux, you have played with it a bit. After three reboots on Linux you decide it's time to play again in a Windows game. You boot Windows, every thing is fine and you go to bed because it's too late. Three days later you have to work in a computer exercise that involves Linux, you turn on your computer and either:
- you know what, Grub no longer appears, somehow, Windows boot directly.
or:
- all it says is GRUB loading stage 1.5 and just hangs there.
The default Grub installation has some problems with some Windows security policies or apps like antivirus. In this webpage you will learn how to resetup your grub in non-default way that avoids this problem.
Easy solution
- Boot with Super Grub Disk
- Choose Language & Help
- English Super Grub Disk
- GNU/Linux
- GNU/Linux (Advanced)
- Fix Boot of Linux (GRUB)
- Manually Fix Boot of Linux (GRUB) (!NO stage1_5)
- Select your Linux partition
- Select your first hard disk
- You will see a text flash (less than 0.5 seconds).
- You will return to the Manually Fix Boot of Linux (GRUB) (!NO stage1_5) menu.
- You can go back with <--- options (At the top of the menu).
Classic solution
Find all the files in your system with the pattern: *stage1_5* usually found at /boot/grub and /usr/lib/grub and rename them ( or move them to a backup directory).
After that reinstall grub with grub-install or root and setup commands. Do not reinstall it with apt-remove and apt-get install!
When grub-install doesn't find the *stage1_5* files it will know that you want to link stage1 directly to stage2.
Check this link for details on running grub-install http://orgs.man.ac.uk/documentation/grub/grub_3.html#SEC10
e.g.
For the first sata drive
grub-install /dev/sda
For the first IDE drive
grub-install /dev/hda
Note: you can safely ignore the following error (the exact path may vary the 'stage1_5' is the important part of the path):
cp: cannot stat '/usr/lib/grub/x86_64-pc/*stage1_5' : No such file or directory
Note: I had to run the grub super disk and repair the MBR (twice) before this actually took effect.
Technical explanation
Grub default installation consist on installing what we call stage1 in the MBR. After that after the MBR and before the first partition beginning the stage1_5 is written. This stage1_5 conflicts with some Windows policies that want in this space their own data. You can however bypass this problem by linking stage1 to stage2, which it is not located in this problematic area.