Arch Linux Installation : Part 1

Arch Linux Installation : Part 1

18 Sep 2020, 12:52pm TZ +05:30
linux, Arch
Software, tips

I am using Manjaro Linux for a while now. May be more than 2 years now. Though its Arch Linux based you still have supporting wrappers.

Having your own custom install of Linux was far dream. I had tried my luck with debian and failed to get close to Ubuntu.

This time, it was different.

Linux was running the Windows in VM now !

It was my time to take the next step.

My tryst with Arch Linux Installation

This is the Part 1 in the series. This part deals with creation of Installation Media, Internet connection and making the installer usable.

Expectations #

Here are the key tenets that, I am looking for in my Arch Linux Installation:

  1. UI Should resemble Manjaro - I liked the Theme and tooling of Manjaro GNOME Edition.

  2. Should use Secure update sources from the beginning - I have written about this earlier .

  3. Should be repeatable on multiple types of hardware - With Arch Linux support I saw while using Manjaro, this one should be fairly easy to achieve.

  4. Possibility of having the installation done on an fully encrypted disk using LUKS.

I have broken down the installation into Stages. This helps to detail the instructions.

Arch Linux wiki does a terrific job in explaining the install process.

However, for newbies this can be a formidable challenge. Hence, my approach is to break it down and try to script the way. Some of the stages can’t be scripted due their explicit nature. However most others can be done using shell scripts.

Stage : Installation Media [IM] #

In this sage we look at how to download the correct install medium. And also the verify if its genuine.

IM Step-1. Get the Arch Linux Image #

Download the Latest ISO from wide selection of mirrors arround the world.

https://www.archlinux.org/download/#download-mirrors

In my case, I use the rackspace.com mirror.

When you open the page it looks like:

Index of /archlinux/iso/2020.10.01
Parent Directory
arch/
archlinux-2020.10.01-x86_64.iso
archlinux-2020.10.01-x86_64.iso.sig
archlinux-2020.10.01-x86_64.iso.torrent
archlinux-bootstrap-2020.10.01-x86_64.tar.gz
archlinux-bootstrap-2020.10.01-x86_64.tar.gz.sig
md5sums.txt
sha1sums.txt
Rackers - More on this mirror here: https://rax.io/mirrorfaq

This might appear confusing at first but is actually very simple.

We need the ISO file hence we first need archlinux-2020.10.01-x86_64.iso. This the ISO we are looking to create the Install Media.

IM Step 2 - Image Verification #

Next, in order to verify the file we need two more files from the same location.

  • sha1sums.txt This is the SHA-1 signature of all the files present in the Hosted directory.

  • archlinux-2020.10.01-x86_64.iso.sig This is the GPG signature file for the current release of the ISO file.

Files Selection

If you download the install media using torrent .i.e. archlinux-2020.10.01-x86_64.iso.torrent, you would not need to download the sha1sums.txt. Since torrents would automatically do that for you.

IMS 2.1. - Verifying the Integrity Using SHA-1 hash #

Verification of the content is done using the SHA-1 Hash.

shasum -c sha1sums.txt
...
## Output
archlinux-2020.10.01-x86_64.iso: OK
shasum: archlinux-bootstrap-2020.10.01-x86_64.tar.gz: No such file or directory
archlinux-bootstrap-2020.10.01-x86_64.tar.gz: FAILED open or read
shasum: WARNING: 1 listed file could not be read

The important line is "archlinux-2020.10.01-x86_64.iso: OK". This means that we have successfully verified the Integrity of the ISO.

IMS 2.2. - Verifying the Authenticity using GPG Signature #

This time we would use the GPG Signature stored in archlinux-2020.10.01-x86_64.iso.sig.

You can get the Public keys used in Publishing Arch Linux here:

https://www.archlinux.org/master-keys/
# Download the Public key to local keyring & Verify
gpg --keyserver-options auto-key-retrieve \
 --keyserver pgp.mit.edu \
 --verify archlinux-2020.10.01-x86_64.iso.sig
...
## Output
gpg: assuming signed data in 'archlinux-2020.10.01-x86_64.iso'
gpg: Signature made Thursday 01 October 2020 08:53:32 PM IST
gpg:                using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
gpg: Good signature from "Pierre Schmitz <pierre@archlinux.de>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 4AA4 767B BC9C 4B1D 18AE  28B7 7F2D 434B 9741 E8AC

The important line is "gpg: Good signature from "Pierre Schmitz <pierre@archlinux.de>" [unknown]". This means that our Arch Install ISO is indeed Authentic.

IM Step-2. Create the Boot-able Media (a.k.a Live Medium) #

There are many methods explained the Arch Linux wiki, for creating a USB drive Installation medium:

https://wiki.archlinux.org/index.php/USB_flash_installation_medium

The one I used dd:

# Write the File
sudo dd bs=4M if=$ISO_Path of=$USB_DISK_DEVICE status=progress oflag=sync
...
## Output
714080256 bytes (714 MB, 681 MiB) copied, 194 s, 3.7 MB/s
170+1 records in
170+1 records out
714080256 bytes (714 MB, 681 MiB) copied, 194.359 s, 3.7 MB/s

Where $ISO_Path is the location of the ISO file. And $USB_DISK_DEVICE is the /dev/sdx path to the USB Device.

If you are not sure of which USB Disk Device to Use just give the command

lsblk

You can find out out by looking at the size and their respective mount point.

Here I have used dd its a very powerful command. If you specify the wrong device you can potentially damage the drives. Hence be careful while using this. Or, If you don’t want to take risk use : For GNOME

gnome-multi-writer

For Generic Use :

Etcher

If you are on Windows use

Rufus

IM Step-3. Remove the media (optional) #

In case you wish to remove the media after writing through dd, there are few special steps.

...
## Check the Drive Where its mounted
lsblk
...
 └─sdb2        8:18   0 246.9G  0 part 
 sdc           8:32   1   3.7G  0 disk 
 ├─sdc1        8:33   1   681M  0 part /run/media/bt/ARCH_202010
 └─sdc2        8:34   1    56M  0 part 
...
## Un-mount the Volume Manually
sudo umount /run/media/bt/ARCH_202010

You can do something similar using nautilus or Removable Drive Menu.

IM Step-4. Test out the Live Medium (optional) #

We can also test the USB drive we just created using QEMU in KVM. You need to have a working setup for Virtualization for that.

1
2
3
4
# For BIOS based PC
sudo qemu-system-x86_64 -m 8G /dev/sdx
# For UEFI based PC
sudo qemu-system-x86_64 --bios /usr/share/edk2-ovmf/x64/OVMF.fd -m 8G /dev/sdx

You can refer to my earlier article Installing KVM/QEMU on Manjaro

Stage : Initialize Installation [II] #

Now, that we have the Install media ready and verified - we are good the begin the installation. This stage mainly deals with nuances of first timers. We need to get the installer configured right to even begin installing.

II Step-1. Boot into the Live Medium #

Typically if the disk already has an OS then it would start automatically at power-up.

You can prevent that and enter USB Boot by

  • either interrupting the normal boot process - generally ESC or Enter key

  • entering the BIOS - generally Del or F2 or F8 key

  • Using Boot device selection menu - generally F12 or F8 key

The USB drive would appear in the UEFI Boot device selection menu. Select that in the list and Press Enter to begin the booting.

Since, we are using USB media it takes some time to boot-up. Be patient and you would see the beginnings of the Arch Linux boot.

After the boot process is complete you would get the Root prompt:

Arch Linux 5.8.12-arch-1 (tty1)
...
root@archiso ~ #

Initially the Font’s used in the installation are too small. Hence we need to fix that.

II Step-2. Fix difficult to see small fonts of the Console #

The default font use by Arch Linux installation console is not that great.

So we need to fix that.

Typically there are lot of console fonts:

https://alexandre.deverteuil.net/docs/archlinux-consolefonts/

Scroll the list down and you can find the whole list.

These fonts reside in the /usr/share/kbd/consolefonts folder.

In my case I use the following:

setfont sun12x22.psfu.gz

Here is the link to this font , as how it looks.

If you want even bigger font:

setfont solar24x32.psfu.gz

II Step-3. Fix the Locale & Keyboard #

Many of us might have different keyboards than the usual US 105-Key-International. This might be the default, we can change it easily.

To check which layout is currently set:

locale -a
...
# Output
C
en_US.utf8
POSIX

This is the default and should work for most of the cases. However, some of us might want to enable our specific country locale and keyboards.

To list out all the key-maps available and find the right one for us:

# Search for US keyboards
localectl list-keymaps | grep us
## Output
...
us
us-acentos
us1

We only need us type - this is also the default.

Here is how you can set the keymap:

loadkeys us

In our case we configured us but your choice might vary based on your keyboard.

With this basic keyboard configuration you are good to go.

II Step-4. Setup Internet Connection #

In order to install Arch Linux we would need to download most of the packages. Hence, having internet connection is important.

OSS 4.1. Check Connection #

To check if you have internet access:

ip addr show
## Or the Shorter Version
ip a

It should show up all the interfaces. Look for any which have acquired IP addresses. For Ethernet based connection it would be done by default.

If you see the IP address then you are good to begin the testing step.

IIS 4.2. Setup WiFi for Installation #

The current way that ArchISO uses a wireless tool called iwd . This program has a interactive command-response interface for command-line. It can be started using the command iwctl.

iwctl
# Prompt
[iwd]#

Here you can type help to get the list of commands possible.

Find Devices #

Find out the attached or built-in WiFi adapters.

[iwd]# device list

Get Networks #

We now need to use the device name that appeared in the pervious command.

We assume that the WiFi adapter is listed as wlan0 :

[iwd]# station wlan0 scan
...
[iwd]# station wlan0 get-networks

Connect to the Network #

Once we have the list of scanned network in proximity its time to connect.

[iwd]# station wlan0 connect wifiaccesspoint

Here we are attempting to connect to WiFi network called wifiaccesspoint. If the network is secured a password need to be entered.

Exit IWD #

We are done and the WiFi would remain connected.

[iwd]# exit

Quickest way to connect #

iwctl --passphrase <password> station <device> connect <SSID>

This is direct command. However remember that supplying passwords in commands is not a good for security.

For More detailed insight #

https://wiki.archlinux.org/index.php/Iwd

IIS 4.3. Test Connection #

In order to check the connection we would ping the archlinux.org website.

ping -c 5 archlinux.org
...
# Output
PING archlinux.org (138.201.81.199) 56(84) bytes of data.
64 bytes from apollo.archlinux.org (138.201.81.199): icmp_seq=1 ttl=50 time=150 ms
64 bytes from apollo.archlinux.org (138.201.81.199): icmp_seq=2 ttl=50 time=154 ms
64 bytes from apollo.archlinux.org (138.201.81.199): icmp_seq=3 ttl=50 time=153 ms
64 bytes from apollo.archlinux.org (138.201.81.199): icmp_seq=4 ttl=50 time=152 ms
64 bytes from apollo.archlinux.org (138.201.81.199): icmp_seq=5 ttl=50 time=150 ms

--- archlinux.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 150.355/152.018/154.209/1.501 ms

If you see the above output, you are ready. Other wise try to look at the WiFi connection or use a Ethernet connection.

Great ! You made strides of progress #

This should get you ready with the Internet connection and configuration of the Arch Linux setup console.

Hope to see you in the next parts.

This is the Part 1 in the series. This part deals with creation of Installation Media, Internet connection and making the installer usable.

Reference #