Installing Arch
I use a MacBook as my personal laptop, but recently, I bought a refurbished ThinkPad so I could install Arch and tinker with Linux. While installing Arch, I realized that I don’t know much about what actually happens when a computer boots. In this post, I summarized the things I learned during the process.
How a Computer Boots
Section titled “How a Computer Boots”Before going over the Arch installation process, I think it’s helpful to understand at a high level how a (Linux) computer boots. Booting is the process of going from a “powered off hardware” to a “running operating system.” The simplified flow is:
1. Power on2. UEFI firmware runs3. UEFI finds a bootloader4. Bootloader loads the Linux kernel into memory5. Bootloader loads initramfs (temporary file system) into memory6. Kernel starts running7. Kernel mounts the root filesystem8. Kernel starts systemd and systemd starts services1. UEFI firmware runs.
Section titled “1. UEFI firmware runs.”UEFI is a firmware built into the motherboard, and it runs when we press the power button of the computer. Its job is to locate a bootable device (such as the SSD or a USB drive) and run the bootloader. UEFI is the successor to BIOS, which can be found in older computers.
2. UEFI finds a bootloader, and the bootloader loads the Linux kernel into memory.
Section titled “2. UEFI finds a bootloader, and the bootloader loads the Linux kernel into memory.”On the bootable device, UEFI looks for a special partition called the EFI System Partition (/boot). This is where bootloader’s files are located.
A bootloader is a small program whose job is to start the OS. On Linux systems, the bootloader (systemd-boot) reads a boot entry configuration file like /boot/loader/entries/arch.conf, which specifies the kernel to load. The kernel code is stored in a file like /boot/vmlinuz-linux. The bootloader reads this file, copies it into RAM, and starts the execution.
3. Bootloader loads initramfs into memory.
Section titled “3. Bootloader loads initramfs into memory.”The bootloader also locates an initramfs image under /boot (/boot/initramfs-linux.img) and loads it into RAM.
The initramfs image is used to set up a temporary RAM-backed filesystem. Early in the boot process, the real root partition may not be mounted as /, but the kernel still needs some filesystem. Mounting just means making a disk or partition available inside the current filesystem tree at a specific path like /. Once the real root partition is found and mounted as /, the system switches away from initramfs and continues booting from the real system on disk.
4. Kernel starts running and mounts the root filesystem.
Section titled “4. Kernel starts running and mounts the root filesystem.”The kernel mounts the root partition as /. The root partition is specified in the boot entry file, where we have a line lke: options root=UUID=... rw. This means: use the partition with this UUID as /, and mount it as read-write.
5. Kernel starts systemd, and systemd starts services.
Section titled “5. Kernel starts systemd, and systemd starts services.”After / is mounted, the kernel starts the first normal user-space process. On many Linux systems, this is systemd. systemd runs as process ID 1. It starts and manages core services like networking, login, bluetooth, and the desktop login manager.
Since processes are created through parent-child relationships, systemd sits at the root of the user-space process tree. Most user-space processes are either started directly by systemd or are descendants of processes that were started by systemd.
Installing Arch
Section titled “Installing Arch”Now that we have a high-level understanding of how a computer boots, we can look at the Arch installation process through this lens. Instead of thinking of the installation as a list of commands, it is more helpful to think of each step as preparing one part of the system that the computer will later need during boot.
The rough installation flow looks like this:
1. Make an Arch installation USB2. Boot ThinkPad from the USB3. Connect to the Internet4. Identify and partition the SSD5. Format and mount the partitions6. Install the base Arch system7. Generate fstab8. Chroot and configure the system9. Install and configure the bootloader10. Reboot into installed Arch1. Make an Arch installation USB
Section titled “1. Make an Arch installation USB”When installing a new OS, we have to repartition the SSD and set it up for Linux. This is tricky to achieve while the existing OS is running from the same SSD.
The USB solves this problem by providing a temporary boot environment. Instead of booting into the current OS on the SSD, the ThinkPad can boot into a temporary Arch system on the USB. Then, we can work from the USB to set up a new OS on the SSD.
First, download the Arch ISO from the Arch website. An ISO is an image file that contains everything that would be written to a disk. It is used to capture and reproduce a disk environment.
After downloading the ISO image, flash the ISO to the USB. Flashing means writing the ISO image directly onto the USB. This is different from copying the .iso file into the USB. If we only copy it, the USB just contains the ISO as a file. When we flash it, the USB becomes the disk described by the image.
On Mac, I used a program called balenaEtcher, where the process was only a few clicks: select the image, select the USB, and flash it. After this, the USB is now a bootable device.
2. Boot ThinkPad from the USB
Section titled “2. Boot ThinkPad from the USB”After creating the installation USB, boot the ThinkPad from it. For mine, I had to shut the machine down, turn it back on, and repeatedly press F12 to open the boot menu. From there, I selected the USB drive instead of the internal SSD. The machine then booted into the Arch environment, and I saw a command-line prompt like this:
root@archiso ~ #From here, it is possible to run archinstall for a quick setup. In my case, I followed the manual installation process because I wanted to understand what each step does.
3. Connect to the Internet
Section titled “3. Connect to the Internet”The next step is to get Internet connection, since the base Arch system and other packages need to be downloaded. First, check the Internet connection using ping. If not connected, configure Wi-Fi using the iwctl command.
4. Identify and partition the SSD
Section titled “4. Identify and partition the SSD”Next, we have to identify and partition the internal SSD. The lsblk command lists the available block devices:
/dev/nvme0n1 internal ThinkPad SSD/dev/sda USB installerThe internal SSD is our target — use cfdisk to partition it:
cfdisk /dev/nvme0n1cfdisk lists the existing partitions, which we can delete if we don’t mind wiping out the existing OS. Then, create two new partitions:
/dev/nvme0n1p1 1G EFI System Partition/dev/nvme0n1p2 rest (e.g., 237G) Linux root partitionI used 1GB for the EFI partition, which is where bootloader-related files go. The rest of the disk is the root partition, where the actual Arch system would be installed.
5. Format and mount the partitions
Section titled “5. Format and mount the partitions”After creating the partitions, we also have to format them. The EFI partition uses FAT32 for UEFI compatibility. The root partition can use ext4.
mkfs.fat -F32 /dev/nvme0n1p1mkfs.ext4 /dev/nvme0n1p2Then, mount the new filesystems under /mnt.
# /mnt already exists so we don't have to mkdirmount /dev/nvme0n1p2 /mnt
mkdir /mnt/bootmount /dev/nvme0n1p1 /mnt/bootThe temporary Arch system running from the USB can now access the SSD through /mnt.
/dev/nvme0n1p2 → /mnt access point to the SSD root partition/dev/nvme0n1p1 → /mnt/boot access point to the SSD EFI partitionFrom now, commands like pacstrap /mnt ... installs Arch files to the SSD root partition mounted there.
6. Install the base Arch system
Section titled “6. Install the base Arch system”Next, we can use the Arch installation tool (pacstrap) to install the initial system into /mnt. The initial system is a collection of packages like:
baselinuxlinux-ltslinux-firmwareamd-ucodeNetworkManagersudovim/nanoSince /mnt is where the SSD root partition is mounted, pacstrap install the files on the SSD. The SSD is now becoming an actual Arch system.
7. Generate fstab
Section titled “7. Generate fstab”We also have to generate an fstab, which tells the installed system how to mount its partitions during boot. Before, I manually mounted the partitions:
/dev/nvme0n1p2 → /mnt/dev/nvme0n1p1 → /mnt/bootUltimately, we want the system to mount the partitions like this:
/dev/nvme0n1p2 → //dev/nvme0n1p1 → /bootfstab records this mapping so that the mounts are automated in future boots.
8. chroot and configure the system
Section titled “8. chroot and configure the system”After the base system is installed, run:
arch-chroot /mntThis changes the working environment from the USB to the new Arch system installed at /mnt. Then, we can continue configuring the installed system:
timezonelocalehostnameroot passwordnormal usersudo accessNetworkManager auto-startAt this point, we are configuring the Arch system that would actually run after rebooting from the SSD.
9. Install and configure the bootloader
Section titled “9. Install and configure the bootloader”Earlier, I created an EFI partition, but it is still empty. We need to install the bootloader into it. In this setup, I used systemd-boot.
bootctl installsystemd-boot uses two levels of configuration. loader.conf defines the general boot menu settings, and files under /boot/loader/entries/ define individual boot entries.
I created the loader config at /boot/loader/loader.conf with something like this:
default arch.conftimeout 3console-mode maxeditor noThis means:
default arch.conf → choose Arch Linux by defaulttimeout 3 → wait 3 seconds before booting the default entryconsole-mode max → use a larger console display modeeditor no → do not allow editing boot options from the boot menuNext, find the UUID of the root partition:
blkid /dev/nvme0n1p2The UUID is used in the boot entry so the bootloader can tell the kernel which partition should become /.
I created the boot entry at /boot/loader/entries/arch.conf with something like this:
title Arch Linuxlinux /vmlinuz-linuxinitrd /amd-ucode.imginitrd /initramfs-linux.imgoptions root=UUID=... rwThis means:
title Arch Linux → name shown in the boot menulinux /vmlinuz-linux → kernel to loadinitrd /amd-ucode.img → AMD CPU microcode updateinitrd /initramfs-linux.img → initramfs to loadoptions root=UUID=... rw → use this root partition as /, read-writeThis tells the bootloader which kernel to load, which initramfs to load, and which partition should become /.
I also created an LTS entry for linux-lts. LTS stands for Long-Term Support. Arch installs two kernels:
linux → normal Arch kernellinux-lts → long-term support kernelThe normal linux kernel gets newer updates faster. The linux-lts kernel is usually older and more conservative. I installed both because if a normal kernel update breaks something, I can reboot and choose Arch Linux LTS as a fallback.
So arch-lts.conf is a backup boot option that uses /vmlinuz-linux-lts and /initramfs-linux-lts.img instead of /vmlinuz-linux and /initramfs-linux.img.
10. Reboot into installed Arch
Section titled “10. Reboot into installed Arch”Finally, we can exit the chroot environment, unmount the partitions using umount -R /mnt, and reboot. When the machine restarts, remove the USB.
After this, the computer will boot from the internal SSD instead of the USB, and log into the installed Arch system. From there, we can install apps like a browser and code editor.
Takeaways
Section titled “Takeaways”I don’t expect myself to memorize the Arch installation steps, but I think it is worth writing down the practical parts that I may want to review again in the future.
First, I learned a lot about the booting process. I think it is helpful to know the high-level flow: a bootloader lives on the SSD, the firmware locates and runs it when the computer starts, and the bootloader loads the kernel into memory.
Second, I didn’t really know much about block devices and filesystems. Creating partitions and working with them directly made the relevant concepts more concrete. I got more familiar with the basics, such as mounting a filesystem, understanding different types of filesystems, and using commands like lsblk.
Last but not least, I learned a lot about Linux in general. There is still a lot for me to learn, and I hope to study topics like systemd in more depth in the future.
Overall, installing Arch made my laptop feel a little less like magic, and I am looking forward to exploring it more!