Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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

share|improve this question
    
what crashes grub –  Naruto Nov 26 '11 at 23:57
    
I don't know. Sorry –  Eekfonky Nov 27 '11 at 0:24
add comment

marked as duplicate by Eliah Kagan, Eric Carvalho, raaz, hhlp, txwikinger Mar 13 '13 at 14:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers

Try this to recover grub:

  1. Open the live version of Ubuntu (either brun the LiveCD or install the image to a bootable USB device using Startup Disk Creator)
  2. Open terminal and run sudo fdisk -l to see where Linux is installed on
  3. Run sudo mount /dev/sdxY /mnt where x is altter and Y a number you have found in the previous step
  4. Run sudo grub-install --root-directory=/mnt /dev/sdx to install grub
  5. Run sudo update-grub to update grub
  6. Reboot
share|improve this answer
    
Tried that and it doesn't work. I get it reboot. Then it pops up with 'BASH...ETC.' and a 'grub>' –  Eekfonky Nov 27 '11 at 0:13
    
Sorry. On my mobile as computer is down. Will try to be as specific as possible. I have a photo I took of the screen. Shall i Upload it somewhere? –  Eekfonky Nov 27 '11 at 0:18
    
@Eekfonky If you have a screenshot, you can upload it to an image-sharing site of your choice (such as imgur, which we use as the default uploader here), and edit the link to your picture back into your question. One of us can then properly edit the screenshot back into the question so it is visible. –  WarriorIng64 Nov 27 '11 at 22:48
    
@Eekfonky Additionally, if you are getting a grub> prompt to appear after a failed reinstall, you may want to take a look at this and see if it helps. –  WarriorIng64 Nov 27 '11 at 22:54
    
A better way might be to boot from LiveCD, chroot intro the broken installation and run grub-install/update-grub from there. –  con-f-use Sep 3 '12 at 21:29
add comment

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 Install usb-creator-gtk ). Once in the Live session you can install Boot-Repair:

sudo add-apt-repository ppa:yannubuntu/boot-repair \
    && sudo apt-get update \
    && udo apt-get install -y boot-repair \
    && boot-repair

Then start Boot-Repair from Dash and click "Recommended Repair" or take a look at the other options.

Use at your own risk. The usual warnings with non-official repositories apply.

share|improve this answer
add comment

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.

share|improve this answer
add comment

I know that i'm replying so late,, but this might help others who come across this thread.. http://ssatish.wordpress.com/2013/01/11/how-to-re-install-grub-2-in-mbr-from-ubuntu-live-disk/

share|improve this answer
2  
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  user25656 Jan 11 '13 at 16:11
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.