1

I erased a Windows XP partition and installed Windows 7 on it. I have no grub screen now and the computer boots straight to Windows. What can I do to reinstall grub?

EDIT: I tried this

sudo grub-install
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --modules=MODULES       pre-load specified modules MODULES
  --boot-directory=DIR    install GRUB images under the directory DIR/grub
                          instead of the /boot/grub directory
  --grub-setup=FILE       use FILE as grub-setup
  --grub-mkimage=FILE     use FILE as grub-mkimage
  --grub-mkrelpath=FILE   use FILE as grub-mkrelpath
  --grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
  --grub-probe=FILE       use FILE as grub-probe
  --no-floppy             do not probe any floppy drive
  --allow-floppy          Make the drive also bootable as floppy 
                          (default for fdX devices). May break on some BIOSes.
  --recheck               probe a device map even if it already exists
  --force                 install even if problems are detected
  --disk-module=MODULE    disk module to use

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into /boot/grub, and uses grub-setup
to install grub into the boot sector.

Report bugs to <[email protected]>.
ubuntu@ubuntu:~$ sudo grub-install /boot/grub
/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).

sudo grub-install /boot/grub didn't work, what to do then?

2 Answers 2

2

When you reinstalled Windows it overwrote the MBR. To fix this, boot into a live session of Ubuntu (or any Linux Distribution that uses GRUB), open a command line and run the command sudo grub-install /dev/sda. That will reinstall grub and you will be able to choose between Windows 7 and Ubuntu 12.04 to boot from.

2
  • didn't work, please read the edit to help me figure why Dec 24, 2012 at 20:30
  • Sorry, I forgot to add that you need to specify the drive you want to install do. Check my edit to the command.
    – kelvinafox
    Dec 25, 2012 at 0:41
1

When I reinstalled my Windows OS, I ran into the same issue. I decided to fix it by using Window's boot manager instead of GRUB, so if you really want GRUB this won't help you, but:

Boot into Windows (obviously, you don't have any other choice) and download EasyBCD. Watch this video tutorial that will explain how to use EasyBCD to configure the Windows Boot Manager. In this process, you will add an entry for Windows and an entry for Ubuntu, so when you start your computer you will be prompted to chose one (or boot into Windows by default - you can change all that too). The caveat is that the Ubuntu entry will take you into GRUB, where you will be again prompted to chose an OS. That will allow you to get into Ubuntu, but to avoid the extra boot menu, you may want to change the GRUB timeout to 0 or .1 seconds. Here's a tutorial on the timeout change.

Good luck!

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .