arch-platform
Introduction
This document describes disk partitioning and installation of the minimal Arch Linux system with LVM-in-LUKS, systemd-boot and network capabilities.
Created at 2022-05-22T23:58:54Z and not so well maintained as I rarely use it.
Create installation medium
- Download via torrent
- Verify:
sha256sum <path> | grep <checksum> - Find usb device name:
lsblk - Create installation medium:
dd if=<path> of=/dev/<device> bs=1MiB
Install
- Boot to USB image
- On loader screen press
e, appendnomodesetthe at end oflinuxcommans - Partitioning:
parted <disk>(see name vialsblk)
mklabel gpt
mkpart ESP fat32 1MiB 513MiB
set 1 boot on
mkpart primary ext4 514MiB 100%
quit
- Encrypt & open:
cryptsetup luksFormat <disk>p2
cryptsetup luksOpen <disk>p2 <diskname>p2_crypt
- Create volumes:
pvcreate /dev/mapper/<diskname>p2_crypt
vgcreate main /dev/mapper/<diskname>p2_crypt
lvcreate -L <RAM+2G>G main -n swap
lvcreate -L <N>G main -n root
lvcreate -l 100%FREE main -n home
- Create FS:
mkfs.ext4 /dev/mapper/main-root
mkfs.ext4 /dev/mapper/main-home
mkswap /dev/mapper/main-swap
mkfs.fat -F32 /dev/<disk>p1
- Mount:
mount /dev/mapper/main-root /mnt
mkdir /mnt/home /mnt/boot
mount /dev/mapper/main-home /mnt/home
mount /dev/nvme0n1p1 /mnt/boot
swapon /dev/mapper/main-swap
- Wifi setup (if needed)
iwctl device list
iwctl station [device] connect [network_name]
- Update keyring (iso may be too old):
pacman -Sy archlinux-keyring - Install (for wifi you also need
networkmanager):
pacstrap -i /mnt base linux linux-firmware intel-ucode lvm2 sudo vim polkit
- Disks:
genfstab -U /mnt >> /mnt/etc/fstab - Change root:
arch-chroot /mnt - Add loader hooks:
vim /etc/mkinitcpio.conf, set
HOOKS=(base udev autodetect microcode keyboard keymap modconf block encrypt lvm2 filesystems fsck)`
- Make initrams:
mkinitcpio -p linux - Install bootloader:
bootctl install --path=/boot - Save disk UUID:
cryptsetup luksUUID /dev/<disk>p2 > /boot/loader/entries/arch.conf - Make boot config:
vim /boot/loader/entries/arch.conf
title Arch
linux /vmlinuz-linux
initrd /initramfs-linux.img
options quiet loglevel=3 cryptdevice=UUID=[uuid]:[disk_name]p2_crypt root=/dev/mapper/main-root rw resume=/dev/mapper/main-swap
- Make generic boot config:
vim /boot/loader/loader.conf, setdefault arch - Create sudo group:
groupadd -g 1000 sudo - Grant privileges:
visudo, uncomment or add line%sudo ALL=(ALL:ALL) ALL - Add user
groupadd -g 2000 <username>
useradd -m --groups sudo --gid 2000 --uid 2000 <username>
passwd <username>
exit,rebootinto real system- login,
sudo su - Uncomment locale in
/etc/locale.gen, runlocale-gen echo "<name>" > /etc/hostname- Get tz from
tzselect, set viatimedatectl set-timezone [tz]