From the Ubuntu help:

Converting Ubuntu into UEFI or Legacy mode

Note: Do not follow this procedure if your computer is already booting correctly. Use this procedure only if you believe you've accidentally installed Ubuntu in BIOS/CSM/legacy mode and you want it to boot in UEFI/UEFI mode.

  • Start Boot-Repair, click on "Advanced options", go to the "GRUB location" tab.

  • If you do not see a "Separate/boot/efi partition`" line, this means that your PC does not have any UEFI partition. In this case, exit Boot-Repair, then create an UEFI partition (see the "Creating an UEFI partition" paragraph above).

  • If you see a "Separate /boot/efi partition" line, tick it then click the "Apply" button.

  • Set up your BIOS so that it boots the HDD in UEFI mode (see the Set up the BIOS in UEFI or Legacy mode paragraph above).

Skip 1 and 2 and go straight for "Creating an UEFI partition"

An ESP can be created via a recent version of GParted (the Gparted version included from the Live session is OK), and must have the following attributes:

  • Mount point: /boot/efi (remark: no need to set this mount point when using the manual partitioning, the Ubuntu installer will detect it automatically)
Size: minimum 100Mib. 200MiB recommended.
Type: FAT32
Other: needs a "boot" flag.