The following sections describe how to install Ubuntu in UEFI mode, either because you're single-booting and want to try this boot mode or because you're dual-booting with another OS that's already installed in this mode.
Having a PC with UEFI firmware does not mean that you need to install Ubuntu in UEFI mode. What is important is below:
if the other systems (Windows, GNU/Linux...) of your computer are installed in Legacy (not-UEFI) mode, then you must install Ubuntu in Legacy mode too. Eg if your computer is old (<2010), is 32bits, or was sold with a pre-installed Windows XP.
Single boot Ubuntu systems are still often installed in BIOS/CSM mode. Normally you install in UEFI mode because Windows is installed in UEFI mode and you want to dual boot. But it is possible to install Ubuntu (and the flavours Kubuntu Lubuntu, Xubuntu) as a single boot system in UEFI mode too, which can be useful for two purposes
to keep the systems separated, Ubuntu in one drive and Windows in another drive (so it will actually be a dual boot system, but not during the installation). Probably stable when installed in an internal drive. ----》 比较符合我的安装情况
to make a portable installed Ubuntu USB pendrive for UEFI mode (portable alias works in many computers). Not stable when installed in an external drive (USB stick).
To install Ubuntu in UEFI mode:
Use a 64bit disk of Ubuntu. (Ubuntu32bit cannot be easily installed in UEFI mode. This is a problem if 32-bit UEFI is the only way your computer can boot, e.g. if you have a modern Intel Atom based laptop. In this case, you will need a complicated work-around.)
In your firmware, disable QuickBoot/FastBoot and Intel Smart Response Technology (SRT). If you have Windows 8, also disable Fast Startup.
You might want to use an EFI-only image to avoid troubles with mistakenly booting the image and installing Ubuntu in BIOS mode.
Use a supported version of Ubuntu. Support for UEFI appeared in 11.10, but has become more reliable in next versions. Support for UEFISecureBoot appeared in 12.10 and 12.04.2.
Set up your firmware (BIOS) to boot the disk in UEFI mode (see the "Identifying if the computer boots the HDD in UEFI mode" paragraph below)
if you use the manual partitioning ("Something else"), the difference is that you will have to set the /boot/efi mount point to the UEFI partition. And if there was not any UEFI partition on your HDD, you first will have to create it (see the "Creating an UEFI partition" paragraph below).
Some recent computers (>2011) allow you to set up the computer to boot either in UEFI mode or in BIOS/CSM/Legacy (not-EFI) mode. The way to adjust this setting depends on the computers, but generally this setting is located in the "Boot order" tab of the BIOS (to access the BIOS screens, it is generally necessary to press a key during the PC startup). It can also often be set on a per-boot basis by hitting a function key (F8 and F10 are common choices) soon after you power on the computer.
Note: Some UEFIs (e.g. American Megatrends' "Aptio", found on the Asus vivobook series) call Legacy mode "Compatibility Support Module" or simply "CSM".
Remark: Some UEFIs enable one to set up the boot mode for the optical drive separately from the boot mode for the HDD.
For example, below:
Here is a 2nd example of UEFI boot mode setting, where the "Boot Mode" parameter enables one to choose the boot mode ("UEFI" or "Legacy") for all media (hard disk, CD, USB...) at the same time.
Some other UEFIs propose an "UEFI/Legacy Boot:" option with the following choices: [Legacy only], [UEFI only] and [Both]. This last one boots in UEFI mode when possible, then in Legacy mode if no UEFI files are detected.
The easiest partitioning scheme, on a non-GPT disk, is simply a root partition and a swap partition.
Name |
Size |
swap |
size of RAM |
/ |
the rest of the disk |
If the disk is GPT type (this can be checked via the "sudo parted -l" command), you must also add a BIOS-Boot or an EFI partition depending on the boot mode of your BIOS.
Name |
Size |
BIOS-boot or EFI |
see below |
swap |
size of RAM |
/ |
the rest of the disk |
On some computers, a separate /boot partition may also be required.
See paragraphs below.
Description: see SwapFaq.
If you want to install Ubuntu on a GPT disk (you can check it via the 'sudo parted -l' command), you will need either an EFI partition (if your BIOS is set up in EFI mode) or a BIOS-Boot partition (if your BIOS is set up in Legacy mode).
BIOS-Boot partition:
EFI partition:
Description: the EFI partition (also called ESP) contains some boot files. It is necessary if the firmware (BIOS) is set up to boot the HDD in EFI mode (which is default on more and more modern, > year 2011 computers). It must be located at the start of a GPT disk, and have a "boot" flag.
UEFI provides backward compatibility with legacy systems by reserving the first block (sector) of the partition for compatibility code, effectively creating a legacy boot sector. On legacy BIOS-based systems, the first sector of a partition is loaded into memory and execution is transferred to this code. UEFI firmware does not execute the code in the Master Boot Record (MBR), except when booting in legacy BIOS mode through the Compatibility Support Module (CSM).[3]
The UEFI specification requires MBR partition tables to be fully supported.[3] However, some UEFI implementations immediately switch to the BIOS-based CSM booting upon detecting certain types of partition table on the boot disk, effectively preventing UEFI booting to be performed from EFI System partitions contained on MBR-partitioned disks.[4]
UEFI firmware supports booting from removable storage devices such as USB flash drives. For that purpose, a removable device needs to be formatted with a FAT12, FAT16 or FAT32 file system, while a boot loader needs to be stored according to the standard ESP file hierarchy, or by providing a complete path of a boot loader to the system's boot manager.[3]
GRUB is more feature-rich and supports more complex scenarios. Its configuration file(s) is more similar to 'sh' scripting language, and can be automatically generated.
Syslinux is (currently) limited to loading only files from the partition where it was installed. An example configuration can be found in Syslinux#Examples.
The Linux kernel can be booted directly using the built-in EFI stub loader. See EFISTUB.
systemd includes an EFI bootloader which provides a text menu for booting EFISTUB kernels. See systemd-boot.
rEFInd is a UEFI Boot Manager which provides a graphical menu for booting EFISTUB kernels. See rEFInd.
Clover is a UEFI Boot Manager which provides native resolution GUI for booting EFISTUB kernels. See Clover.
ELILO is the UEFI version of the BIOS-only LILO. Its config file elilo.conf
is similar to LILO's config file. Upstream provided compiled binaries are available athttp://sourceforge.net/projects/elilo/ and an AUR package at elilo-efiAUR.
GRUB Legacy (also known as grub-0.97), is the legacy, BIOS-only branch of GRUB. See GRUB Legacy.
See LILO.
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See Boot loaders for more information.
While GPT support on BIOS systems is theoretically possible it sometimes isn't practical and other times there are complete incompatibilities. Technically the BIOS is only supposed to execute the code on the MBR, therefore leaving the possibility of differing partitioning schemes... However a BIOS may do additional checks including: checking a MBR's integrity, and possibly even for a MBR partition table (though usually only the first partition). If this is a case, a number of workarounds exist that may be able to repair the problem (listed below).
Bootloaders that support GPT/BIOS partitioning scheme bootloading:
Not suported: GRUB Legacy and LILO.
A few workarounds may help boot a BIOS/GPT partitioning scheme; however, before trying these, try booting a BIOS/GPT partitioning scheme with the bootloaders standard procedure. If it doesn't work, these may help boot them (read this for full reference):
parted /dev/sdX
and disk_toggle pmbr_boot
or using sgdisk /dev/sdX --attributes=1:set:2
.