Warning: By using the “sudo” commant, especially form a live CD you can seriously harm your system. Make sure that you read and understand all the instructions before executing any commands. Also, be sure that when you want to paste into the terminal use Ctrl+Shift+V and NOT Ctrl+V.
Start by mounting the partition on which your Ubuntu installation is. In case you’re not sure, lauch Gparted(this is included in live CD also). Replace the XY with your drive letter and ofcourse your partition number
sudo mount /dev/sdXY /mnt
Now proceed by binding the directories that grub needs access to, so to detect the other Operating systems.
sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys
Now we’re going to use chroot
sudo chroot /mnt
Now install and update Grub. This tie you need only to add the drive letter, which is usually a, to replace the “X”.
grub-install --recheck /dev/sdX
Now grub is back, the only thing that left to do is to exit the chrooted system and then unmount everything.
exit && sudo umount /mnt/sys && sudo umount /mnt/proc && sudo umount /mnt/dev/pts && sudo umount /mnt/dev && sudo umount /mnt
Now restart your computer, and everything should work fine.