Arch Linux Installation
expand_circle_rightArch linux installation is not that hard if you do it simple as if:
- you don’t need dual boot and just want to install it as first OS on your drive.
- your computer is not too old and it supports GPT , UEFI , etc.
- you don’t need LVM, system encryption or RAID .
- you don’t mind to read the wiki pages.
See also: Official Installation Guide
If so, it is done in 10 minutes (without downloading and installation time). In this tutorial, The Arch Linux is installed as
- no dual boot, single OS
- using GUID Partition Table (GPT)
and EXT4
filesystem. Assuming storage device is
/dev/sda, partition table is as follows:/dev/sda1BOOT Partition and to be mounted to/boot./dev/sda2ROOT Partition and to be mounted to/./dev/sda3SWAP Partition and no need to be mounted to./dev/sda4HOME Partition and to be mounted to/home.
- with Unified Extensible Firmware Interface (UEFI) using systemd-boot as bootloader
- keep it simple and stupid
Preparing Installation Media
# dd if=/path/to/archlinux-version-x86_64.iso of=/dev/sdbBoot up from the Installation Media
Getting the installation media booted up, choosing UEFI in boot menu if needed. How to get the installation booted up?
Connect to Internet
To connect to internet (WiFi) using iwd .
# iwctlfor more details, see: Connect to a network
Partitioning and Formatting Partitions
Partitioning
GPT fdisk is personally recommended for partitioning the disk. GPT fdisk— consisting of the gdisk, cgdisk, sgdisk and fixparts programs—is a set of text-mode partitioning tools. Assuming your device is /dev/sda, run the following command and follow on-screen instructions.
# gdisk /dev/sdaFormatting Partitions
Partitioning the disk by gdisk is just creating partition table on the disk. Formatting is still needed. In other words, formatting is writing filesystem
on the partition. In this tutorial, EXT4 Filesystem
is used for all partition except /boot partition where bootlader’s files will reside and which is created as EFI System Partition
.
Example of Partitioning and Formatting
- BOOT Partition /dev/sda1
500MB or 1GB is recommended.
Partition Type ef00
Mounted to /boot
Formatted as FAT32 filesystem# mkfs.fat -F32 /dev/sda1 - ROOT Partition /dev/sda2
30GB is recommended.
Partition Type 8300
Mounted to /
Formatted as EXT4 filesystem# mkfs.ext4 /dev/sda2 - SWAP Partition /dev/sda3
8GB is recommended.
Partition Type 8200
No need to format and mount
But make it swap partition# mkswap /dev/sda3 - HOME Partition /dev/sda4
Size depends on available space on the disk /dev/sda
Partition Type 8300
Mounted to /home
Formatted as EXT4 filesystem# mkfs.ext4 /dev/sda4
# mkfs.fat -F32 /dev/sda1
# mkfs.ext4 /dev/sda2
# mkswap /dev/sda3
# mkfs.ext4 /dev/sda4Mounting and Activating Swap
Mounting involves creating directories where the partitions will be mounted. Activating swap can be done by using swapon command.
- Mount ROOT partition to
/mnt. - Create directories where the next partitions will be mounted.
/mnt/bootfor BOOT Partition/mnt/homefor HOME Partition
- Mount BOOT and HOME partitions to
/mnt/bootand/mnt/home. - Activate SWAP
partition using
swapon.
# mount /dev/sda2 /mnt
# mkdir /mnt/boot
# mkdir /mnt/home
# mount /dev/sda1 /mnt/boot
# mount /dev/sda4/mnt/home
# swapon /dev/sda3Installing Base System
At this stage, base system can be installed. It is also recommended to install other useful packages such as base-devel, nano, nvim, networkmanager.
# pacstrap /mnt base linux linux-firmware base-devel neovim networkmanagerConfiguration
fstab
# genfstab -U /mnt >> /mnt/etc/fstabchroot
# arch-chroot /mntTimezone
# ln -sf /usr/share/zoneinfo/Asia/Yangon /etc/localtime
# hwclock --systohcUncomment Locale
# nano /etc/locale.genFind locale you want and uncomment it. E.g. en_US.UTF-8 UTF-8. If nano is not available, run pacman -S nano to install it first.
en_US.UTF-8 UTF-8Generate Locale
# locale-genCreate Locale File
# nano /etc/locale.confWrite locales. E.g.:
LANG=en_US.UTF-8Hostname
# nano /etc/hostnameWrite the hosename:
myhostnameHosts
# nano /etc/hostsEdit like the followings:
127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostnameRoot Password
# passwdCreate New User
# useradd -m -G wheel -s /bin/bash myusername
# passwd myusernameMake User Sudoer
# EDITOR=nano visudoUncomment the following line:
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL:ALL) ALLBootloader
Bootloader Installation
See: Systemd-boot
for more details. Below command would be working only if EFI System Partition (ESP)
is mounted to /boot or /efi. Mounting ESP to /boot is the most recommended and simplest. Read ESP Typical Mount Points
for more knowledge.
# bootctl installWhen running bootctl install, systemd-boot will try to locate the ESP at /efi, /boot, and /boot/efi. Setting esp to a different location requires passing the --esp-path=esp option.
Bootloader Entry File
# nano /boot/loader/entries/arch.confWrite the followings:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=/dev/sda2 rwExit, Unmount and Reboot
# exit
# umount -R /mnt
# rebootPost Installation
At this stage, the base installation finished. See General recommendations for system management directions and post-installation tutorials (like creating unprivileged user accounts, setting up a graphical user interface, sound or a touchpad). For a list of applications that may be of interest, see List of applications .