This is a quick guide to install Arch Linux using UEFI, LVM, ex4, grub and systemd-networkd. If you don't know what you're doing, use the official installation guide on the wiki linked below. This guide is not a learning instrument.
Connect to wireless network
iwctl
device list
station <dev> scan
station <dev> get-networks
station <dev> connect <ssid>
You can use this script to execute all commands below.
curl --user "user:password" https://web.nas.reisub.io/install-arch.sh -O
curl --user "user:password" https://web.nas.reisub.io/install-arch-chroot.sh -O
chmod +x install-arch.sh
Set disk variables, always check your correct disk name and partition indices
# if using nvme
export DISK=/dev/nvme0n1
export EFIPART="$DISK"p1
export LVMPART="$DISK"p2
# if using sata
export DISK=/dev/sda
export EFIPART="$DISK"1
export LVMPART="$DISK"2
Partition disk
This will wipe any partitions on the disk. Adjust the commands as necessary or use fdisk to interactively format disks.
parted -s $DISK mklabel gpt # set partition table
parted -s $DISK mkpart primary fat32 2048s 513MiB
parted -s $DISK set 1 boot on
parted -s $DISK set 1 esp on
parted -s $DISK mkpart primary 513MiB 100%
Setup LVM
pvcreate $LVMPART
vgcreate vg00 $LVMPART
lvcreate -l +100%FREE vg00 -n lv_root
Format and mount
mkfs.ext4 /dev/mapper/vg00-lv_root
mount /dev/mapper/vg00-lv_root /mnt
mkfs.fat -F32 $EFIPART
mount --mkdir $EFIPART /mnt/efi
Install system
pacstrap /mnt base base-devel linux linux-firmware lvm2 grub efibootmgr vim networkmanager git ansible
Generate fstab
genfstab -U /mnt > /mnt/etc/fstab
Configure system
arch-chroot /mnt
export REGION=Europe
export CITY=Brussels
export LANG=en_US.UTF-8
export TIME=en_IE.UTF-8
export HOSTNAME=skoll
ln -sf /usr/share/zoneinfo/$REGION/$CITY /etc/localtime
hwclock --systohc --utc
echo $LANG UTF-8 >> /etc/locale.gen
echo $TIME UTF-8 >> /etc/locale.gen
locale-gen
echo LANG=$LANG > /etc/locale.conf
echo LC_TIME=$TIME >> /etc/locale.conf
echo $HOSTNAME > /etc/hostname
systemctl enable NetworkManager
passwd
Configure and create initramfs
sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard fsck)/' /etc/mkinitcpio.conf
# if you're using hibernation, add resume as well
sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect modconf block lvm2 resume filesystems keyboard fsck)/' /etc/mkinitcpio.conf
mkinitcpio -P
Install the correct microcode package for your CPU
pacman -S amd-ucode
pacman -S intel-ucode
Install os-prober if you have other operating systems installed
pacman -S os-prober
Configure GRUB
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
sed -i "s/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=3/" /etc/default/grub
# if using os-prober
sed -i "s/^#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=false/" /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
Unmount and reboot
exit
umount -R /mnt
reboot
Configure the system as you want or use the Ansible bootstrap playbook.