Arch Linux Installation
Diese Anleitung geht von einem x86_64 System aus mit einer Festplatte (/dev/sda), DHCP-konfiguriertem Netzwerk und Verwendung von bootctl mit UEFI.
- Setze das Tastaturlayout mit
loadkeys de_CH-latin1
. - Überprüfe den Boot-Modus mit
ls /sys/firmware/efi/efivars
. - Synchronisiere die Systemuhr mit
timedatectl
. - Listet alle Laufwerke auf und partitioniere sie mit
fdisk -l
undfdisk /dev/sdX
. - Formatieren die Partitionen. Beispielsweise:
- Ext4 für die Root-Partition:
mkfs.ext4 /dev/sda3
. - Swap erstellen:
mkswap /dev/sda2
. - EFI-Systempartition formatieren:
mkfs.fat -F 32 /dev/sda1
.
- Ext4 für die Root-Partition:
- Binde die Partitionen ins Dateisystem ein:
mount /dev/sda3 /mnt
mount --mkdir /dev/sda1 /mnt/boot
swapon /dev/sda2
.
- Installiere das Basissystem, den Kernel und die Firmware mit
pacstrap -K /mnt base linux linux-firmware
. - Generiere eine fstab-Datei mit
genfstab -U /mnt >> /mnt/etc/fstab
. - Wechsle in das neue System mit
arch-chroot /mnt
. - Setze die Zeitzone:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
undhwclock --systohc
. - Aktiviere die benötigten Sprachpakete in
/etc/locale.gen
und generiere sie mitlocale-gen
. Setze dann LANG in/etc/locale.conf
.
locales.sh
# /etc/locale.conf
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
- Stelle die Tastaturlayout-Konfiguration in
/etc/vconsole.conf
ein.
# /etc/vconsole.conf
KEYMAP=de-latin1
- Setze den Hostnamen
hostnamectl set-hostname kub-ctrl-01
. - Initialisiere RAMFS mit
mkinitcpio -P
- Installiere systemd-boot mit
bootctl --path=/boot install
. - Speichere die Block-ID in
arch.conf
mitblkid /dev/sda2 >> /boot/loader/entries/arch.conf
und bearbeite dann die Dateiarch.conf
undloader.conf
# /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID=YOUR-PARTUUID-CODE-HERE rw
# /boot/loader/loader.conf
default arch
timeout 4
console-mode max
editor no
- Aktualisiere systemd-boot mit
bootctl --path=/boot update
. - Installiere Dhclient, Network Manager und OpenSSH mit
pacman -S dhclient openssh networkmanager
und aktiviere den SSH-Dienst:systemctl enable sshd
und den Network Managersystemctl enable NetworkManager
undsystemctl enable systemd-resolved
- Setze das Root-Passwort mit
passwd
. - Füge einen neuen Benutzer hinzu:
useradd -m -g users -G wheel,power,storage -s /bin/bash username
, wobei “username” der Name des neuen Benutzers ist. - Installiere folgende Pakete für ein “modernes” Unix:
- vim
- duf
- zsh
- git
- dog
- lsd
- htop
- bat
- yq
- dust
- Starte das System neu.
Pakete zum Management:
salt: Der Salt-Master ist der nodemaster
netdata: Die Prometheus-Metriken sind im Endpoint /api/v1/allmetrics?format=prometheus
erreichbar.
Automatisieren der Installation mit Archinstall
archinstall \
--config http://nodemaster/archinstall.json \
--creds http://nodemaster/credentials.json \
--disk_layouts http://nodemaster/disks.json
Wenn man ein Template kopiert, werden auch die PARTUUID der Disks mitkopiert, was zu Problemen führen kann. Ein Workaround ist, nach dem Kopieren mit Labeln zu arbeiten:
sudo e2label /dev/sda2 root_fs_part
# /boot/loader/entries/arch.conf
options root=LABEL=root_fs_part rw
bootctl --path=/boot update
tune2fs -U random /dev/sda2