This is a clone of Arch linux official install guide, just added LVM, system drive encryption etc. This guide is the result of me doing these steps through on a virtual machine before installing on hardware.
PART 1: SETUP
Initial setup
Load Estonian keyboard layout. Set big font (I cannot see). Check UEFI bitness.
loadkeys et
setfont ter-128b
cat /sys/firmware/efi/fw_platform_size # should echo 64
Internet connection
ip link
iwctl
[iwd]# device list
ping ping.archlinux.org
Clock
timedatectl
PART 2: DISKS
Chosen configuration
Let’s go with LVM on LUKS, where
/boot(1GB) is unencryptedLUKS encrypted part(remainder) is encryptedLVM VG[SWAP](size of ram) only if I get a larger (>1TB) disk/- LVM LV- … - other LVs that I might want
This is the best setup for me, because the whole system partition is encrypted and LVM structure isn’t visible before decrypting. I can do what I want inside the encrypted partition such as adding LVs when I need/want without tampering with underlying LUKS partition.
Partitioning
fdisk -l
fdisk /dev/<disk>
create EFI system partition (/boot)
g
n
<ENTER>
<ENTER>
+1G
t
1
create system partition
n
<ENTER>
<ENTER>
<ENTER> # max size
w
LUKS container
cryptsetup luksFormat /dev/<system-part>
cryptsetup open /dev/<system-part> <container-name> # name the container anything you want
LVM
PV and VG
pvcreate /dev/mapper/<container-name>
vgcreate <vg-name> /dev/mapper/<container-name> # name the VG
LV (customize as you want)
lvcreate --size 1G vg0 --name swap
lvcreate -l +100%FREE vg0 --name root
lvreduce --size -256M vg0/root # reduce last volume
Reduce the size of last volume for e2scrub.
Filesystems
# EFI partition
mkfs.fat -F 32 /dev/<efi-part>
# SWAP
mkswap /dev/<vg-name>/swap
# root
mkfs.ext4 /dev/<vg-name>/root
# Mount
mount /dev/<vg-name>/root /mnt
mount --mkdir /dev/<efi-part> /mnt/boot
swapon /dev/<vg-name>/swap
Installation
Choose (uncomment) a mirror
vim /etc/packman.d/mirrorlist
Install initial packages
pacstrap -K /mnt base linux linux-firmware intel-ucode e2fsprogs lvm2 sof-firmware networkmanager nix neovim
Post-install configuration
Bits and bobs
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
# time zone
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
# locale
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
# root password
passwd
# console keyboard
echo "KEYMAP=et" > /etc/vconsole.conf
# hostname
echo "cappuccino" > /etc/hostname
Initramfs
Find and edit this line in /etc/mkinitcpio.conf so it looks like this:
HOOKS=(base systemd autodetect microcode modconf kms keyboard sd-vconsole block sd-encrypt lvm2 filesystems fsck)
add: keyboard, sd-vconsole, sd-encrypt, lvm2
NB! If the line starts with HOOKS=(base udev ...) instead of HOOKS=(base systemd ...), then look at the official documentation.
mkinitcpio -P
Bootloader
# bootloader
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Edit the line in /etc/default/grub so it looks like this:
GRUB_CMDLINE_LINUX="rd.luks.name=<device-UUID>=<container-name> root=/dev/<vg-name>/root"
where device-UUID can be found with
blkid /dev/<system-part> # use the UUID value, not the PARTUUID
# hack!!! append into file and then copy it inside vim
blkid /dev/<system-part> >> /etc/default/grub
You can leave other arguments that may be there already, just separate them with a space. Then run:
grub-mkconfig -o /boot/grub/grub.cfg
Last part
# reboot
exit
umount -R /mnt
reboot
READY