Recover/Reinstall grub bootloader

To recover the boot loader for Ubuntu Linux or any other linux after the boot loader has been erased due to a dual windows installation or some other reason.
We need a bootable CD or USB to boot into a Linux shell.
Once looged in a Linux shell on the same machine, these steps are to be followed.
1. mount the / (root) partition of the Linux installation for which the grub boot loader has to be resintalled.
2. chroot into the Linux environment
3. run grub-installation

Read more