@Robgoss
And some more…
I’ve found that this instruction is the best when you need to recover grub.
And if you have a UEFI bios, see -
When you install Windows, Windows assumes it’s the only OS on the machine–or at least it doesn’t account for Linux. So, it replaces grub with its own boot loader. What you have to do is replace the Windows boot loader with grub. I’ve seen various instructions for replacing grub by mucking around with grub commands or some such, but to me the easiest way is to simply chroot into your install and run grub-install and update-grub. chroot is great because it allows you to work on your actual install, instead of trying to redirect things here and there. It’s really clean.
Sometimes giving GRUB2 the correct configuration for your partitions is not enough, and you must actually install it (or reinstall it) to the Master Boot Record.
Here’s how:
Boot from a live USB.
Determine the partition number of your main (root) partition. GParted can help you here. I’m going to assume in this answer that it’s /dev/sda6, but make sure you use the correct partition number for your system! Look to see which drive grub uses to boot from. Check for a boot flag.
Mount your partition:
sudo mount /dev/sda6 /mnt
make sure that sda whatever is correct!
Bind mount some other necessary stuff:
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
chroot into your Ubuntu install:
sudo chroot /mnt
At this point, you’re in your install, not the live CD, and running as root. Install grub:
grub-install /dev/sda
make sure that this is the correct (bootable) HD! Gparted will label the boot partition.
Update grub:
update-grub
If everything worked without errors, then you’re all set:
exit
At this point, you should be able to reboot normally.