Manual UEFI installation¶
The wizard can do this for you
The installer handles UEFI partitioning and bootloader installation, including EFISTUB. This page is for the case where you want to do it by hand, or where you are installing onto a layout the guided scenarios do not cover.
This page supplements the Arch Wiki with the parts that trip people up in practice. It grew out of a contribution by the Obarun community members marianarlt and techore on the forum.
Disclaimer¶
Read the whole page before you apply any of it. Make sure you booted your live medium in UEFI mode.1
Requirements¶
- A disk with a GPT table,
gdiskrecommended. - A separate EFI system partition with the right type identifier.
- A root partition.
Optional:
- A swap partition, needed for hibernation. See the Arch Wiki on suspend and hibernate.
- A separate home partition, which keeps your data out of the way of system upgrades and migrations.
- Encryption, not covered here. See the Arch Wiki on disk encryption.
Partition layout¶
Check the device name with lsblk before anything else. The examples use
/dev/sda.
The most minimal layout:
| Partition | Type | Size | Mount point | File system |
|---|---|---|---|---|
/dev/sda1 |
esp | 550 MB or more2 | /efi3 |
FAT324 |
/dev/sda2 |
root | rest | / |
ext4 |
A more realistic one, used by the rest of this page:
| Partition | Type | Size | Mount point | File system |
|---|---|---|---|---|
/dev/sda1 |
esp | 550 MB or more2 | /efi3 |
FAT324 |
/dev/sda2 |
swap | 2 GB or more5 | swap | |
/dev/sda3 |
root | 30 GB or more6 | / |
ext4 |
/dev/sda4 |
home | rest | /home |
ext4 |
1. Create the partitions¶
Make sure you chose the right disk
gdisk writes to whatever device you name. Run lsblk again if you are not
certain.
ocreates a new GPT table. Confirm withy.ncreates the ESP. Accept the default start sector, enter+550Mas the end, and give it typeef00. The identifier is not optional: the firmware finds the ESP by its type.nagain for swap:+2G, type8200.nagain for root, sized as you like, type8304(Linux x86-64 root).nagain for home, type8302(Linux/home).wwrites the table and exits.
2. Format¶
Labels make fstab and EFISTUB entries much easier to read, so set them:
# mkfs.vfat -n ESP /dev/sda1
# mkswap -L SWAP /dev/sda2
# mkfs.ext4 -L ROOT /dev/sda3
# mkfs.ext4 -L HOME /dev/sda4
3. Mount¶
Then mount the ESP where your bootloader expects it:
And the rest:
4. efivarfs¶
efibootmgr needs UEFI variables exposed to userspace. Check whether they are
there:
If the directory is empty, mount it:
Note
If you are not using arch-chroot, which does this for you, run the mount
both outside and inside the chroot. See the Arch Wiki on
efivarfs and sysfs-efivars.
5. Install the system¶
Make sure the network is up, then install onto the mounted target with
obinstall-cli. It installs onto a pre-mounted target and
leaves the bootloader to you, which is exactly what this page wants:
with a configuration whose [target] newroot is /mnt. Do not reboot yet:
the firmware does not know what to boot.7
6. Bootloader¶
Syslinux is discouraged for UEFI/GPT layouts.8 Two options are documented here.
EFISTUB¶
Your motherboard already contains a bootloader. EFISTUB uses it directly, with
no extra software to install or maintain, booting vmlinuz-linux straight from
the ESP. See the Arch Wiki on EFISTUB.
# efibootmgr -c -d /dev/sda -p 1 -L "Obarun" -l \vmlinuz-linux -u "root=LABEL=ROOT ro resume=LABEL=SWAP quiet initrd=\intel-ucode.img initrd=\initramfs-linux.img"
Custom kernel parameters go inside the -u string, as quiet does above.
Adjust or remove the microcode image to match your CPU.
ro or rw
The entry above says ro, which is what the installer writes for EFISTUB.
rw boots just as well; the only difference is that the root is not
checked by fsck on the way up. A ZFS root needs rw. See
GRUB.
To change the entry later, delete it and recreate it:
where 0000 is the number of your Obarun entry.
GRUB¶
The firmware boots the GRUB EFI application, which then chain loads the kernel. Some people find it easier to manage, especially with multi-boot. See the Arch Wiki on GRUB for UEFI systems.
# arch-chroot /mnt
# pacman -S grub
# grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=grub
# grub-mkconfig -o /boot/grub/grub.cfg
# exit
grub-mkconfig writes rw, which is Arch's default and boots fine. See
GRUB if you want ro and the root check that comes
with it.
Reboot¶
Next¶
-
To boot the live medium in UEFI mode, enter your motherboard's boot menu, usually one of the F1 to F12 keys, and pick the entry that literally says "UEFI" next to your device name. If you are unsure afterwards, run
ls /sys/firmware/efi/efivars: in UEFI mode it prints many long names, otherwise nothing. ↩ -
Do not make the ESP smaller. It is unnecessary with today's disks and causes confusion and bugs on older firmware. Rod Smith, the author of rEFInd, wrote an in-depth series on EFI bootloaders. ↩↩
-
Arch deprecated
/boot/efiin favour of/efi, see mounting the ESP. The mount point does not affect how the firmware works: the ESP is found by its type, not its mount point. It only matters when configuring the bootloader. EFISTUB uses/bootfor convenience, since the kernel is then already in the default location. ↩↩ -
The UEFI specification mandates FAT12, FAT16 and FAT32. Vendors may add more, as Apple firmware does with HFS+. ↩↩
-
Size swap against your RAM and your workload. You can skip it entirely with plenty of RAM, but hibernation needs it. ↩
-
With a separate home partition, still leave room for future upgrades and large applications. ↩
-
Strictly speaking the firmware will boot an EFI application named
BOOTX64.EFIfrom anywhere in the ESP, and GRUB can be installed that way, which makes NVRAM entries unnecessary. ↩ -
Syslinux can boot UEFI/GPT, but with limitations and enough extra setup to be out of scope here. See the Arch Wiki on syslinux UEFI systems. ↩