In this tutorial we will see how to use this GUI tool called boot-repair which fixes most of the common grub related problems.
The most common problem is the overwriting of the GRUB bootloader by the windows bootloader when windows is installed after ubuntu. or overwrite your MBR. And also if your GRUB has broken you won’t be able to access your operating systems.
Make sure you boot from a bootable pendrive/CD to before using this tool.
In order to install this tool first add this repository to your software sources
sudo add-apt-repository ppa:yannubuntu/boot-repair
press enter when asked
and then update sources
sudo apt-get update
finally install it
sudo apt-get install boot-repair
now launch the tool by typing
click on recommended repair
you can click on Advanced options and customize grub as you want