Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
for GUI based approch see this – 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
up vote 5 down vote accepted

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.

share|improve this answer
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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