Basic Arch linux guide for uefi installation

Internet connection

Use iwctl to connect your network. If you using LAN probably you don't need to do anything.

iwctl

Partitioning

  1. Show current partitions and disk.
  2. lsblk

    We need to create EFI system partition and Linux filesystem partition. If you have already installed other system for EFI then, you don't need to create ESP, also check which partition is empty for linux, if you dont have, you need to resize ntfs by for example gparted if it's windows. But I will focus on empty disk case

  3. Prtitioning, replace sdx with your lsblk output disk
  4. gdisk /dev/sdx
    
  5. Create GPT partition table
  6. Command: o
    
  7. Create new partition
  8. Command: n
    
  9. Creating first partition as ESP
  10. Partition number: 1
    
  11. Set where is partition start, leave default just press enter
  12. First sector:
    
  13. set size of the ESP
  14. Last sector: +512M
    
  15. Set partition type to ESP
  16. Hex code or GUID: EF00
    

    Create partition for Linux filesystem

    Command: n
    
  17. Create second partition
  18. Partition number: 2
    
  19. Leave default
  20. First sector:
    
  21. Set size of main partition, press enter for whole lefted space
  22. Last sector:
    
  23. Set partition type to Linux filesystem (you can leave that if you will use EFISTUB)
  24. Hex code or GUID: 8300
    
  25. Print your partition configuration
  26. Command: p
    
  27. Write your partition configuration (save)
  28. Command: w
    

Create filesystems to our partitions

Format ESP to FAT32 (if you already have this ESP from other OS, skip this step)

mkfs.fat -F 32 /dev/sdx1

Format Linux filesystem partition to Fourth Extended File System

mkfs.ext4 /dev/sdx2

Mounting

Mount Linux filesystem to /mnt directory for prepare to install packages

mount /dev/sdx2 /mnt

Create directory for ESP

mkdir /mnt/boot

Mount ESP to /boot directory

mount /dev/sdx1 /mnt/boot

Installing packages

We will install the base package, Linux kernel and firmware, NetworkManager, text editor, EFI Boot Manager. Use reflector to auto set servers. My favourite text editior for instalation is vis

pacstrap /mnt linux linux-firmware base base-devel networkmanager vis efibootmgr

Configure system

Generate fstab file.

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

Show disk and partitions with filesystems

lsblk -fs

Show fstab file for check of proprly done task

cat /mnt/etc/fstab

Change root to new file system

arch-chroot /mnt

Edit /etc/locale.gen and uncomment #en_US.UTF-8 UTF-8 and other needed locales. Generate the locales by running:

locale-gen

Create the /etc/locale.conf file, and set the LANG variable accordingly:

LANG=en_US.UTF-8

Create the hostname file /etc/hostname

myhostname

Enable network manager:

systemctl enable NetworkManager

Create user with home directory:

useradd -m username

Set passwords:

  1. Create root password
  2. passwd
    
  3. Create username password
  4. passwd username
    

Add your user to wheel group

usermod -aG wheel username

Make user usefull:

edit /etc/sudoers and uncomment

#%wheel ALL=(ALL) ALL

Boot loader

There is many options. I recommend two of them efistub and systemd-boot. EFISTUB boot kernel directly, but systemd-boot is kinda better and more minimalistic grub replacement. So if you want to use only one system efistub is really nice choice, and if you use many systems and do it often, systemd-boot will be better option

EFISTUB

prepare for create boot entry, print lsblk for view on partitions

If you would not replace drives places you can replace root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw by root=/dev/sdxY.

Now create boot entry:

efibootmgr --disk /dev/sdX --part Y --create --label "Arch Linux" --loader /vmlinuz-linux --unicode 'root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw initrd=\initramfs-linux.img'

/dev/sdXY is ESP and root is your Linux file system partition

systemd-boot

bootctl --path=/boot install

Create and edit file /boot/loader/entries/arch.conf


title		Arch Linux

linux		/vmlinuz-linux

initrd		/initramfs-linux.img

options		root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw

This options should be in one column, here you can also replace root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw by root=/dev/sdxY rw

Edit /boot/loader/loader.conf


default arch

timeout 4

console-mode max

editor no

And update systemd-boot:

bootctl --path=/boot update

This should be enough to turn on your own arch

After reboot to end configuration you need to set timezone by :

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

or

timedatectl set-timezone Region/City

Set hardware clock to UTC time

hwclock --systohoc

Set keyboard layout for xorg

localectl list-keymaps
localectl set-x11-keymap us

Replace "us" for your requirement