Skip to content

Installing Arch

Thomas Croft edited this page Jan 11, 2023 · 1 revision

This is how I've been installing Arch on my personal machines. This guide is more focused on the small details and where my setup deviates from the official Arch install guide.

Follow these steps until Partition the Disks.

I'll be using btrfs as my root filesystem with a subvolume layout similar to Ubuntu's.

Partition Disk

fdisk /dev/sda
mkfs.fat -F 32 /dev/sda1
mkfs.btrfs /dev/sda2
mount /dev/sda2 /mnt
btrfs su cr /mnt/@
btrfs su cr /mnt/@home
btrfs su cr /mnt/@var_log
btrfs su cr /mnt/@pkg
btrfs su cr /mnt/@snapshots
umount /mnt

Mount Subvolumes

mount -o subvol=@ /dev/sda2 /mnt
mkdir -p /mnt/{home,var/log,var/cache/pacman/pkg,boot,.snapshots}
mount /dev/sda1 /mnt/boot
mount -o subvol=@home /dev/sda2 /mnt/home
mount -o subvol=@var_log /dev/sda2 /mnt/var/log
mount -o subvol=@pkg /dev/sda2 /mnt/var/cache/pacman/pkg
mount -o subvol=@snapshots /dev/sda2 /mnt/.snapshots

Install the System

pacstrap -K /mnt base linux-zen linux-zen-headers linux-firmware

Configure the System

genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt

Install Additional Packages

Now's the time to add anything you may need such as a text editor or a wireless daemon.
Not everything that was included with the live installer will be installed, so if you want internet add it now!

pacman -Sy sudo neovim mand-db iwd dhcpcd

Setup Time

ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime # Replace America/Denver with your localtime
hwclock --systohc
timedatectl set-ntp true

Generate Locale

Edit /etc/locale.gen and uncomment your locale. I've uncommented en_US.UTF-8 UTF-8 and ja_JP.UTF-8 UTF-8.
After that run locale-gen and add LANG=en_US.UTF-8 to /etc/locale.conf.

Network Configuration

Now it's time to configure the network. You'll need to add your system's new hostname in /etc/hostname

127.0.0.1     localhost
::1           localhost
127.0.1.1     hostname.localdomain hostname # Replace hostname with your system's hostname

Create Accounts

First off we'll set our root account's password by typing passwd and than typing the desired password. At this point you can either create a normal user account or one with systemd-homed. I've opted for systemd-homed which requires you to create the user via homectl create username after rebooting.

Setup Sudo

Now to setup sudo. Run EDITOR=nvim sudoedit /etc/sudoers and uncomment the line that says # %wheel ALL=(ALL:ALL) ALL towards the bottom of the file. Add your user to the wheel group to allow them to use sudo.

Installing the Bootoader

I'm going to use systemd-boot as opposed to the more common grub2 as my bootloader.
To install it run bootctl install. After installing you need to add a loader entry for Arch in /boot/loader/entries/arch.conf

title Arch Linux
linux /vmlinuz-linux-zen
initrd /amd-ucode.img
initrd /initramfs-linux-zen.img
options root=UUID=d13978ec-2b3a-498a-b70e-8a842a093ead rootflags=subvol=@ rw

In order to obtain your root volume's UUID I recommend opening /etc/fstab and copying it from there.