Archlinux UEFI Install Guide 26/10/19

ebdee92a15b3

Archlinux UEFI Install Guide


SET KEYBOARD

loadkeys uk


ENABLE NETWORK

wifi-menu -o if using wifi

ping achlinux.org Ctrl+C to stop ping


CREATE & PARTITION THE DRIVE

lsblk view available disks

gdisk /dev/sda -x -z -y -y wipes the drive

cfdisk /dev/sda gpt for UEFI

Create 2 new partitions:

  1. Size 512M - Type EFI System
  2. Rest of disk - Type: Linux Filesystem
  • Select write - type yes

  • Quit out of cfdisk

FORMAT THE FILESYSTEM

mkfs.fat -F32 /dev/sda1 efi partition

mkfs.ext4 /dev/sda2 rest of disk


MOUNT THE FILESYSTEM

mount /dev/sda2 /mnt

mkdir /mnt/boot

mount /dev/sda1 /mnt/boot


INSTALL ARCHLINUX BASE PACKAGES

pacstrap -i /mnt base base-devel linux linux-headers nano networkmanager linux-firmware select option 1): mkinitcpio


CONFIGURE FSTAB AND CHROOT /MNT

genfstab -U /mnt >> /mnt/etc/fstab

cat /mnt/etc/fstab

arch-chroot /mnt


CONFIGURE LANGUAGE AND LOCATION

nano /etc/locale.gen

uncomment your locale e.g:
en_GB.UTF-8 UTF8

locale-gen


SET YOUR TIME ZONE

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

hwclock --systohc


ENABLE THE MULTILIB REPOSITORY

nano /etc/pacman.conf

Uncomment the lines:
[multilib] and
include = /etc/pacman.d/mirrorlist

pacman -Sy check multilib is enabled


SET HOSTNAME & NETWORK

echo yourhostname > /etc/hostname

nano /etc/hosts

127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostname


SET ROOT PASSWORD AND CREATE NEW USER

passwd

useradd -m -g users -G wheel -s /bin/bash yourname

passwd yourname


ALLOW USERS IN WHEEL GROUP TO BE ABLE TO PREFORMANCE ADMINISTRATIVE TASKS WITH SUDO

EDITOR=nano visudo

Uncomment the line:
%wheel ALL=(ALL) ALL


INSTALL AND CONFIGURE BOOTLOADER

mkinitcpio -p linux

pacman -S grub efibootmgr dosfstools mtools

grub-install --target=x86_64-efi --efi-directory=/boot

grub-mkconfig -o /boot/grub/grub.cfg


UNMOUNT THE PARTITIONS AND REBOOT

exit

umount -a

reboot


CREATE A SWAPFILE recommended

as superuser:

su

fallocate -l 4G /swapfile

chmod 600 /swapfile

mkswap /swapfile

echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab

11 Likes

I never use a swap file, I’ve always just made a swap partition. Having seen this guide and needing to reinstall arch anyway, I thought I might give the swapfile a go.
So for anyone using a filesystem other than ext4, fallocate will create a swapfile with holes in it, which means it won’t function as a swapfile. It’ll just break. The easiest way to solve this that I found was to instead replace the fallocate -l 4G /swapfile line with:
dd if=/dev/zero of=/swapfile count=4000 bs=1MiB
Which does the exact same thing, only without the holes.

1 Like