I've been trying to find a way to install grub2 to a usb drive, in such a way that I can boot a PC in UEFI mode into Ubuntu, without modifying the UEFI firmware settings in any way or replacing the pre-installed Windows 7 x64 bootloader with grub. Here's the current gpt partition layout of the internal SSD drive as given by gparted, when run from an Ubuntu 13.04 x64 live-dvd session:
/dev/sda1 100mb fat32 /boot (efi system partition) /dev/sda2 128mb --- /msfres (Windows 7 reserved partition) /dev/sda3 100gb ntfs (Windows 7 system partition) /dev/sda4 10gb ext4 (Ubuntu root '/' partition)
So far, I've tried booting my live-dvd in UEFI mode, creating a root partition for Ubuntu (as seen above), then telling the installer to put grub on a 512mb usb pen drive (/dev/sdi) that I had previously formatted in gparted as follows: 1) create a gpt partition layout; 2) create a single primary partition; 3) format the partition as fat32; 4) set the partition flag as '/boot'.
I instructed the Ubuntu installer to install grub to /dev/sdi1 (the partition I created above -- since the preceding 1mb was unused space). However, when I rebooted the PC, after the completion of the Ubuntu installer, with the usb pen plugged-in, the firmware boot menu detected the pen as an UEFI device but then proceeded to boot Windows 7 -- no Ubuntu or grub menu.
I've tried Google'ing for solutions, and whilst there are many sites that give details on how to dual boot Windows and Linux on UEFI systems, they all assume that you will be able to modify the UEFI firmware settings or replace the Windows 7 bootloader (neither option is available to me, as I don't own the PC).
Therefore, could anyone give me a detailed, step-by-step method of installing grub2 to a usb pen so that I can boot into the Ubuntu partition in UEFI mode, without changing any of the system firmware settings or modifying/replacing the existing Windows 7 bootloader?
The system board is an ASUS Z87-K (bios rev 0412), the SSD is an 120gb OCZ-Vertex3 (firmware rev 2.15)
An update: It turns out that my UEFI firmware DOES have secure boot enabled (because Windows 7 (and other OSes in 'live mode') booted fine, I assumed it was turned off). My apologies if I've been leading people up the wrong path! Since I don't own this PC, I can't turn secure boot off, so I will have to abandon the attempt at an Ubuntu installation for now. Although, according to the Canonical documentation, Ubuntu 12.04.2 and later should be able to boot on a PC with secure boot enabled? Since I can't disable secure boot to narrow-down the problem which is preventing me from successfully booting Ubuntu, I'll leave this question open, but any future installations I attempt will be done on my own hardware so I have the freedom to experiment in greater depth.
Thanks, once again, to all who responded!