Accidently installed grub to usb

8,947

Solution 1

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.

Solution 2

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

    boot-repair

enter image description here

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

Share:
8,947

Related videos on Youtube

Detnuomnu
Author by

Detnuomnu

Can't stop messing up my installs........ ;)

Updated on September 18, 2022

Comments

  • Detnuomnu
    Detnuomnu over 1 year

    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?

    • Web-E
      Web-E almost 12 years
      for GUI based approch see this askubuntu.com/q/129254/35775
    • Detnuomnu
      Detnuomnu almost 12 years
      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
    Detnuomnu almost 12 years
    This got me booting normally again. Ideas on the USB stick?