Where to install bootloader for dualboot of Windows/Ubuntu

I'm trying to set up Ubuntu 12.04 alongside my Windows 7 install. I put the iso onto a flash drive, managed to install everything, but when I restart the computer after completing the installation, I have no boot options and Windows loads automatically.

This makes me think that maybe I installed the bootloader in the wrong place and maybe BIOS can't find it.

This is a screenshot of my disk partitions from Windows: Image

Basically, Ubuntu should go to the 360GB slot on Disk 1, but I actually tried installing the bootloader in that partition, as well as in the root of that disk. Neither were recognized during start-up.

I'm hesitant to try to install it over my main boot (disk 0 :core) as this is a NTFS file system versus the ext4 file system that I'm trying to install Ubuntu with.

I've now tried installing the bootloader on /dev/sda (Disk 0) -- where my Windows boot is located. I've checked to make sure BIOS is booting from this disk first, and I still have no boot options to select Windows 7 or Ubuntu. How can I diagnose this problem further?

I'm just looking for the easiest way to get things running without affecting my Windows too much. Any tips/advice?


Solution 1:

You need to install it on the disk selected as primary boot disk in Bios: in your situation, on disk 0. This has no problem (people with only 1 disk has no other option).

If you prefer not modifying your current disk 0, you can install the bootloader on disk 1 and select disk 1 to boot from BIOS. You can after that (if the installer didn't do it already) update grub to find your windows installation and boot it from there too using the grub menu.

EDIT: How to reinstall grub2 from Live CD (or USB) obs: I think better re-installing grub as you already installed it many times I suppose and this way we are sure it is installed in the right place.

  • boot with the live USB
  • check the name of your main ubuntu system partition with sudo fdisk -l (will be /dev/sdb1 or 2 probably in your case)
  • mount it: sudo mount /dev/sdXY /mnt (obs: sdXY is what you found on previous step)
  • Reinstall grub2 with: sudo grub-install --root-directory=/mnt /dev/sdX (obs: do not include partition number in /dev/sdX, not sdXY, it is better not to install on a partition) - This should be /dev/sdb for disk1 and /dev/sda for disk 0 and it has to be the disk used by BIOS as primary boot.
  • unmount the partition: sudo umount /mnt
  • reboot (select in BIOS the disk you used to install grub as primary boot disk)

If you don't see grub menu at boot, try pressing and holding SHIFT key during boot and the menu should be displayed.

If you don't have windows option in menu, after booting in Ubuntu use sudo update-grub and reboot.

More complete documentation on grub and Ubuntu can be found at: Ubuntu Documentation - Grub2 install

Solution 2:

Try installing the boot loader to Disk 1, or it should be /dev/sdb in Ubuntu. On boot you must enter the bios (common keys to do this are Delete, F11 or F12) and choose which disk to boot from. I do this myself with Win7 and Ubuntu installed.

Solution 3:

If your grub loader is messed up, or you can't boot to ubuntu you can chose to repair Grub 2 or use "EasyBCD" under windows 7 and configure it to load Grub 2, this is better if you plan to ditch ubuntu later on:

  1. Repairing Grub:

    • Boot to ubuntu using live usb or live cd.
    • Launch FireFox and search for "ubuntu boot-repair". Direct link to ubuntu boot-repair: https://help.ubuntu.com/community/Boot-Repair.
    • Follow boot-repair instructions.
  2. EasyBCD under Windows:

    • Download the non commercial edition of "EasyBCD" from: http://neosmart.net/EasyBCD/
    • Install it.
    • Once inside EasyBCD on the left panel click on "Add New Entry".
    • On the right panel click on "Linux" tab.
    • Change type to "Grub 2".
    • Click on "Add Entry".
    • On the left panel click on "BCD Deployment".
    • On the right panel select "Install the Windows Vista/7 Bootloader to the MBR" and then click on "Write MBR".
    • Reboot, now you can choose between "windows 7" and "NeoSmart Linux".