My mini Arch docs :>

Hello future me :>
This little doc is a guide for (re-)installing Arch Linux, the following instructions should not be treated as a bible, please read them alongside the official documentation.


Installation

0. Warm-up


0.1 Set keyboard layout

# loadkeys pl

0.2 Check if this line returns "64"

# cat /sys/firmware/efi/fw_platform_size


1. Internet


1.1 Connect to Wi-Fi

# iwctl
# iwd $ device list
# iwd $ station wlan0 scan
# iwd $ station wlan0 get-networks
# iwd $ station wlan0 connect "name in quotation marks"

Press Ctrl + D to exit iwd.

1.2 Verify connection

If you want to verify your connection, you can ping a site, like:

# ping ping.archlinux.org

or:

# ping google.com

Press Ctrl + C to stop pinging.


2. Clock synchronisation


# timedatectl
# timedatectl set-timezone Europe/Warsaw
# timedatectl status


3. Partitioning


In this step, for the love of god, DO NOT TOUCH THE **EFI** PARTITION

3.1 Creating partitions

First, check your partitions:

# fdisk -l

Your device should usually be something like /dev/nvme0n1, and all the ...p1, ...p2, ...p3 etc. are its partitions.
When you want to manipulate the partitions, like change their size or type, you have to enter that main device and work from there.

# fdisk /dev/nvme0n1

*Please make sure to type the actuall device name here, according to the output of fdisk -l. It doesn't always have to be /dev/nvme0n1.

Before setting sizes of root and swap, you could delete the existing ones and make new ones.

Deleting a partition:

: d
: (pick a number of the partition you want to delete)


Creating a new partition:

: n
: (partition number, can be default)
: (start point, leave the default one)
ck : (end point, example:) +90GB


Setting partition type:

: l (to list the types)
: t
: (number of partition)
: (type, for example:) Linux swap

For root, I used Linux filesystem, and it's probably what I would go with again.

3.2 Formatting partitions

root :

# mkfs.btrfs /dev/nvme0n1p...


THE *BTRFS* IS CRUCIAL HERE!
Previously, I used ext4 instead of btrfs.
Formatting to btrfs in this step is one of the main reasons for reinstallation.

swap :

# mkswap /dev/nvme0n1p...

Obviously replace "..." with root and swap partition numbers accordingly.

4. Mounting partitions


# mount /dev/(root partition) /mnt
# mount --mkdir /dev/(EFI partition) /mnt/boot
# swapon /dev/(swap partition)

Technically, you can also mount /home, but it's pretty pointless now, as you'll still have to do that every time you reboot.

# mount /dev/(home partition) /home


5. Sorting mirrors


It's not a necessary step, you might as well skip it.
Keep in mind sorting does take a while.

# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
# pacman -Sy pacman-contrib
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist


6. Installing packages


6.1 Start with the most important one:

# pacstrap -K /mnt base linux linux-firmware


6.2 Microcode for CPU updates:

There will most likely be conflicting files from previous instalation.
You might want to remove the existing files before installation.


# rm /mnt/boot/amd-ucode.img
# pacstrap /mnt amd-ucode


6.3 Some useful stuff:

Please look further into anything you're not sure you need.


# pacstrap /mnt base-devel linux-headers efibootmgr sof-firmware