workspace/arch-platform/README.md
2025-04-20 21:36:44 +00:00

3.1 KiB

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

  1. Download via torrent
  2. Verify: sha256sum <path> | grep <checksum>
  3. Find usb device name: lsblk
  4. Create installation medium: dd if=<path> of=/dev/<device> bs=1MiB

Install

  1. Boot to USB image
  2. On loader screen press e, append nomodeset the at end of linux commans
  3. Partitioning: parted <disk> (see name via lsblk)
mklabel gpt
mkpart ESP fat32 1MiB 513MiB
set 1 boot on
mkpart primary ext4 514MiB 100%
quit
  1. Encrypt & open:
cryptsetup luksFormat <disk>p2
cryptsetup luksOpen <disk>p2 <diskname>p2_crypt
  1. 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
  1. 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
  1. 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
  1. Wifi setup (if needed)
iwctl device list
iwctl station [device] connect [network_name]
  1. Update keyring (iso may be too old): pacman -Sy archlinux-keyring
  2. Install (for wifi you also need networkmanager):
pacstrap -i /mnt base linux linux-firmware intel-ucode lvm2 sudo vim polkit
  1. Disks: genfstab -U /mnt >> /mnt/etc/fstab
  2. Change root: arch-chroot /mnt
  3. Add loader hooks: vim /etc/mkinitcpio.conf, set
HOOKS=(base udev autodetect microcode keyboard keymap modconf block encrypt lvm2 filesystems fsck)`
  1. Make initrams: mkinitcpio -p linux
  2. Install bootloader: bootctl install --path=/boot
  3. Save disk UUID: cryptsetup luksUUID /dev/<disk>p2 > /boot/loader/entries/arch.conf
  4. 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
  1. Make generic boot config: vim /boot/loader/loader.conf, set default arch
  2. Create sudo group: groupadd -g 1000 sudo
  3. Grant privileges: visudo, uncomment or add line %sudo ALL=(ALL:ALL) ALL
  4. Add user
groupadd -g 2000 <username>
useradd -m --groups sudo --gid 2000 --uid 2000 <username>
passwd <username>
  1. exit, reboot into real system
  2. login, sudo su
  3. Uncomment locale in /etc/locale.gen, run locale-gen
  4. echo "<name>" > /etc/hostname
  5. systemctl enable NetworkManager --now
  6. Enable and sync time: systemctl enable systemd-timesyncd --now
  7. Get tz from tzselect, set via timedatectl set-timezone [tz]
  8. Update hwclock: hwclock -w --utc