How to create an EFI System Partition?

First, you don't set the mount point in GParted; that's done manually (and temporarily) via the mount command or permanently by editing /etc/fstab. Thus, your concern over this issue is misplaced.

Second, an EFI System Partition (ESP) is simply a FAT partition with a particular type code (namely, C12A7328-F81F-11D2-BA4B-00A0C93EC93B on GPT disks) set. Note that the mount point in /etc/fstab is not part of the ESP's definition; it's just conventional (but not required) in Linux to access the ESP by mounting it at /boot/efi, typically via an /etc/fstab entry. How you set the type code varies from one program to another:

  • In gdisk, you set the type code to EF00. (gdisk uses two-byte type codes that expand out to the real type codes on the disk; "EF00" is just a mnemonic for "C12A7328-F81F-11D2-BA4B-00A0C93EC93B".)
  • In GParted or parted, you set the "boot flag." Note, however, that this works only on GPT disks; you cannot set the ESP type code on MBR disks with these programs. (This isn't normally a big deal, since EFI-based computers usually boot from GPT disks.)
  • In the Ubuntu installer, you identify the partition as an "EFI boot partition." It then sets the type code and will set up /etc/fstab appropriately.
  • In recent versions of Linux fdisk, you set the partition type by its number (1 for "EFI System" on GPT disks or 0xEF on MBR disks) or by entering the full type code on GPT disks.

Third, the ESP does not hold firmware -- firmware is, by definition, stored in chips on the motherboard. Thus, your effort to install the EFI firmware on the ESP is a wild goose chase. (There are two exceptions to this rule. First, you might store a firmware file on the ESP in order to update the firmware on your computer. This is just a temporary holding area, though. Second, the DUET or Clover boot loader, the EFI is loaded as a regular program, typically from the ESP. These tools are BIOS boot loaders, though, that enable BIOS-only computers to boot as if they were EFI machines; they are not normally used on computers with EFI firmware, which you claim your computer has. Technically, neither DUET nor Clover is firmware; they're BIOS boot loaders that do the same job as EFI.)

Finally, I can think of a number of possible causes for your problem, but without further information, I'd need to write half a book to cover them all. I recommend you run the Boot Info Script on the computer. This will produce a file called RESULTS.txt. Post it to a pastebin site and post back with the URL to your document. That will give hard data on your configuration, which will greatly reduce the range of possible causes of your problem.


The EFI partition doesn't keep firmware (which is stored in a chip on the motherboard); it keeps the boot loaders for installed operating systems. It is basically the EFI alternative of putting the boot loader in the 0th sector of your disk, as was the case with BIOS PCs.

This means that once you have such a partition, it should get filled automatically when you install the operating system. (Quite likely though that the install disc itself must be booted in EFI mode, too, otherwise it won't bother setting up UEFI boot... in fact, certain parts of the setup can't even be done from BIOS mode.)

If you already have Ubuntu installed, you'll need to:

  1. Install the UEFI version of GRUB; I think it is in the grub-efi-amd64-signed package.

    grub-install --target=x86_64-efi-signed
    

    (For the unsigned grub-efi-amd64 version, it's x86_64-efi.)

  2. Ensure that GRUB has installed itself as \EFI\Boot\bootx64.efi in the EFI system partition. (I'm using the EFI path syntax here; if you mount the partition at /boot on Linux, it would be /boot/EFI/Boot/bootx64.efi.)

    If it hasn't, copy grubx64.efi manually to that location.

    This is necessary because grub-install cannot add itself to the EFI boot menu unless the system has already booted in EFI mode. (The "EFI variables" are impossible to access in BIOS moed.) Therefore the only way to boot GRUB is by putting it at the "fallback boot loader" location.

  3. Reboot. Try to select some kind of EFI mode in your firmware's boot menu (EFI firmwares have a boot menu of their own, even before GRUB).

  4. Check if dmesg | grep "efi:" shows anything, to confirm that you're in EFI mode.


Create two files with notepad and save them to your USB Windows install drive.
SaveAs: CreatePartitions-UEFI.txt

select disk 0
clean
convert gpt
rem == 1. System Partition  =====================
create partition efi size=210
format fs=fat32 quick label="SYSTEM"
active
rem == 2. Microsoft Reserved (MSR) partition  ======
create partition msr size=16
rem == 3.  Windows partition  ===================
create partition primary size=xxxxxx
format fs=ntfs quick label="Windows"
assign letter="W"
rem == 4. Recovery tools partition  ================  
create partition primary size=460
format fs=ntfs quick label="Recovery"
assign letter="R"
list volume

Create another text file with Notepad:
SaveAs: diskpart-UEFI.txt

diskpart /s D:\CreatePartitions-UEFI.txt   

REM where D:/ is the usb drive. This command runs the text file to install the partitions.

If you are using MBR the command will be, convert mbr.

To get the size of the Windows partition, Multiply your HD size times 1024, a 100 gig hard drive times 1024 equals 102400 minus 210 (efi size) minus 16 (msr size) minus 460 (reserved size) equals the size you will put in the Windows partition size. (xxxxxx)

You can change the partitions size from the terminal (Command Prompt) cd /d D: > notepad CreatePartitions-UEFI.txt

While you are in the USB drive open with notepad diskpart-UEFI.txt and leave open or write the command down so you will not make a mistake. Once you have change the size of the partitions to your liking,close it, then cd /d x:/Sources then run the diskpart /s D:\CreatePartitions-URFI.txt.
list volume as the last command shows you the partitions, if happy, exit > turn off computer > restart > install