While doing a fresh ubuntu install (dual boot with XP using resize), I somehow managed to install grub to the source usb instead of to the harddrive. Normal harddrive boot goes straight to XP. Booting from USB leads me to grub. From there i can boot into ubuntu. Pretty cool actually, but not what I had in mind.

How do I install Grub to HD?

How do I recover my USB?

  • for GUI based approch see this askubuntu.com/q/129254/35775 – Web-E Jun 19 '12 at 14:58
  • was unable to mount usb when grub from stick was used. after grub restored on hd it was possible to access my data again. plugging into another computer the live ubuntu on stick also usable... accepting answer – Detnuomnu Jun 20 '12 at 10:08

From your booted Ubuntu system, open a terminal, then use the following commands :

sudo grub-install /dev/sdX
sudo update-grub

Replacing sdX with the actual drive, which will probably be sda, but use disk utility to double check if you are unsure.

|improve this answer|||||
  • 1
    This got me booting normally again. Ideas on the USB stick? – Detnuomnu Jun 19 '12 at 19:40

You can wipe your USB stick by Format. Plug it into your Windows machine, go to My Computer, and then right click your USB stick and select "Format".

If you don't like formatting, you can try deleting the partition on the USB with GParted and recreate the partition. But remember to backup.

To reinstall GRUB:

  1. Make a new Ubuntu Live CD and Boot from it.

  2. Install boot-repair using these commands:

    sudo add-apt-repository ppa:yannubuntu/boot-repair

    sudo apt-get update

    sudo apt-get install -y boot-repair


enter image description here

Click "Recommended repair". This will reinstall GRUB in the MBR of the adequate disk(s). Then reboot.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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