2 private links
These are my instructions for installing Arch Linux onto a UEFI system and setting it up to use a BTRFS file system with subvolumes. It will also include installing the KDE Plasma 6 desktop environment and SDDM display manager. This will be a succinct cheat sheet to help get you quickly get set up with a fully-fuctional Arch system. If you need a more comprehensive Arch installation guide, visit the Arch Wiki. Let's get 'er done!
Preparing system for install
Run ping command to ensure network connectivity.
ping -c 10 www.google.com
Enable Network Time Protocol (NTP).
timedatectl set-ntp true
timedatectl status
Find out the naming convention of your drive's partition (e.g. /dev/sda, /dev/vda, /dev/nvme0n1).
lsblk
Create partitions. You'll need an EFI partition and a Linux filesystem partition, swap is optional.
gdisk /dev/vda
o
n 1 (default) +512m ef00 # EFI system partition
n 2 (default) +4g 8200 # Linux swap (optional, same size as RAM)
n 3 (default) (default) 8300 # Linux filesystem (if no swap - change partition number to 2)
w
Create filesystems.
mkfs.vfat /dev/vda1
mkswap /dev/vda2
mkfs.btrfs /dev/vda3
Create subvolumes on BTRFS filesystem.
mount /dev/vda3 /mnt
btrfs su cr /mnt/@
btrfs su cr /mnt/@home
btrfs su cr /mnt/@snapshots
btrfs su cr /mnt/@log
umount /mnt
Mount BTRFS partition and subvolumes to /mnt.
mount -t btrfs -o noatime,compress=lzo,space_cache=v2,subvol=@ /dev/vda3 /mnt
mkdir -p /mnt/{boot,home,.snapshots,var}
mkdir -p /mnt/var/log
mkdir -p /mnt/boot/efi
mount -t btrfs -o noatime,compress=lzo,space_cache=v2,subvol=@home /dev/vda3 /mnt/home
mount -t btrfs -o noatime,compress=lzo,space_cache=v2,subvol=@snapshots /dev/vda3 /mnt/.snapshots
mount -t btrfs -o noatime,compress=lzo,space_cache=v2,subvol=@log /dev/vda3 /mnt/var/log
mount /dev/vda1 /mnt/boot/efi
swapon /dev/vda2
Arch Installation
Install Arch base packages and other useful ones to /mnt.
pacstrap -i /mnt base base-devel mkinitcpio linux linux-headers linux-lts linux-lts-headers linux-firmware nano vim git os-prober grub grub-btrfs btrfs-progs efibootmgr networkmanager gvfs falkon gparted clamav clamtk gufw network-manager-applet gnome-keyring terminator flatpak htop plasma sddm
Generate Fstab file and then inspect the contents of it.
genfstab -U -p /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
Chroot into new installation.
arch-chroot /mnt
Configure system locale(s) by editing /etc/locale.gen file using the text editor of your choice. Locate and uncomment the line of your locale (e.g. en_US UTF-8).
Generate locale file.
locale-gen
Set timezone (modify for your timezone if different).
ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime
Set hardware clock.
hwclock --systohc --utc
Enable multilib repository by editing the /etc/pacman.conf file. Locate the line shown below and uncomment it. Should look like this:
[multilib]
include = /etc/pacman.d/mirrorlist
Ensure multilib repository is working and also update all repositories.
pacman -Sy
Set system hostname.
echo yourhostname >> /etc/hostname
Change password of root.
Note: You will be prompted to enter a password and then will be prompted to reenter it for confirmation.
passwd
Create a standard non-root user account.
useradd -m -g users -G wheel -s /bin/bash yourname
Set password for new user.
passwd yourname
Edit sudoers file to allow newly created user to run commands and programs as if they were root.
EDITOR=nano visudo
Locate the line shown below and uncomment it. Should look like this:
%wheel ALL=(ALL) ALL
Create system initial ramdisk environment for standard Arch kernel.
mkinitcpio -p linux
Create system initial ramdisk environment for Arch LTS kernel.
mkinitcpio -p linux-lts
Install GRUB EFI bootloader.
grub-install /dev/vda --efi-directory=/boot/efi
Update GRUB configuration file.
grub-mkconfig -o /boot/grub/grub.cfg
Exit chroot environment
exit
Reboot system
reboot