Search notes:

Installing arch linux

Creating bootable USB stick / booting

Download a *.iso file.
Finding the USB device:
lsblk
Copy the *.iso file with dd.
  dd bs=1M if=/path/to/downloaded.iso of=dev/sdX
Put USB stick into PC where it needs to be installed and turn it on.

Partitioning the hard disk

Using parted
TODO: create a msdos partition table...

TODO: creating a UEFI ESP whatever thingy

parted --align=optimal -s /dev/sda 'mklabel gpt     mkpart primary 1MiB 1GiB       mkpart primary 1GiB 6GiB        mkpart primary 6GiB 100%     t 1 boot      unit GiB    p'
-s is the flag for scripted. So I don't have to confirm anything or so, just press enter.
mklabel gpt creates a new GPT partition table. It erases the previous partition table!!!
mkpart primary 1MiB 1GiB creates a approx 1GiB (primary) partition that's going to be used for the EFI System Partition (ESP).
mkpart primary 1GiB 6GiB creates a 5 GiB (primary) partition that's going to be used for swap. It's size is 5GiB minus 1MiB.
mkpart primary 6GiB 100% creates another partition on the rest of the harddisk (that is: 100%) for the data.
t 1 boot toggles the first partition's boot flag (partition type becomes ef00).
unit GiB sets the unit for the …
p, the following print command.

Formatting and Initializing the partitions

mkswap    /dev/sda2
# ??? mkfs.fat  /dev/sda1
mkfs.fat  -F 32 -n EFIBOOT /dev/sda1
mkfs.ext4 /dev/sda3
swapon -s /dev/sda1
Verify if swap space is used:
swapon -s

Mount partition

Now that the partition is formatted, we need to mount it so that we can write the installation on it:
mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

Connecting to internet

Since pacstrap (used below) needs an internet connection to get the most recent packages from a mirror, we need to start the internet:
wifi-menu
Test the connection
ping -c 1 8.8.8.8

Updating keyring

Apparently, when installing from an old *.iso file, the keyring(?) must be updated in order to suppress a update error: key "4A1AFC345EBE18F8" could not be looked up remotely.
This »problem« can be eliminated with
pacman -Sy archlinux-keyring

Start installation

pacstrap /mnt base base-devel

Filling /etc/fstab

The /etc/fstab file (which is currently mounted to /mnt/etc/fstab) is (probably empty).
It can be filled with
genfstab -U /mnt  >  /mnt/etc/fstab
The -U flag uses UUIDs for source identifiers. By default, pseude filesystem mounts are excluded, so -p does not need to be specified.

chroot

Changing the root so as not to have to type /mnt every time.
arch-chroot /mnt /bin/bash

Various things

Specify the localtime
ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime
Set the hardware clock
hwclock --systohc --utc
Specify the hostname
echo PC-four > /etc/hostname
Change root's password:
passwd

locale

Use an editor to uncomment desired lines in /etc/locale.gen and then run
locale-gen
Apparently, it can be done even more simple:
echo LANG=en_US.UTF-8 > /etc/locale.conf

Install bootloader

pacman -S grub
grub-install /dev/sda
returned `error: cannot find EFI directory'. What is an EFI directory???
But with --target=i386-pc, it worked:
pacman -S grub
grub-install --target=i386-pc /dev/sda
pacman -S syslinux
syslinux-install_update -iam

Copy wifi connection

exit to leave chroot environment:
exit
cp /etc/netctl/tq84-wifi  /mnt/etc/netctl/tq84-wifi

See also

After installing arch linux
Install openbox on arch

Links

https://gist.github.com/mloskot/5995414
https://wiki.archlinux.de/title/Anleitung_f%C3%BCr_Einsteiger
https://wiki.archlinux.de/title/UEFI_Installation
https://wiki.archlinux.org/index.php/Beginners'_guide#UEFI.2FGPT
https://itsfoss.com/install-arch-linux/

Index