0

Possible Duplicate:
How can I repair grub? (How to get Ubuntu back after installing Windows?)

I recently installed Ubuntu 12.04 LTS alongside Windows 7 using Ubuntu's Startup disk creator and installation completed without any difficulties or errors.

Now when I try to boot, it directly boots with Windows and shows no option to choice as to which Operating System to load. But when I boot using that same pen drive with which I installed Ubuntu, it shows an OS selection screen.

I also tried the command sudo gedit /etc/default/grub & sudo update-grub and I see "Found windows 7(loader) on /dev/sda2" and "Found windows 7(loader) on /dev/sda3" messages while running the later command, but still the same problem persists.

What should I do in order to get the OS selection screen. Please help me.

  • Please see possible duplicates http://askubuntu.com/questions/24479/no-grub-after-installing-ubuntu-beside-windows-7 and http://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows. – Peachy Sep 15 '12 at 14:29
  • I had this happen recently when I was installing Ubuntu from a LiveUSB onto my cousin's desktop and my brother's netbook. It's due to a Ubiquity bug which has since been fixed; the bug would cause GRUB to be installed onto the USB drive instead of onto the target computer, which is why you only see the menu with the drive inserted. – Knowledge Cube Sep 16 '12 at 03:05

2 Answers2

1

It seems that you installed GRUB on the pen drive itself.

Follow these steps:

  • Boot using pendrive.

  • Open a terminal. Run the following commands:

    sudo grub-install /dev/sda
    sudo update-grub
  • Reboot.
green
  • 14,306
1

You could also take a look at the boot repair utility:

Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.

Boot Repair

It is contained in a PPA Ubuntu repository:

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

At the linked website you also can download a live-cd image, which you could then burn to a CD and boot from that, invoke the program from the running live-cd, and let it repair your boot selection (grub configuration).

Izzy
  • 3,570