dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress && sync
timedatectl set-ntp true
wifi-menu
We will create 2 partitions, one for boot partition and one for LUKS encrypted partition
cgdisk /dev/sdX
1 512MB EFI partition # Hex code ef00
2 100% size partiton # (to be encrypted) Hex code 8300
I will create only swap and root partitions, but here you can create home, var and other partitions if you wish.
modprobe dm-crypt
cryptsetup luksFormat /dev/sda2
cryptsetup open --type luks /dev/sda2 lvm
pvcreate /dev/mapper/lvm
vgcreate volume /dev/mapper/lvm
lvcreate -L20G volume -n swap
lvcreate -l 100%FREE volume -n root
mkfs.vfat -F32 /dev/sda1
mkfs.ext4 /dev/mapper/volume-root
mkswap /dev/mapper/volume-swap
mount /dev/mapper/volume-root /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
swapon /dev/mapper/volume-swap
pacstrap /mnt base base-devel linux linux-firmware lvm2 netctl dialog wpa_supplicant git vim tmux zsh
genfstab -U /mnt >> /mnt/etc/fstab
(If you have SSD change relatime on all non-boot partitions to noatime.)
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime
hwclock --systohc
echo <your-hostname> > /etc/hostname
passwd
useradd -m -G wheel -s /usr/bin/fish <username>
passwd <username>
Uncomment en_US.UTF-8 UTF-8 and other needed localizations in /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo KEYMAP=<your-keymap> > /etc/vconsole.conf
locale-gen
bootctl --path=/boot install
Edit /etc/mkinitcpio.conf
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt lvm2 filesystems keyboard fsck)
Create /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=<DEVICE-UUID>:volume root=/dev/mapper/volume-root rw
(use :r ! blkid /dev/sda2 -sUUID -ovalue
in vim to get the device UUID)
Edit /boot/loader/loader.conf
default arch
timeout 3
editor yes
mkinitcpio -p linux
exit
umount -R /mnt
reboot