Contents

Yet another Arch installation guide - Part 1

Introduction

I know, I know there are already many Arch Linux installation guides out there, and the best one is anyway the installation guide of the original Arch Linux wiki.
But neverless, I would like to share you my version, how to install Arch Linux as comprehensive guide.
If you got some suggestion how to make things better, please just let me know.

Create boot device

First, we get to Download ISO-image from some Arch Linux mirror.
Go to https://archlinux.org/download and choose a mirror to download the newest ISO-image.
I like the mirror from the university of Esslingen on the Neckar, it’s close to where I’m living and reasonable fast.

1
wget https://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/iso/latest/archlinux-x86_64.iso

After you got the ISO, you can write it to some USB device.

1
2
export USBDEV="/dev/sdX"
dd bs=4M if=archlinux-x86_64.iso of=${USBDEV} conv=fsync status=progress oflag=direct && sync

Now you can boot in to the live environment.

Setup pre-installation live environment

For easy copy and paste the necessary commands, we are set up an SSH daemon.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
loadkeys de
ping -c3 www.archlinux.org
# If you got no connection, we need to get an IP-address
# Get the name of your network device
ip link
# Example for LAN inteface
# Use DHCP
dhcpcd enp0s3
# Use static IP
ip address add 10.0.0.100/24 dev enp0s3
ip route add default via 10.0.0.100

# Example for WLAN inteface
iwctl
device list
device wlan0 show
station wlan0 connect [wifi ssid]

# Setup DNS-Server
echo "nameserver 1.1.1.1" > /etc/resolv.conf
# Set password to authenticate
passwd
# Start SSH daemon
systemctl start sshd
# Get IP where we now can connect to
ip -c -4 a

From another device, connect to the system for example like ssh root@10.0.0.100

Setup some other thinks for the live environment

1
2
3
4
5
6
7
8
9
# Enable network time protocol
timedatectl set-ntp true
# Refresh repositories and reload PGP keys
pacman -Syy
pacman-key --init
pacman-key --populate archlinux
# Install and setup reflector to get the fastest repositorie mirrors
pacman -S reflector
reflector --verbose --latest 10 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

Partitioning

To arrange the file systems, I like to use the LVM (Logical Volume Manager), so we are quite flexible and can always extend space if needed.

First we need to know what kind of boot firmware the system where we want to install got.

1
ls /sys/firmware/efi/efivars|wc -l

If there are some files located in the efivars directory we can use UEFI otherwise we got some older BIOS firmware.

Partitioning using BIOS (without UEFI)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Check the current setup and find out the name of the hard disk
lsblk
# Open the disk in fdisk where you like to use
fdisk /dev/sdX
# Press button d until all existing partitions are deleted
d
# Create mbr partition table
o
# Create boot partition
n
Enter
Enter
Enter
+1G
t
Enter
# Use Linux lable for this partition
20
a
Enter
# Create LVM partition
n
Enter
Enter
Enter
Enter
t
2
# Use Linux LVM lable for this partition
8e
# Write changes
w

Partitioning using UEFI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Check the current setup and find out the name of the hard disk
lsblk
# Open the disk in fdisk where you like to use
fdisk /dev/sdX
# Press button d until all existing partitions are deleted
d
# Create gpt partition table
g
# Create EFI partition
n
Enter
Enter
+512M
t
# Use EFI lable for this partition
1
# Create boot partition
n
Enter
Enter
+1G
t
2
# Use Linux lable for this partition
20
# Create LVM partition
n
Enter
Enter
Enter
Enter
t
3
# Use Linux LVM lable for this partition
44
# Write changes
w

Setup filesystems and LVM

Create Boot filesystem

Using BIOS (without UEFI)

1
2
3
# Get the name of the boot partition
lsblk
mkfs.ext4 -L boot /dev/sdX1

Using UEFI

1
2
3
4
5
lsblk
# Get the name of the EFI partition
mkfs.vfat -F 32 /dev/sdX1
# Get the name of the boot partition
mkfs.ext4 -L boot /dev/sdX2

Create LVM

Create volume group

Without encryption
1
2
3
4
# If you are using BIOS use partition 2 (/dev/sdX2)
# and if you are using UEFI use partition 3 (/dev/sdX2)
pvcreate --dataalignment 1m /dev/sdXn
vgcreate vg0 /dev/sdXn
With encryption
Note
Use a good password, but don’t forget it!
1
2
3
4
5
6
7
# If you are using BIOS use partition 2 (/dev/sdX2)
# and if you are using UEFI use partition 3 (/dev/sdX2)
cryptsetup -y -v luksFormat /dev/sdXn
#YES (Uppercase)
cryptsetup luksOpen /dev/sdXn sdXn-encrypted
pvcreate --dataalignment 1m /dev/mapper/sdXn-encrypted
vgcreate vg0 /dev/mapper/sdXn-encrypted

Create logical volumes and filesystems

Note
Minimum requirements: root: 5G home: 10G var: 20G usr: 10G
Tip
Recommended requirements for basic Laptop: root: 10G home: 50G var: 20G usr: 50G swap:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lvcreate -L 10GB vg0 -n root
mkfs.ext4 -L root /dev/mapper/vg0-root
lvcreate -L 50GB vg0 -n home
mkfs.ext4 -L home /dev/mapper/vg0-home
lvcreate -L 20GB vg0 -n var
mkfs.ext4 -L var /dev/mapper/vg0-var
lvcreate -L 50GB vg0 -n usr
mkfs.ext4 -L usr /dev/mapper/vg0-usr
lvcreate -L 5GB vg0 -n swap
mkswap /dev/mapper/vg0-swap

References