This is my first time installing Arch Linux, and first time installing a Linux distro (apart from WSL ofc) in an actual pc or laptop for the past 3 or 4 years? Last time it's installing a Ubuntu somewhere.
To be frank before doing this, I have absolutely no idea what to do after selecting the USB drive from the boot menu. It is also a unknown field for me of how hardware boot OS and specifically Linux.
Thanks to the Internet. I get most steps from Installation Guide and ChatGPT, and from some Reddit posts as well. Some information here may not be correct or precise.
Download image from a mirror site
The ISO image contains:
- A mini Linux environment that can run directly from a USB stick (called a "live system")
- All the tools and files needed to install Arch
- A special structure that allows it to boot directly from the USB
This ISO will create a separate and bootable environment (the mini Arch "live system") to boot the computer and give me necessary tools to format disks, create partitions and actually install Arch Linux into the laptop.
Burn the ISO into USB drive with Rufus
Choose "ISO Image mode (Recommended)" when prompted after clicking "START".
Spamming F12 during start-up page with Lenovo LOGO to enter the Boot Menu
Select the USB drive we just burnt the ISO and press enter
Now we are in a mini live system with some tools. Next is to install the Arch Linux into the disk and make it so that when the laptop powers on, it automatically loads Arch Linux from the laptop disk.
So how do we make our laptop do this?
Frist we need to know UEFI: UEFI is something that runs before the operating system loads, responsible for initializing hardware and preparing the system for booting. It is a modern replacement for the traditional BIOS in computers. UEFI will make instructions to laptop on how to start up and get ready for starting the system:
From Arch Linux wiki: "Under UEFI, every program whether it is an operating system loader or a utility (e.g. a memory testing or recovery tool), should be an EFI application corresponding to the UEFI firmware bitness/architecture."
Thus, we need to create a a small special partition on the disk — usually 100–512MB, formatted as FAT32. This is called the: EFI System Partition (ESP).
Basically after we power on the laptop, UEFI will:
- Initializes your hardware
- Looks for a bootloader in the EFI System Partition
- Executes the bootloader
- The bootloader loads your OS (Arch Linux)
A bootloader is a small program that gets executed after your computer powers on, but before your operating system runs. It loads your actual Linux system (kernel, initramfs, etc.) from your root partition. That’s why we install GRUB into the EFI partition, and configure it to point to your Arch system.
For this, we will be using GRUB (GRand Unified Bootloader), the most popular bootloader in Linux.
Connect to the WIFI
iwctl
# Now we are inside the prompt
device list # find your wifi device, here it is wlan0
station wlan0 scan
station wlan0 get-networks
station wlan0 connect <WIFI_NAME>
# Now it prompt for password
# After entering password
exit
Test network
ping archlinux.org
Check the laptop disk
# This lists all block devices
lsblk
From the size we can tell sdb
is the USB drive while the sda
is the laptop SSD with 4 partitions already. In Linux, everything is a file, including hardware like hard drives — that’s why the actual devices live in the /dev
directory. So we should install arch on /dev/sda
. I will wipe and partition the dev/sda
cfdisk /dev/sda
delete the all existing partitions so that only "Free Space" left on the menu (this will destroy all existing files on the disk including Windows system)
Then create new partitions:
/dev/sda1
512MB for EFI system, change the type to "EFI System"/dev/sda2
Rest of space for root with the default type: Linux filesystem
Now we create partitions, but they are just raw space — like an empty USB drive with no filesystem. To store files, we need to format the partitions with a filesystem, like:
ext4
— used by Linux systemsFAT32
— used by the UEFI firmware for bootloaders
Formatting = writing a filesystem structure onto the partition so that the OS can understand where files go.
Write the changes then quit. Then we format the partitions:
# Prepares the EFI partition in FAT32 format, required for UEFI.
mkfs.fat -F32 /dev/sda1
# Formats the root partition using the ext4 filesystem, the most common Linux filesystem
mkfs.ext4 /dev/sda2
Now the two partitioned and ready to go.... well not quite.
We have the ex4
filesystem in the device file /dev/sda2
so it can hold Linux files. But right now, to Linux, dev/sda2
is just a raw block device. Linux does not interpret or expose the filesystem structure. We need to mount it somewhere (for example /mnt
) so that Linux will:
- Interpret
dev/sda2
as a file system - And makes it accessible at
/mnt
. After mounting, if the system read/write files into/mnt
, they’ll actually be reading/writing data into the ext4 filesystem inside/dev/sda2
, i.e., your SSD. During Arch installation, we use/mnt
as the root of the new Arch system we’re about to build. Later, when you boot into the system normally, your actual root (/
) will be your SSD, not/mnt
.
Note that /mnt
is just a convention during installations or temporary mounting. You could mount it anywhere.
And we also need to mount our EFI partition (/dev/sda1
) as well so that we can install the bootloader to the disk.
# Mounts your root filesystem where Arch will be installed.
mount /dev/sda2 /mnt
# Prepares a folder for the EFI partition.
mkdir /mnt/boot
# Mounts the EFI partition into /boot so the bootloader can be installed later.
mount /dev/sda1 /mnt/boot
From wiki: "No software or configuration (except for /etc/pacman.d/mirrorlist
) gets carried over from the live environment to the installed system."
So we need to install core packages into the disk so the system can be boot and running
pacstrap /mnt base linux linux-firmware nano networkmanager
genfstab -U /mnt >> /mnt/etc/fstab
/etc/fstab
= "filesystem table". It tells your Linux system: “On every boot, automatically mount these filesystems at these locations". For example, your Arch install needs to know:
- “Mount
/dev/sda2
as/
” - “Mount
/dev/sda1
as/boot
” Instead of hardcoding device names (which can change), the usual practice identify partitions by UUID.
arch-chroot /mnt
chroot
= change root. It tells Linux: “From now on, pretend that /mnt
is the root (/
) of the system.” Meaning we are moving into newly installed Arch system (on your SSD), from inside the live USB environment. For example, /mnt/etc
becomes /etc
.
Then, we can install packages, set timezone, hostname and install bootloader for the actual system we are installing.
Inside the chroot:
### Time: https://wiki.archlinux.org/title/System_time#Time_zone
ln -sf /usr/share/zoneinfo/Asia/Singapore /etc/localtime
hwclock --systohc
### Locale: https://wiki.archlinux.org/title/Locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
### Host name: https://wiki.archlinux.org/title/Network_configuration#Set_the_hostname
echo "archx280" > /etc/hostname
### Set root password: https://wiki.archlinux.org/title/Users_and_groups#User_database
passwd
Besides, in order to let the laptop automatically open NetworkManager on every boots:
systemctl enable NetworkManager
systemctl
is the command-line interface to systemd, the init system (service manager) used by Arch and most modern Linux distros. The command create a systemd symlink that makes NetworkManager run automatically every time you boot. Otherwise, we have to run systemctl start NetworkManager
each time.
Once you connect to WIFI via:
nmcli device wifi connect _SSID_or_BSSID_ password _password_
It will auto connect every ctime you boot
Then we do the bootloader and reboot
# Install packages
pacman -S grub efibootmgr
# Put the GRUB bootloader into the EFI partition and register it with UEFI
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
# Auto generates the file (`grub.cfg`) so it knows how to boot Arch Linux. The file is the actual script GRUB uses when it loads — it draws the boot menu and loads the kernel
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
reboot
incoming