Configure Dual Boot, Windows 7 and Ubuntu 12.04 with or without EFI

37,469

Solution 1

Your partition layout looks odd, but then again this is how manufacturers do their OEM installations.

If this is a UEFI system, then reinstalling would be the quickest and straight forward way for getting a working installation. I recommend removing partitions sda5 through sda7, as they seem to be created by you. Then install Ubuntu from ubuntu-12.04-desktop-amd64.iso in UEFI mode (when selecting to boot from CD at boot time there should be two options for booting from CD one with UEFI and one without) to ensure that you're installing with UEFI support enabled. A partition layout with a Ubuntu partition and a separate home partition is a good choice. For using suspend to HDD (hibernate) you should choose at least the size of your RAM as the size of the swap partition. There is one additional step to be performed to re-enable hibernate in 12.04. After installation has finished you should have a Ubuntu with the grub-efi-amd64 package installed on your hard drive. The installer should have recognized the correct UEFI system partition (there is a specific GPT partition code for the UEFI system partition), put a grub-efi-stub in there and register it in the UEFI boot variables.

In the end you should have at least an entry each for Windows and Ubuntu in your UEFI boot up selection available. If you don't have a Windows related entry there, then this is probably not a UEFI system and you shouldn't attempt to try my suggested solution (you wouldn't be able to boot the CD in UEFI mode). Dual booting should be working via GRUBs chainloading mechanism, so setting Ubuntu via UEFI as the default boot option should work like dual booting worked in the past with GRUB.

Solution 2

First, your partition table is clearly a GUID Partition Table (GPT). Since Windows will boot from GPT disks only if the computer uses an Extensible Firmware Interface (EFI) rather than the older Basic Input/Output System (BIOS), it's clear that you're booting in EFI mode. This is a critical detail, since traditional BIOS solutions are unlikely to work on an EFI system.

It's unclear from your description precisely what's booting. My best guess is that the Windows boot loader is booting, and you've used EasyBCD to create an Ubuntu entry that's not working. This is hardly surprising; the last I checked, the Windows EFI boot loader could not redirect the boot process to another boot loader, so EasyBCD's non-Windows entries will be useless to you. If I've misinterpreted what's happening, and you're actually seeing a GRUB boot menu that's able to boot Windows but not Linux, then please elaborate.

If my interpretations so far are correct, you may be able to use your firmware's boot menu to select GRUB rather than Windows and use that to boot into Linux. If your firmware's boot manager is good enough, this may even be an acceptable long-term solution. Unfortunately, EFI firmware implementations' boot managers are extremely variable in quality, and many of them are poor. If you can't find a boot menu in your firmware or if using it is awkward, you have two main options:

  • You can reconfigure the computer's boot setup to make GRUB 2 the default boot loader and reconfigure GRUB to include an entry for Windows. This will entail renaming boot loader files and/or using a utility such as Linux's "efibootmgr" to adjust the boot loader list in the computer's NVRAM.
  • You can add a third-party boot manager, such as rEFIt or its newer fork rEFInd, to control the selection of booting Windows vs. Linux. The rEFInd Web site includes detailed installation instructions. (Note that I'm the one who forked rEFIt into rEFInd.)

Be aware that the EFI boot process involves files stored on a partition known as the EFI System Partition (ESP), which is /dev/sda1 on your computer. Boot loader files typically reside in subdirectories of the EFI directory on that partition, as in EFI/Microsoft or EFI/ubuntu. The NVRAM holds a list of boot loaders and the order in which the firmware should try to launch them. Managing boot loaders involves adding, deleting, or moving the boot loader files and editing the NVRAM entries. In some cases, a default boot loader (EFI/Boot/bootx64.efi; although some implementations also support EFI/Microsoft/Boot/bootmgfw.efi as a default) is loaded if the NVRAM entries are empty or point to invalid boot loaders. For more information on this topic, as well as information on Linux's EFI boot loaders, see my Web page on the topic.

Solution 3

Probably the GRUB menu is not properly installed. Try to repair it with the grub-repair CD. Boot with this CD and let repair it automatically your system. You can find more information here.

Solution 4

As Windows is using EFI, you need to:

  1. install grub-efi. This can be performed by ticking the "Separate /efi" option of Boot-Repair.
  2. then setup your BIOS to boot the grub*.efi file in the EFI partition.
Share:
37,469

Related videos on Youtube

Keroak
Author by

Keroak

Updated on September 18, 2022

Comments

  • Keroak
    Keroak over 1 year

    I have just installed Ubuntu 12.04 on a laptop with Windows 7 but I don't get to boot from Ubuntu.

    First, during the installation I made these partitions (may be too many):

    /dev/sda1 FAT32 SYSTEM 200Mb boot (EFI boot, i guess)
    /dev/sda2 unknown file system 128 Mb msftres (Windows Boot Manager)
    /dev/sda3 NTFS OS 100 Gb (Windows 7)
    /dev/sda4 NTFS DATOS 315 Gb (Data partition)
    /dev/sda5 ext4 28 Gb (/home)
    /dev/sda8 unknown file system 1 Gb biog_grub (i'm not very sure why i made this one)
    /dev/sda6 ext4 17 Gb (/ Ubuntu 12.03 installed withou errors aparently)
    /dev/sda7 linex-swap 2 GB (swap)
    

    I can boot from Windows perfectly. Actually I tried to configure Windows Boot Manager with EasyBCD but it doesn't recognize any boot entry. Anyway, I added an Ubuntu Entry and it configured it automatically.

    Now I have boot entries the Windows 7 one that appear to work and the Ubuntu 12.04 that it prompt a "No application found" message.

    I re-started from a USB with Ubuntu and tried to fix GRUB from the command-line and with boot-repair. No results.

    As far as I understand I have to tell the Windows Boot Manager where my Ubuntu boot loader is.

    So I have two problems:

    1. Actually, I don't know where my Ubuntu boot loader, GRUB or GRUB2 or whatever, is.
    2. I don't know how to set my Ubuntu entry in Windows Boot Manager. I guess using BCDedit.exe as EasyBCD didn't show me the entries. Anyway, I don't know what parameters to use.

    I read several articles about it but i didn't find out anything useful.

  • Keroak
    Keroak almost 12 years
    Thanks, but i already done that, i use both grub and grub 2 unsuccesfully.
  • Keroak
    Keroak almost 12 years
    I also run these application but i didn't get any result.
  • Julien Chau
    Julien Chau almost 12 years
    In this case I should follow the advice of Rod Smith. It seams the exact way.
  • barro32
    barro32 almost 12 years
    How do you do step 2?
  • Keroak
    Keroak almost 12 years
    Thank you, for your answer. Actually i chose trying reinstalling Ubuntu following LiveWireBT's advices. What i did wrong is creating a new grub partition on the previous installation. So, the installer put GRUB in that partition instead on EFI partition. I didn't need to made any change after reinstalling but your explanation and your website were very usefull to understand what i was doing.
  • Keroak
    Keroak almost 12 years
    You were right. Aparently as i created a partition for the grub, the ubuntu installer ignored my EFI partition. After erasing that partition and reinstalling now it works properly. ;) Thank you very much.
  • LovinBuntu
    LovinBuntu almost 12 years
    For step2, some users just have to make their BIOS boot the hard disk in UEFI mode. But there may be other situations as firmwares can vary from one PC to another.