Arch linux installation¶
Download .iso from https://www.archlinux.org/download
Then write the iso to a bootable flash, where X is the flash device identifier. (can be found using lsblk
command).
dd if=/path/to/image.iso of=/dev/sdX
Reboot computer and boot into the arch stick.
Check for efivars and internet connection.
ls /sys/firmware/efi/efivars
ping archlinux.org
If the efivars returns a list of files instead of an error, you will need to make an EFI partition in later steps.
Format drives¶
fdisk -l
fdisk /dev/sdX
Where X is the drive you want to install the arch to. This will open an interface where you can manage drive partitions, to delete them all - enter
the command d
a few times.
Create EFI partition (skip if no efivars found)¶
- Press n
- Select p (primary)
- Press enter (1)
- Press enter (start at the very start)
- Write
+550M
- this will create a 550M partition
Create boot partition (skip if efivars found)¶
- Press n
- Select p (primary)
- Press enter (2)
- Press enter (start at the very start)
- Write
+200M
- this will create a 200M partition
Create SWAP partition¶
- Press n
- Select p
- Enter
- Enter
- +24G -- 150% of RAM
Create / root partition¶
Later on switched to using root `/` and home `/home` in the same partition because
sometimes by root directory would run out of space because of docker images, which sometimes becomes annoying to deal with.
Could have increased the root partition, but aside from that, I don't really need that much.
- Press n
- Select p
- Enter
- Enter
- +50G
Create /home partition¶
- Press n
- Select p
- Enter
- Enter
- Enter (takes up the rest of the drive)
Apply changes¶
There are no changes made to the drive yet. To apply them press w
. Note that it will wipe your hd clean and all the data on it will be lost.
Make file systems¶
mkfs.ext4 /dev/sda1 or mkfs.fat -F32 /dev/sda1 # (no efivars vs efivars)
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda4
mkswap /dev/sda3
Mount drives¶
mount /dev/sda3 /mnt
mkdir -p /mnt/boot /mnt/home /mnt/efi
mount /dev/sda2 /mnt/boot
mount /dev/sda1 /mnt/efi
mount /dev/sda4 /mnt/home
Install Arch¶
pacstrap /mnt base base-devel
Write the mounts to fstab
¶
genfstab /mnt -U >> /mnt/etc/fstab
Change root to freshly installed arch¶
arch-chroot /mnt
Apply time settings & locales¶
ln -sf /usr/share/zoneinfo/Europe/Riga /etc/localtime
hwclock --systohc
nano /etc/locale.gen # uncomment wanted locales
locale-gen
nano /etc/locale.conf # put LANG=en_US.UTF-8
nano /etc/hostname # put your machine hostname like `davis-arch`
Set up hosts¶
nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 davis-arch.localdomain davis-arch
Change root password¶
passwd
Install grub¶
pacman -S grub os-prober
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
Install network manager¶
pacman -S networkmanager
systemctl enable NetworkManager
Exit setup¶
Press CTRL+d
or exit
and type reboot
.