Ubuntu Server installed from USB puts GRUB on the USB drive instead of the hard disk

You can manually install GRUB onto a device if it was installed to the wrong place by issuing

sudo grub-install /dev/sdX

after booting and logging into your Ubuntu installation if that is even possible (as it seems from your question).

However if it's not possible to boot the OS you can use "Rescue a broken system" at the USB drive's startup menu to install GRUB. Just follow the instructions to set up keyboard and timezone and then mount your root partition. Then when asked choose to Execute a shell in /dev/sdXY. If you have created a separate partition which shall be mounted at /boot you have to mount it manually using that shell (else the installation of GRUB won't work as expected because it will not find your kernel image):

mount /boot

And then install GRUB using:

grub-install /dev/sdX

Then exit the shell (Ctrl+D) and choose reboot from the menu. Now everything should work as expected.

side note:
The Ubuntu Desktop Edition provides an advanced configuration option (which lets you set where GRUB is installed to) right before installing the OS. But I couldn't find an equivalent option in the Server Edition's installation process and it seems to always install GRUB to the first disk device. Or maybe I also just overlooked it.


Simplest way to do this on ubuntu server installer (works at least on 14.04)

  • At question "Do you want to install GRUB on master record", answer NO
  • you will be prompted where to install GRUB instead, type "/dev/sdb"

Had the same problem. Found a simple solution for Ubuntu Server 10.04 installation from USB pen.

  1. Start the installation from USB pen boot
  2. Select (country).archive.ubuntu.com
  3. After setting Clock remove USB pen
  4. Continue installation without USB
  5. GRUB gets installed automatically on the right disk