Having tried all day to reinstall grub and trawling the internet I have had no luck. I can no longer boot into ubuntu and have tried boot disk frin yannubuntu but the grub tabs are greyed out. Other methods will not install it on sda1. I have no other os to boot into but have a live usb. Please help
3 Answers
Try this to recover grub:
- Open the live version of Ubuntu (either burn the LiveCD or install the image to a bootable USB device using Startup Disk Creator);
- Open terminal and run
sudo fdisk -l
to see where Linux is installed on; - Run
sudo mount /dev/sdxY /mnt
where x is altter and Y a number you have found in the previous step; - Run
sudo grub-install --root-directory=/mnt /dev/sdx
to install grub; - Run
sudo update-grub
to update grub; - Run
sudo shutdown -r now
to reboot.

- 155
- 1
- 12

- 4,991
GUI way
In addtion to the other answers, a way with graphical user interface would be to boot from LiveCD or a bootable USB device (putting the live .iso on there with Startup Disk Creator ).
Once in the Live session you can install Boot-Repair:
sudo add-apt-repository ppa:yannubuntu/boot-repair \
&& sudo apt-get update \
&& sudo apt-get install -y boot-repair \
&& boot-repair
Then start Boot-Repair from Dash and click "Recommended Repair" to start the repair or take a look at the other options.
Use at your own risk. The usual warnings with non-official repositories apply.
Not sure if this question is still relevant (it seems it's pretty recent).
I ended up here having had the same issue (managed to deleted grub by wiping a harddrive).
I found the following link to be supremely useful:
http://ubuntuforums.org/showthread.php?t=1195275
Looks for section 13 "Reinstalling GRUB 2 from LiveCD".
In my particular case, I had W2K installed on my primary (boot) harddive, and installed ubuntu on a second harddrive later. As a result, grub was installed on the same drive that W2K was on - and allowed me to dual boot between the two.
I decided today that I could get rid of the W2K installation and use the disk space for something else. I stupidly erased the entire drive, including the bootloader...
I physically moved the disks around to ensure that the drive wth the ubuntu installation was the "primary" and used the steps at the link above to re-install grub... Bob's your uncle, I'm back in business.
Hope this helps someone.

- 1
grub>
prompt to appear after a failed reinstall, you may want to take a look at this and see if it helps. – Knowledge Cube Nov 27 '11 at 22:54chroot
intro the broken installation and run grub-install/update-grub from there. – con-f-use Sep 03 '12 at 21:29