Download Arch Linux iso file: https://www.archlinux.org/download/
Plug and identify your USB flash drive
lsblk
Unmount if necessary
umount /run/media/<user>/<uuid>
Create bootable USB
sudo dd if=archlinux-2017.03.01-dual.iso of=/dev/sdX status=progress bs=4M && sync
Load proper keyboard layout
loadkeys fi
Connect to Wi-Fi
wifi-menu
Test connection
ping -c 3 google.com
Identify devices
lsblk | grep -v "rom\|loop\|airoot"
Creates 2 partitions, one EFI System Partition and one ext4 partition for LUKS
parted /dev/sda
mklabel gpt
mkpart ESP fat32 1MiB 513MiB
set1 boot on
mkpart primary ext4 513MiB 100%
quit
Verify partitions
lsblk /dev/sda
Set EFI partition to use FAT32 file system
mkfs.vfat -F32 /dev/sda1
cryptsetup -c aes-xts-plain64 -y --use-random luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 luks
Creates 3 partitions; 16GB swap, 128GB /home and rest for /root.
pvcreate /dev/mapper/luks
vgcreate vg0 /dev/mapper/luks
lvcreate --size 16G vg0 --name swap
lvcreate --size 128G vg0 --name home
lvcreate -l 100%FREE vg0 --name root
mkswap /dev/mapper/vg0-swap
mkfs.ext4 /dev/mapper/vg0-home
mkfs.ext4 /dev/mapper/vg0-root
swapon /dev/mapper/vg0-swap
mount /dev/mapper/vg0-root /mnt
mkdir /mnt/home
mount /dev/mapper/vg0-home /mnt/home
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
pacstrap /mnt base base-devel
genfstab -U -p /mnt >> /mnt/etc/fstab
Edit fstab and change all relatime
values on non-boot partitions to noatime
to reduce SSD wear
arch-chroot /mnt
Uncomment line: en_US.UTF-8 UTF-8
nano /etc/locale.gen
Generate locale
locale-gen
Set LANG variable
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
ln -s /usr/share/zoneinfo/Europe/Helsinki /etc/localtime
hwclock --systohc --utc
echo <hostname> > /etc/hostname
passwd
pacman -S iw wpa_supplicant dialog
useradd -m -G wheel -s /bin/bash <username>
passwd <username>
Uncomment following line from /etc/sudoers
%wheel ALL=(ALL) ALL
Edit /etc/mkinitcpio.conf
Add ext4
to MODULES
MODULES="ext4
Add encrypt
and lvm2
to HOOKS
before filesystems
HOOKS="base udev autodetect modconf block keymap encrypt lvm2 filesystems keyboard fsck"
Regenerate initrd image
mkinitcpio -p linux
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub_uefi --recheck
Edit /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:luks:allow-discards"
grub-mkconfig -o /boot/grub/grub.cfg
efibootmgr -c -g -d /dev/sda -p 1 -w -L "Arch Linux (GRUB)" -l /EFI/grub_uefi/grubx64.efi
exit
umount -R /mnt
swapoff -a
reboot