User:Imnotpathetic/UEFI Installation guide

From ArchWiki

This is a installation guide for installing Arch Linux on a UEFI computer with Grub as the bootloader, and networkmanager

Warning: This is a unofficial guide and it is entirely your responsibility if you have borked your computer in any way. Please also have the official Installation Guide opened in another tab, just in case.

Live environment

Note: Arch Linux does not support secure boot. So it is highly recommended to turn secure boot off

Once booted into the live environment, Arch Linux automatically logs in and you are presented with a shell prompt.

Verify boot mode

This installation Is for a UEFI motherboard computer. Thus, it is important to make sure that your computer has booted into the correct boot mode. To verify that you have booted into UEFI mode, you have to list the efivars directory

# ls /sys/firmware/efi/efivars

If the command shows the directory without an error, you have booted into UEFI installation. If the command does not return anything, please refer to your motherboard manual.

Installation processes

From here on, it is all installation process.

Connect to the internet

If your computer offers a Ethernet port, you have to physically plug a wire to connect to the internet. If you do not have a Ethernet port, or you are too lazy to plug your wire, you will have to connect via the iwtctl command.

Note: Keep in mind that the wifi-menu command does not work anymore (2021)
# iwctl

You will now see a new prompt [iwd]#.

[iwd]# device list

This command is going to list all your wifi adapters in your computer.

[iwd]# station DEVICE scan

The above command is going to scan and find all networks in you area.

Note: Replace DEVICE with your wifi adapter name like wlan0.
[iwd]# station DEVICE get-networks

The above command is going to list all the scanned networks

[iwd]# station DEVICE connect NETWORK_NAME
Note: Replace NETWORK_NAME with your wifi.

Type in your password and now, you will be connected to wifi. To exit type in

[iwd]# exit

Now you will need to test your internet connection. Ping a internet site you know.

# ping

If it returns you a command, then you have successfully connect to the internet.

Disk Setup

Every device is assigned a block device label example /dev/sda, /dev/nvme0n1, or /dev/mmcblk0. To recognise these devices use the lsblk command. It is recommended to use GPT partition layout to your computer, or a DOS partition layout would also work. Partitioning could be done with cfdisk or fdisk or any of the tool.

Disk Partitioning

UEFI Layout
Mount point Partition Partition type Suggested size
/mnt/boot or /mnt/efi /dev/efi_system_partition EFI system partition At least 100 MiB
[SWAP] /dev/swap_partition Linux swap More than 512 MiB
/mnt /dev/root_partition Linux x86-64 root (/) Remainder of the device
/mnt/home home_partition Home Partition Atleast 1 GiB
Note: Swap partition is not useful and could be a potential waste of space unless you have a computer which has less than 2Gib of ram.
Note: Home partition is not recommended to be used unless you have or are planning to dual-boot Arch Linux with another Linux Distribution

Formatting the Partitions

Once the disk has been partitioned, each newly created partitions should be formatted with the appropriate filesystem. For the purpose of this guide, I will be using the tried and tested, Ext4 filesystem for the root and the home partition. To format your root partition and home partition, run the command

Note: Replace dev/*_partition with the appropriate block device path
# mkfs.ext4 /dev/dev_root_partition && mkfs.ext4 /dev/home_partition

Now, you will need to format your boot partition. So run the command

# mkfs.fat -F32 /dev/efi_system_partition
Warning: It is highly recommended to format your EFI system partition in Fat32 filesystem. UEFI motherboards do not recognize filesystems other than Fat32, you would not be able to boot into your computer if you format the partition with other filesystems other than Fat32

Now you will need to format swap partition, so run the command

# mkswap /dev/swap_partition

Mount the Partitions

Mount the root device to /mnt

# mount /dev/root_partition /mnt

Create a new mount point /mnt/boot and mount the EFI partition by running the command

# mkdir /mnt/boot && mount /dev/efi_system_partition

Create a new mount point /mnt/home and mount the home partition by running the command

# mkdir /mnt/home && mount /dev/home_partition /mnt/home

this article is still a work-in-progress...