Archlinux Installation

Bios Settings

  • set the BIOS clock to GMT time zone
  • turn all virtualization optiona on

Keyboard Settings

Connect to W-Lan (TODO)

Disks

Create LUKS

cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 cryptroot

use lsblk to check if cryptroot is created

Create and mount Filesystems

see also: https://wiki.archlinux.org/index.php/EFI_system_partition#Format_the_partition

mkfs.ext4 /dev/mapper/cryptroot
mount /dev/mapper/cryptroot /mnt
mkfs.fat -F 32 /dev/nvme0n1p1
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot

Create Swap File (did not do this)

see also: https://wiki.archlinux.org/index.php/Swap#Swap_file_creation

  • TODO: Link zu Ubuntu Seite
dd if=/dev/zero of=/swapfile bs=1M count=20480 status=progress
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile

To resume from swap see: https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file

Select Mirrors

nano /etc/pacman.d/mirrorlist

Install Packages

pacstrap /mnt base linux linux-firmware
pacstrap /mnt nano gnome cryptsetup networkmanager
pacstrap /mnt efibootmgr dosfstools gptfdisk
# gen and check fstab
genfstab -U /mnt >> /mnt/etc/fstab
less /mnt/etc/fstab

#Chroot
arch-chroot /mnt

#Time zone
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc

nano /etc/locale.gen
- remove comment for de_DE UTF-8
- remove comment for en_US UTF-8
locale-gen
nano /etc/locale.conf

# see: http://www.gentoo.org/doc/en/guide-localization.xml#doc_chap3
LANG="en_US.UTF-8"
LC_TIME="de_DE.UTF-8"

nano /etc/vconsole.conf
KEYMAP=de-latin1-nodeadkeys

nano /etc/hostname
- enter hostname

nano /etc/hosts

127.0.0.1	localhost
::1		localhost
127.0.1.1	myhostname

nano /etc/mkinitcpio.conf

HOOKS=(base udev autodetect modconf block keyboard keymap encrypt filesystems fsck)


- see https://wiki.archlinux.org/title/Dm-crypt/System_configuration#mkinitcpio
- added after "block" -> "keyboard keymap encrypt"
- no `consolefont`

mkinitcpio -P

passwd

# install systemd-boot
bootctl install

systemd-boot does not accept tabs for indentation, use spaces instead.

nano /boot/loader/entries/arch.conf

title Arch Linux linux /vmlinuz-linux initrd /initramfs-linux.img options cryptdevice=UUID=701fea32-236d-49fd-a0f9-cb9f07c94703:cryptroot root=/dev/mapper/cryptroot rw


use cat to add UUID to file:
use the UUID of the base encryped partition ! NOT cryptroot

blkid >> /boot/loader/entries/arch-uefi.conf

- see https://wiki.archlinux.org/title/Systemd-boot#Adding_loaders
- see https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system#Configuring_the_boot_loader

nano /boot/loader/entries/arch-uefi-fallback.conf

nano /boot/loader/loader.conf

#timeout 3 #console-mode keep default arch.conf console-mode max editor no timeout 1


bootctl update

exit
cd /
umount -R /mnt
reboot

# create user
useradd <username> -m -s /bin/bash
passwd <username>

#gnome aktivieren
systemctl enable gdm.service
systemctl enable NetworkManager

reboot

# check heyboard layout at login!

# Gnome Settigs
- Keyboard
  - add German
  - remove en
- Mouse & Touchpad
  - Natural scolling aus
  - Tap to Click an
- check "Region & Language"
  - alle settings prüfen und synchronisieren
  - both tabs -> Language: English, Formats: all Deutschland
- Power
  - Automatic Suspend - on battery power und Plugged in aus
  - show percent


- als root ausführen: `localectl set-x11-keymap de`


# microcode
# https://wiki.archlinux.org/index.php/Microcode
pacman -S amd-ucode
# add in boot config
initrd  /cpu_manufacturer-ucode.img

# fstrim
systemctl enable fstrim.timer

# swappiness
# https://wiki.archlinux.org/index.php/Swap#Swappiness
nano /etc/sysctl.d/99-swappiness.conf

vm.swappiness=10

# sudo
pacman -S sudo
EDITOR=nano visudo
%wheel      ALL=(ALL) ALL
gpasswd -a <username> wheel

nano /etc/mkinitcpio.conf
MODULES=(amdgpu)
mkinitcpio -P

# enable aur
pacman -S --needed base-devel
nano /etc/makepkg.conf

Lenovo ThinkPad T495x specific

Mask this to avoid Boot Error

also see: https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T495s#Backlight

systemctl mask systemd-backlight@backlight:acpi_video0.service
Last modified August 14, 2022: update arch install (15ebc16)