- Identify the disk to format/partition:
gdisk <DISK>
- Partition 1: EFI (ef00) 512MB
- Partition 2: Linux LVM (8e00) Remainder
- Format boot partition:
mkfs.fat -F32 <PARTITION-1>
- Encrypt the disk:
cryptsetup luksFormat <PARTITION-2>
- Open the disk:
cryptsetup open --type luks <PARTITION-2> cryptlvm
- The decrypted container is now available at
/dev/mapper/cryptlvm
.
- Create a physical volume:
pvcreate /dev/mapper/cryptlvm
- Create a volume group:
vgcreate volume /dev/mapper/cryptlvm
- Create logical volumes on the volume group:
lvcreate -L64G volume -n root
lvcreate -l 100%FREE volume -n home
lvreduce -L -256M volume/home
- Format filesystems on each logical volume:
mkfs.ext4 /dev/volume/root
mkfs.ext4 /dev/volume/home
- Mount the filesystems:
mount /dev/volume/root /mnt
mount --mkdir /dev/volume/home /mnt/home
mount --mkdir <PARTITION-1> /mnt/boot
- Install necessary packages:
pacstrap /mnt base base-devel linux linux-firmware lvm2 amd-ucode nano
- Generate fstab:
genfstab -U /mnt >> /mnt/etc/fstab
- chroot into the system:
- Set time locale:
ln -sf /usr/share/zoneinfo/Canada/Eastern /etc/localtime
- Set clock:
- Edit
/etc/locale.gen
and uncomment desired localizations (en_CA.UTF-8 UTF-8
).
- Run
locale-gen
.
- Create locale config:
locale > /etc/locale.conf
- Edit with appropriate language code (
LANG=en_CA.UTF-8
).
- Add a hostname:
- Update
/etc/hosts
with hostname:
127.0.1.1 <HOSTNAME>.localdomain <HOSTNAME>
- Update mkinitcpio hooks (
/etc/mkinitcpio.conf
):
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block encrypt lvm2 filesystems fsck)
- Regenerate initramfs:
- Install bootloader:
bootctl --path=/boot/ install
- Create bootloader (
/boot/loader/loader.conf
):
default arch
timeout 3
editor 0
- Create bootloader entry (
/boot/loader/entries/arch.conf
):
- <PARTITION-2 UUID> can be obtained via the
blkid <PARTITION-2>
command.
title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options cryptdevice=UUID=<PARTITION-2 UUID>:cryptlvm:allow-discard root=/dev/volume/root quiet rw
- Set root password:
passwd
- Exit chroot:
exit
- Unmount:
- Reboot:
reboot
- Enable TRIM:
sudo systemctl enable --now fstrim.timer
- Improved encrypted SSD performance:
sudo cryptsetup --allow-discards --perf-no_read_workqueue --perf-no_write_workqueue --persistent refresh cryptlvm
- If dual-booting with Windows:
- Keep Windows time in sync with Linux:
sudo timedatectl set-local-rtc 1 --adjust-system-clock
- Enable NTP:
timedatectl set-ntp true
- Create user:
useradd -m -G wheel <NAME>
- Setup
systemd-networkd
and systemd-resolved
:
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolve.conf
sudo systemctl enable --now systemd-networkd
sudo systemctl enable --now systemd-resolved
- Create
/etc/systemd/system/[email protected]/autologin.conf
with the following contents:
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin username %I $TERM