I tried the Ubuntu Studio as well as Ubuntu - both fail to start in UEFI mode using the Live DVD image.
One of the workarounds (I haven't done this yet myself) is to install Ubuntu in BIOS mode using a separate dedicated boot partition on your GPT partitioned disk, not update any packages during installation or thereafter until you have replaced grub and installing grub onto your
/boot partition, not onto MBR (e.g., not on
/dev/sda, but on
/dev/sda5 is your
/boot). Then boot again from the Live DVD and in the Live DVD run, install grub-efi replacing grub-pc. Then mount your installed Ubuntu's
/boot onto the Live DVD's
sudo mount -t ext4 /dev/sdaX /boot where /dev/sdaX is the installed Ubuntu's boot partition, e.g.,
sudo mount -t ext4 /dev/sda5 /boot - this assumes you have formatted
/boot using ext4. Then install your UEFI System partition (ESP) onto
/boot/efi, like so:
sudo mkdir -p /boot/efi/ && sudo mount -t vfat /dev/sdaY /boot/efi/, e.g.,
sudo mkdir -p /boot/efi/ && sudo mount -t vfat /dev/sda2/ /boot/efi. Here it is assumed your /dev/sdaY was created by Windows 8 installation and uses the FAT32 filesystem. After this, install grub again:
sudo grub-install. That I hope will place grub onto your /boot/efi/EFI/ubuntu/ directory. You may have to create a text file in your installed Linux's
/boot partition containing some details for grub to find your
/ partition, named
refind_linux.conf and containing:
"Boot using standard options" "root=UUID=17c62fb9-a67a-4bae-97d7-3b71e5d3c8ce ro quiet splash $vt_handoff"
"Boot using minimal options" "root=UUID=17c62fb9-a67a-4bae-97d7-3b71e5d3c8ce ro"
"Boot using recovery options" "root=UUID=17c62fb9-a67a-4bae-97d7-3b71e5d3c8ce ro recovery nomodeset"
Please refer http://www.rodsbooks.com/ubuntu-efi/ for more details on
refind_linux.conf. Please find UUID for your
/ partition using
blkid and replace appropriately.
Once this much is done, install rEFInd (http://www.rodsbooks.com/refind/index.html) and then reboot in UEFI mode, choosing rEFInd from your motherboard boot selection menu if needed. rEFInd should give you the option to boot your grubx64 image and that in turn should boot the Linux. I choose the manual install using Windows method mentioned on the page at link in this para.
rEFInd should boot your BIOS grub if you did not choose to replace it with grub-efi as well, but it did not work in my case (Ubuntu kernel would immediately panic after booting up, perhaps due to some quirk to do with my mainboard, a DH55TC (Intel) or with Ubuntu or with some hardware on my machine (wifi card I think), I don't know).
Also, the manner I've highlighted above doesn't mount your
/ partition from the installed Ubuntu when you run the live DVD. I don't know if this can materially affect the Ubuntu EFI's booting up of your installed Ubuntu.
I've to play with this myself, haven't done so yet.
But, ideally, I don't even want to go down this route. I hate the fact that Ubuntu is not able to boot up in UEFI mode from the Live DVD. I would rather install in UEFI mode directly instead of having to do the above, even if the above works (it is untested and might result in problems which I've not foreseen).
So, I'd suggest you try doing the same, perhaps by trying to install Ubuntu via flash drive in UEFI mode and see if Ubuntu is able to cleanly boot/install in UEFI mode then.
Or, switch to a distribution which can do this without having to resort to any fixes later; when I was browsing the web yesterday, I came across a reference which suggested OpenSuse does that cleanly (install in UEFI mode).
Edit: I have done the above myself now, see details below
I have now tried certain steps and can outline what works for me.
- Install Windows 8 in UEFI mode. My BIOS does NOT have secure boot, but I wanted to install Windows 8 in UEFI mode anyway and wanted to do away with MBR mode. Since Windows 8 works with GPT disks in UEFI mode, Windows partitioned my disk using GPT mode. I have 4 partitions after Windows install, all created by Windows: Recovery, ESP, Microsoft Reserved and Windows main.
- Install Ubuntu 13.04 in BIOS mode (since it fails to boot/install in UEFI mode). The boot partition is a dedicated partition. I have Linux swap and
/boot and those partitions are encrypted, so have to create an unencrypted
/boot separately. I install bootloader on the same partition as my
/boot partition, not on the MBR, e.g., on
/dev/sda5, not on
- After installation finishes, I reboot using UEFI mode into Windows and install rEFInd using manual installation method for Windows outlined on its website.
I reboot in BIOS mode, to Boot Repair CD. I do NOT carry out any repair (it messed up my partitions once earlier upon detecting both
/boot and efi and chose to repair my partitions such that Windows didn't boot after that. What I do (after quitting boot repair dialog box upon boot up AND after having established an internet connection) is to drop to a terminal window and type:
sudo apt-get install grub-efi
The above may or may not complete successfully, but I have sufficient components to be able to run a grub-install. Before running that, I mount Ubuntu's
/boot partition to the running Boot Repair's
/boot and then the esp to
/boot/efi. Then I run
The above may attempt to install grub on all partitions, so you are forewarned.
Anyway, as a result, I now have
grubx64.efi in it and other files needed by grub in
/boot. I also create the
refind_linux.conf file in
/boot as noted in my post and put the correct UUID for the installed Linux's
/ partition in it.
I reboot to rEFInd in UEFI mode (I no longer need to boot in BIOS mode and BIOS mode boot won't work to boot the installed Linux now). rEFInd shows me the option to boot my Linux by way of a Penguin icon (result of scanning for Linux kernels) and by way of Ubuntu icon (the grubx64.efi that I just installed through Boot Repair disk). I choose the grubx64.efi method (Ubuntu icon) since the other one doesn't work for me.
Whew. We are mostly done. Once booted into the installed Ubuntu (I installed Ubuntu Studio, not Ubuntu to be precise), before performing any package updates, I install grub-efi (since the installed Ubuntu only knows about the grub-pc until this point because I installed grub-efi externally using Boot Repair's disk, so that install is not proper or complete, it was just a hack to be able to boot to Ubuntu 13.04).
Then I mount the esp whilst running Ubuntu and modify the refind.conf to comment out the scanning option for all linux kernels, so that the Penguin icons are not shown any more (only the grubx64.efi's Ubuntu icon is shown) on the rEFInd menu. I do not want many icons covering each individual kernel installed in Ubuntu, on rEFInd menu.
Now, when I want to boot Linux, I just boot to rEFInd menu and choose the Ubuntu icon, otherwise I choose the Windows icon.
This setup is stable for me.