Skip to content

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, gdisk recommended.
  • 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.

# gdisk /dev/sda
  • o creates a new GPT table. Confirm with y.
  • n creates the ESP. Accept the default start sector, enter +550M as the end, and give it type ef00. The identifier is not optional: the firmware finds the ESP by its type.
  • n again for swap: +2G, type 8200.
  • n again for root, sized as you like, type 8304 (Linux x86-64 root).
  • n again for home, type 8302 (Linux /home).
  • w writes 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

# mount /dev/sda3 /mnt

Then mount the ESP where your bootloader expects it:

# mkdir /mnt/boot && mount /dev/sda1 /mnt/boot
# mkdir /mnt/efi && mount /dev/sda1 /mnt/efi

And the rest:

# mkdir /mnt/home && mount /dev/sda4 /mnt/home
# swapon /dev/sda2

4. efivarfs

efibootmgr needs UEFI variables exposed to userspace. Check whether they are there:

# ls /sys/firmware/efi/efivars

If the directory is empty, mount it:

# mount -t efivarfs efivarfs /sys/firmware/efi/efivars

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:

# obinstall-cli --config install.toml

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:

# efibootmgr -b 0000 -B

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

# 66 reboot

Next

First boot.


  1. 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. 

  2. 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

  3. Arch deprecated /boot/efi in 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 /boot for convenience, since the kernel is then already in the default location. 

  4. The UEFI specification mandates FAT12, FAT16 and FAT32. Vendors may add more, as Apple firmware does with HFS+. 

  5. Size swap against your RAM and your workload. You can skip it entirely with plenty of RAM, but hibernation needs it. 

  6. With a separate home partition, still leave room for future upgrades and large applications. 

  7. Strictly speaking the firmware will boot an EFI application named BOOTX64.EFI from anywhere in the ESP, and GRUB can be installed that way, which makes NVRAM entries unnecessary. 

  8. 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