Accidently installed grub to usb

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.