Can someone help me out on this? I accidentally installed grub on usb flash drive during ubuntu server installation. Now I cant boot system without drive attached to server.

I want to install grub on hard drive with grub-install but i don't know what to set as location for boot loader?

my fstab looks like this:

file system                 mount point  type
proc                        /proc        proc
/dev/mapper/pdc_jdbeghhjg1  /            ext4
/dev/mapper/pdc_jdbeghhjg5  none         swap

and partition tables for hard drives as this:

Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  1215662079   607830016   83  Linux
/dev/sda2      1215664126  1249998847    17167361    5  Extended
/dev/sda5      1215664128  1249998847    17167360   82  Linux swap / Solaris

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       75672   607830016   83  Linux
/dev/sdb2           75672       77809    17167361    5  Extended
/dev/sdb5           75672       77809    17167360   82  Linux swap / Solaris



You want to place your bootloader in the MBR (master boot record) of both your sda and sdb harddisks (to ensure you can still boot if you lose one of them). You can probably configure grub2 to do this automatically when you run grub-install.

  • I think you meant your "sda and sdb" harddisks... – natacado Dec 31 '10 at 17:30
  • @natacado Yep. The typo monster strikes again... :) – pehrs Jan 1 '11 at 2:47

You need to find the device name for your drives by running sudo fdisk -l.

Then you can do a sudo grub-install /dev/sda (or whatever your device is called).

Should be able to install on both drives without a problem.


If you want to re-run the installer prompt, use dpkg-reconfigure grub-pc. There'll be a list with sda, sdb tickyboxes (and other entries which are not recommended). Ticky them both, then it will install grub to them.

The settings will be saved, so the grub install can be refreshed automatically on package updates (I guess it's arguable whether that's a great idea, but it would make your system consistent with a non-botched install :).

Your Answer

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