Skip to content
Author Nejat Hakan
eMail nejat.hakan@outlook.de
PayPal Me https://paypal.me/nejathakan


Installing Arch Linux

Introduction

Welcome to the comprehensive guide for installing Arch Linux! This installation journey is often considered a rite of passage in the Linux world. Unlike many other distributions that offer graphical installers and pre-configured setups, Arch Linux provides a minimal base system and expects you, the user, to build your environment from the ground up. This approach offers unparalleled flexibility and a deep understanding of how a Linux system works. This guide is designed for university students and enthusiasts who are eager to learn and are not afraid to get their hands dirty with the command line. We will dive deep into each step, explaining the "whys" and "hows" to ensure you not only install Arch Linux but also grasp the underlying concepts.

What is Arch Linux?

Arch Linux is an independently developed, x86-64 general-purpose GNU/Linux distribution that strives to provide the latest stable versions of most software by following a rolling-release model. The development focus is on simplicity, modernity, pragmatism, user centrality, and versatility.

  • Simplicity:
    Arch Linux defines simplicity as "without unnecessary additions or modifications." It ships software as released by the original developers (upstream) with minimal down-streaming patching. Configuration is achieved through editing plain text files.
  • Modernity:
    Arch aims to maintain the latest stable release versions of its software as long as systemic package breakage can be reasonably avoided. It is based on a rolling-release system, which allows a one-time installation with continuous updates.
  • Pragmatism:
    Arch is a pragmatic distribution rather than an ideological one. The principles are only useful guidelines. Ultimately, design decisions are made on a case-by-case basis through developer consensus.
  • User-Centrality:
    Arch Linux targets competent Linux users by giving them complete control and responsibility over their system. It is intended for users willing to spend time reading documentation and solving their own problems.
  • Versatility:
    Arch Linux is a general-purpose distribution. Upon installation, only a command-line environment is provided. Rather than tearing out unneeded and unwanted packages, users are offered the ability to build a custom system by choosing among thousands of high-quality packages provided in the official repositories for the x86-64 architecture.

Why Choose Arch Linux?

  • Understand Linux Internals:
    The installation process itself is a learning experience. You will partition disks, configure the kernel, set up networking, and install a bootloader manually. This provides invaluable insight into the components of a Linux system.
  • Total Customization:
    You install only what you need. There's no bloat. You choose your desktop environment (or window manager), your services, and your applications.
  • Bleeding Edge Software:
    Arch's rolling-release model means you get the latest software versions almost as soon as they are released upstream, provided they are deemed stable.
  • The Arch Wiki
    Arch Linux boasts arguably the best and most comprehensive documentation of any Linux distribution, known as the Arch Wiki. It's an incredible resource not just for Arch users, but for Linux users in general.
  • AUR (Arch User Repository)
    The AUR is a vast, community-driven repository for Arch Linux users. It contains package descriptions (PKGBUILDs) that allow you to compile a package from source with a single command and install it via pacman (Arch's package manager).

Prerequisites

  • Hardware:
    • An x86-64 compatible machine. Arch Linux does not support 32-bit architecture officially anymore.
    • At least 512 MB of RAM (more is recommended for a comfortable live environment and graphical interface later).
    • At least 2 GB of disk space for a minimal command-line installation. A graphical desktop environment will require significantly more (20GB+ is a good starting point for / and /home).
    • A USB drive (2GB or larger) to create the bootable installation medium.
    • An active internet connection (Ethernet or Wi-Fi) in the target machine.
  • Knowledge:
    • Familiarity with basic Linux command-line operations (navigating directories, copying files, editing text files).
    • Understanding of basic concepts like disk partitions, file systems, and boot processes is helpful, but we will cover them.
    • Patience and a willingness to read documentation (especially the Arch Wiki).
  • Mindset:
    • Problem-solving attitude. You will likely encounter issues; the ability to research and troubleshoot is key.
    • Attention to detail. Typos or missed steps can lead to problems.

Overview of the Installation Process

The Arch Linux installation process can be broadly summarized as follows:

  1. Pre-installation:
    Download the Arch ISO, create a bootable USB, boot into the live environment, connect to the internet, update the system clock, and set the keyboard layout.
  2. Disk Partitioning:
    Decide on a partitioning scheme (MBR/GPT, standard partitions, LVM, encryption) and create the necessary partitions on your hard drive.
  3. Formatting and Mounting:
    Format the partitions with appropriate file systems (e.g., ext4, Btrfs, XFS, FAT32 for EFI) and mount them.
  4. Base System Installation:
    Select mirrors for package downloads and install the base Arch Linux packages onto your newly formatted partitions using pacstrap.
  5. System Configuration:
    Generate an fstab file, chroot into your new system, set the time zone, configure locales, set the hostname, configure networking, create an initramfs, and set the root password.
  6. Bootloader Installation:
    Install and configure a bootloader (e.g., GRUB, systemd-boot) so your system can boot without the installation media.
  7. Post-installation:
    Reboot into your new system, create a user account, set up sudo, install graphics drivers, and optionally install a desktop environment or window manager, sound server, and common applications.

This guide will walk you through each of these stages in detail, with practical workshops to solidify your understanding.

Workshop Preparing for the Installation

This initial workshop will guide you through the essential preparatory steps before you even boot into the Arch Linux live environment.

Goal:
Download the Arch Linux ISO, verify its integrity, and create a bootable USB drive.

Tools you'll need:

  • A computer with an internet connection.
  • A USB flash drive (at least 2GB, preferably larger). Warning: This USB drive will be erased.

Steps:

  1. Download the Arch Linux ISO:

    • Open your web browser and navigate to the official Arch Linux download page: https://archlinux.org/download/.
    • You will find a list of mirrors. Choose a mirror geographically close to you for faster download speeds.
    • Download the latest ISO file. It will have a name like archlinux-YYYY.MM.DD-x86_64.iso. For example, archlinux-2023.11.01-x86_64.iso.
  2. Verify the ISO Integrity (Crucial Step!):

    • On the same download page, you will find checksums for the ISO file (usually SHA256 and MD5). Download the sha256sums.txt file or note the SHA256 sum for your ISO.
    • Why verify?
      This ensures the ISO file you downloaded is not corrupted and is an authentic copy from the Arch Linux developers, protecting you from potential issues or malicious modifications.
    • How to verify:
      • On Linux:
        Open a terminal in the directory where you downloaded the ISO. Run the command:
        sha256sum archlinux-YYYY.MM.DD-x86_64.iso
        
        Compare the output hash with the one provided on the Arch Linux website or in the sha256sums.txt file. They must match exactly.
      • On macOS:
        Open Terminal. Run:
        shasum -a 256 /path/to/your/archlinux-YYYY.MM.DD-x86_64.iso
        
        Compare the output hash.
      • On Windows:
        You can use PowerShell:
        Get-FileHash -Algorithm SHA256 C:\path\to\your\archlinux-YYYY.MM.DD-x86_64.iso
        
        Alternatively, tools like 7-Zip can calculate checksums. Right-click the ISO, go to CRC SHA, then SHA-256.
    • If the checksums do not match, your download is corrupted or incomplete. Download the ISO again from a different mirror if necessary.
  3. Create a Bootable USB Drive:

    • Warning:
      This process will erase all data on your USB drive. Back up any important files from it.
    • Identify your USB drive's device name.
      • On Linux:
        Insert the USB drive. Open a terminal and run lsblk or sudo fdisk -l. Identify your USB drive (e.g., /dev/sdb, /dev/sdc). Be extremely careful not to choose your system's hard drive. Look at the size and existing partitions to confirm.
      • On macOS:
        You can use diskutil list in Terminal.
      • On Windows:
        Tools like Rufus will list available USB drives.
    • Writing the ISO:
      • On Linux (using dd):
        This is a powerful command; a typo can wipe your hard drive. Double-check of=/dev/sdX. Replace sdX with your USB drive identifier (e.g., sdb, not sdb1).
        sudo dd bs=4M if=/path/to/your/archlinux-YYYY.MM.DD-x86_64.iso of=/dev/sdX status=progress conv=fsync
        
        • bs=4M: Sets block size to 4 Megabytes (can speed up the process).
        • if=...: Input file (your Arch ISO).
        • of=...: Output file (your USB drive).
        • status=progress: Shows progress.
        • conv=fsync: Ensures data is physically written before the command exits.
      • On macOS (using dd):
        Similar to Linux, but the device name might be like /dev/rdiskX (raw disk, often faster). Be very careful.
        sudo dd bs=4m if=/path/to/your/archlinux-YYYY.MM.DD-x86_64.iso of=/dev/rdiskX conv=sync
        
      • On Windows (using Rufus):
        1. Download Rufus from https://rufus.ie/. It's a portable executable.
        2. Run Rufus.
        3. Select your USB drive under "Device."
        4. Click "SELECT" and choose your Arch Linux ISO file.
        5. Partition scheme: Most modern systems use GPT. MBR might be needed for very old systems. Rufus usually auto-detects well.
        6. Target system: UEFI (non CSM) is typical.
        7. File system: Large FAT32 (default).
        8. Click "START."
        9. A dialog might ask about "ISO Hybrid" image. Select "Write in DD Image mode" when prompted. This is crucial for Arch Linux ISOs.
        10. Confirm that you understand the USB drive will be formatted.
      • Other tools: BalenaEtcher (cross-platform) is another popular and user-friendly option.
  4. Safely Eject the USB Drive:
    Once the writing process is complete, safely eject the USB drive from your operating system.

You now have a bootable Arch Linux installation medium! In the next section, we'll boot from this USB and begin the installation process.

1. Pre-installation Setup

With your bootable Arch Linux USB drive ready, it's time to boot into the live environment and perform some initial configurations. This environment runs entirely from RAM and the USB drive, allowing you to prepare your system for the Arch Linux installation without touching your existing operating system (if any).

Booting the Live Environment

  1. Insert the USB Drive:
    Plug the Arch Linux bootable USB drive into the computer where you intend to install Arch.
  2. Accessing UEFI/BIOS Settings:
    • Restart or power on the target computer.
    • Immediately after powering on, you need to press a specific key to enter the UEFI/BIOS setup utility. Common keys include Del, F2, F10, F12, or Esc. The key is often displayed briefly on the screen during startup (e.g., "Press DEL to enter Setup"). If you miss it, consult your computer's or motherboard's manual.
  3. Boot Order:
    • Inside the UEFI/BIOS setup, navigate to the "Boot" or "Boot Order" section.
    • Change the boot order to prioritize the USB drive. You want the system to attempt to boot from the USB drive before the internal hard drive.
    • If your system is UEFI-based, you might see two entries for your USB drive: one prefixed with "UEFI:" and one without. Choose the "UEFI:" entry if you plan to install Arch Linux in UEFI mode (recommended for modern systems).
  4. Secure Boot:
    • Secure Boot is a UEFI feature that helps ensure that your system boots only trusted software. The default Arch Linux ISO kernel and bootloader are not signed with keys that are typically pre-loaded into motherboard firmware by vendors.
    • Recommendation:
      For the installation process, it's generally easiest to disable Secure Boot in your UEFI settings. You can re-enable it later if you set up a custom Secure Boot environment with your own keys, but that's an advanced topic beyond this initial installation guide.
    • The Secure Boot option is usually found in the "Security" or "Boot" section of the UEFI setup.
  5. Save and Exit:
    After configuring the boot order and disabling Secure Boot (if necessary), save your changes and exit the UEFI/BIOS setup. The computer will restart.

If everything is configured correctly, the computer should now boot from the Arch Linux USB drive. You'll be greeted by the Arch Linux boot menu. Select "Arch Linux install medium (x86_64, UEFI)" (or the BIOS equivalent if you're on an older system and not using UEFI). After a series of boot messages, you will be dropped into a Zsh shell prompt, looking something like root@archiso ~ #. This is the Arch Linux live environment.

Verifying Boot Mode (UEFI or BIOS)

It's crucial to know whether you've booted in UEFI mode or legacy BIOS mode, as this will dictate how you partition your disk and install the bootloader.

To verify the boot mode, list the efivars directory. If the command shows the directory and its contents without error, you are booted in UEFI mode. If the directory does not exist, you are likely in BIOS (or CSM) mode.

ls /sys/firmware/efi/efivars
  • UEFI Mode Output:
    You will see a list of files and directories.
  • BIOS Mode Output:
    You will see an error like ls: cannot access '/sys/firmware/efi/efivars': No such file or directory.

Ensure this matches your intended installation mode. If you want a UEFI install but booted in BIOS mode (or vice-versa), reboot and check your UEFI/BIOS settings. You might need to explicitly enable/disable UEFI boot or Legacy/CSM boot options.

Connecting to the Internet

An internet connection is required to download packages.

Wired Connection (Ethernet)

If you have an Ethernet cable connected, the network connection should usually be established automatically via DHCP.

  1. Verify:
    You can check your connection by pinging a reliable server:
    ping archlinux.org
    
    Press Ctrl+C to stop pinging. If you get replies, you're connected.
  2. Check IP Address:
    ip addr
    
    Look for your Ethernet interface (e.g., enpXsY or eth0) and see if it has an IP address.
  3. If no connection: The dhcpcd client should run automatically. If you suspect it hasn't, you can try to start it manually for your interface (e.g., dhcpcd enp2s0).

Wireless Connection (Wi-Fi)

For Wi-Fi, you'll use the iwctl utility.

  1. Start iwctl interactive prompt:

    iwctl
    
    You'll enter the iwctl prompt, which might look like [iwd]#.

  2. List Wi-Fi devices:

    [iwd]# device list
    
    This will show available wireless devices, e.g., wlan0. Note your device name.

  3. Scan for networks (replace wlan0 with your device name if different):

    [iwd]# station wlan0 scan
    

  4. List available networks:

    [iwd]# station wlan0 get-networks
    
    This will display a list of SSIDs (network names) with their security types.

  5. Connect to a network:

    [iwd]# station wlan0 connect "Your_SSID_Name"
    
    Replace "Your_SSID_Name" with the actual name of your Wi-Fi network. If the network is password-protected (e.g., WPA2/PSK), iwctl will prompt you to enter the passphrase. Type it carefully.

  6. Check connection status:

    [iwd]# station wlan0 show
    
    Look for State: connected and an IP address.

  7. Exit iwctl:

    [iwd]# exit
    

  8. Verify internet connectivity:

    ping archlinux.org
    
    Press Ctrl+C to stop.

If you have trouble, ensure your Wi-Fi adapter is not blocked (rfkill list) and that you entered the correct SSID and passphrase.

Updating the System Clock

Accurate time is important for secure connections (TLS/SSL certificate validation) and file timestamps.

timedatectl set-ntp true
This command enables Network Time Protocol (NTP) synchronization, which will set your system clock accurately using internet time servers.

You can verify the status:

timedatectl status
Look for NTP service: active and check if the time and date are correct.

Keyboard Layout

The default console keyboard layout is US. If you use a different layout (e.g., German, French, UK English), you should set it now to avoid frustration when typing commands or passwords.

  1. List available layouts (optional, if you don't know the exact name):
    Layout files are located in /usr/share/kbd/keymaps/. You can list them, for example, for German layouts:

    ls /usr/share/kbd/keymaps/i386/qwertz/
    
    Or for UK English:
    ls /usr/share/kbd/keymaps/i386/qwerty/uk.map.gz
    
    Common layouts include de-latin1 (German), fr (French), uk (United Kingdom), es (Spanish), etc.

  2. Set the keyboard layout:
    Use the loadkeys command. For example, for a German layout:

    loadkeys de-latin1
    
    For a UK layout:
    loadkeys uk
    
    This setting is temporary for the live environment. We will make it persistent later during system configuration. Test a few special characters to ensure it's working as expected.

Workshop Navigating the Live Environment and Basic Commands

Goal:
Practice navigating the Arch Linux live environment, confirm your boot mode, establish an internet connection, synchronize the system clock, and set your keyboard layout. This workshop reinforces the initial setup steps.

Scenario:
You have just booted into the Arch Linux live environment (root@archiso ~ # prompt).

Steps:

  1. Confirm Your Shell:

    • The default shell in the Arch ISO is Zsh. You can confirm this by typing:
      echo $SHELL
      
    • Expected output: /bin/zsh or similar.
  2. Basic Navigation and Listing Files:

    • Check your current directory:
      pwd
      
      (Should be /root)
    • List files in the current directory:
      ls -a
      
      (-a shows hidden files)
    • Explore the root of the filesystem:
      cd /
      ls
      
      You'll see directories like bin, etc, usr, sys, etc. Briefly identify what some of these might contain. (e.g., sys for system information, etc for configuration files).
  3. Verify Boot Mode:

    • Execute the command to check for UEFI:
      ls /sys/firmware/efi/efivars
      
    • Interpret the output:
      • If you see a list of files, you are in UEFI mode. Make a note of this.
      • If you get "No such file or directory," you are in BIOS mode. Make a note of this.
    • This is critical for later steps, especially partitioning and bootloader installation.
  4. Network Setup Practice:

    • If using Ethernet:
      • Check your IP address: ip addr show (look for an inet address on your Ethernet interface, e.g., enp2s0).
      • Test connectivity: ping -c 3 archlinux.org (The -c 3 sends 3 packets).
    • If using Wi-Fi (even if you connected earlier, practice with iwctl):
      • Enter iwctl.
      • Type device list to see your Wi-Fi adapter (e.g., wlan0).
      • If your adapter name is wlan0, scan for networks: station wlan0 scan. Wait a few seconds.
      • List networks: station wlan0 get-networks.
      • Attempt to connect (re-connect if already connected, or connect to a different one if available): station wlan0 connect "YOUR_SSID" (You'll be prompted for a password if it's secured).
      • Check status: station wlan0 show.
      • Exit iwctl: exit.
      • Test connectivity: ping -c 3 google.com.
  5. Update System Clock:

    • Enable NTP:
      timedatectl set-ntp true
      
    • Check the status and verify the time:
      timedatectl status
      
      Ensure "NTP service: active" is shown and the "Universal time" and "Local time" are correct.
  6. Set Keyboard Layout (Practice):

    • Let's assume you want to try the Dvorak layout (a common alternative layout, just for practice).
      loadkeys dvorak
      
    • Try typing a few common keys. For example, on a QWERTY keyboard, typing 'j' should produce 'c', 'k' should produce 't', 'f' should produce 'u'. This demonstrates the layout has changed.
    • Now, revert to the US layout (or your preferred one if it's not US):
      loadkeys us
      
      Or, for example, for a German layout:
      loadkeys de-latin1
      
    • Test typing again to confirm it's back to your desired layout.

Reflection:

  • Were you able to successfully verify your boot mode? Why is this important?
  • Did you manage to connect to the internet? If you faced issues, what steps did you take to troubleshoot?
  • Is your system clock now synchronized?
  • Could you change and revert the keyboard layout?

This workshop ensures you are comfortable with these fundamental pre-installation steps. Having these sorted out correctly will make the rest of the installation process smoother.

2. Disk Partitioning Strategies

Disk partitioning is one of the most critical steps in installing Arch Linux. It involves dividing your hard drive (or SSD) into separate sections, each of which can be formatted with a file system and used for a specific purpose (e.g., storing the operating system, user data, or swap space). A well-thought-out partitioning scheme can improve organization, performance, and flexibility.

We will primarily focus on UEFI/GPT partitioning, as it is the modern standard. We'll also briefly touch upon BIOS/MBR for older systems.

Understanding Disk Partitioning

  • MBR (Master Boot Record):

    • An older partitioning scheme, traditionally used with BIOS-based systems.
    • Limitations: Supports a maximum of 4 primary partitions (or 3 primary and 1 extended, which can contain multiple logical partitions).
    • Limited to disks up to 2TB in size.
    • The boot code and partition table are stored in the first sector of the disk, making it vulnerable.
  • GPT (GUID Partition Table):

    • A modern partitioning scheme, part of the UEFI standard. It can also be used with BIOS systems with appropriate bootloaders.
    • Advantages: Supports a virtually unlimited number of partitions (Windows limits it to 128).
    • Supports disks larger than 2TB (up to Zettabytes).
    • Stores multiple copies of the partition table across the disk for redundancy, making it more robust.
    • Uses Globally Unique Identifiers (GUIDs) for disks and partitions.
  • Common Partitions and Their Purpose:

    • EFI System Partition (ESP):
      • Required for UEFI-based systems.
      • Formatted with FAT32.
      • Stores bootloader files, kernel images, and other boot-related files.
      • Typically mounted at /boot or /efi. Recommended size: 260MB to 550MB.
    • /boot:
      • In BIOS systems, this partition sometimes holds the kernel images and bootloader configuration if the root filesystem uses a type not understood by the bootloader, or if using LVM/encryption for root.
      • In UEFI systems, if the ESP is mounted at /efi, /boot can be a separate partition on the main filesystem or part of the root filesystem. If ESP is mounted at /boot, then /boot is the ESP.
      • Recommended size: 512MB to 1GB if separate.
    • Root (/):
      • The top-level directory of the filesystem hierarchy.
      • Contains the core operating system files, system libraries, and applications.
      • Required for any Linux installation.
      • Recommended size: At least 20GB for a basic system with a desktop environment. 30-50GB is a safer bet for future growth and package cache.
    • Home (/home):
      • Contains user-specific data, documents, and configuration files.
      • Highly recommended to have /home as a separate partition. This allows you to reinstall the OS (or even switch distributions) without losing your personal files.
      • Size: Depends on your needs. Allocate the majority of your remaining disk space here if you store large files (videos, photos, virtual machines).
    • Swap:
      • Used as virtual memory when your physical RAM is full.
      • Also used for hibernation (suspend-to-disk), where the contents of RAM are written to swap before powering off.
      • Can be a dedicated partition or a swap file.
      • Size:
        • If not using hibernation: RAM size is a common recommendation, but can be less (e.g., 2-4GB) if you have plenty of RAM (16GB+).
        • If using hibernation: Must be at least the size of your RAM, preferably slightly larger (RAM size + sqrt(RAM size) or RAM size + 2GB).

Partitioning Tools

Arch Linux live environment provides several command-line partitioning tools:

  • fdisk:
    A classic, dialog-driven tool for MBR and GPT (basic GPT support). Good for MBR.
  • gdisk:
    Similar to fdisk but specifically designed for GPT. It's often preferred for GPT partitioning due to its more comprehensive GPT feature set. Its interactive menu is very similar to fdisk.
  • cfdisk:
    A curses-based (text UI) frontend for fdisk. It provides a more user-friendly, visual way to manage partitions. It supports both MBR and GPT. Many beginners find this easier to use.
  • parted:
    A very powerful, scriptable partitioning tool. It can be used interactively or non-interactively. It has a steeper learning curve but offers more advanced capabilities.

For this guide, we'll primarily use cfdisk or gdisk due to their relative ease of use and suitability for GPT.

Identifying Your Disk:
Before partitioning, you need to identify the target disk. Use lsblk or fdisk -l:

lsblk
This will list block devices (disks, partitions). Your main installation disk will likely be /dev/sda, /dev/sdb, or /dev/nvme0n1 (for NVMe SSDs). Be absolutely sure you select the correct disk, as partitioning will erase its data.

Scenario 1 Simple UEFI/GPT Setup (Swap File to be configured later)

This is a common and straightforward setup for modern desktops/laptops with UEFI firmware. We will create an EFI System Partition, a root partition, and a home partition. We'll plan for a swap file later, instead of a dedicated swap partition, for simplicity and flexibility in this scenario.

Partitions to create on /dev/sdX (or /dev/nvme0n1pX for NVMe):

  1. EFI System Partition (ESP):
    • Size: 512MB (A good general-purpose size, e.g., +512M)
    • Type: EFI System (GUID: C12A7328-F81F-11D2-BA4B-00A0C93EC93B)
    • Mount point: /boot (or /efi - we'll use /boot for simplicity here initially)
  2. Root Partition (/):
    • Size: 30GB-50GB (e.g., +30G or +50G). Adjust based on your needs.
    • Type: Linux x86-64 root (GUID: 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 if using systemd auto-discovery, otherwise Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4 is fine)
    • Mount point: /
  3. Home Partition (/home):
    • Size: Remainder of the disk (or a specific large size if you have other plans for remaining space).
    • Type: Linux filesystem (GUID: 0FC63DAF-8483-4772-8E79-3D69D8477DE4)
    • Mount point: /home

Using cfdisk for UEFI/GPT (Example on /dev/sda):

  1. Start cfdisk on your target disk:
    cfdisk /dev/sda
    
  2. Select Label Type:
    If the disk is new or you want to re-initialize, cfdisk will ask for a label type. Choose gpt.
  3. Creating the ESP:
    • Select [ New ] using arrow keys and press Enter.
    • Partition size: Enter 512M and press Enter.
    • Select [ Type ], press Enter. Scroll through the list or start typing "EFI" to find "EFI System". Select it and press Enter.
  4. Creating the Root Partition:
    • Ensure the free space below the ESP is selected. Select [ New ].
    • Partition size: Enter 30G (or your desired size) and press Enter.
    • The default type "Linux filesystem" is usually fine for root. If you want to be specific for systemd auto-discovery of root, you'd need gdisk to set the GUID 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709. For now, "Linux filesystem" is acceptable.
  5. Creating the Home Partition:
    • Ensure the remaining free space is selected. Select [ New ].
    • Partition size: Press Enter to use all remaining space (or specify a size).
    • The default type "Linux filesystem" is correct for home.
  6. Write Changes:
    • Once all partitions are defined, select [ Write ].
    • Type yes to confirm and press Enter. This action is irreversible and will write the partition table to the disk.
  7. Exit cfdisk:
    • Select [ Quit ] and press Enter.

After exiting, verify the partitions:

lsblk /dev/sda
You should see /dev/sda1 (ESP), /dev/sda2 (root), and /dev/sda3 (home) with their respective sizes.

Scenario 2 UEFI/GPT Setup with a Dedicated Swap Partition (for Hibernation)

This setup is similar to Scenario 1 but includes a dedicated swap partition, which is generally required if you plan to use hibernation.

Partitions to create on /dev/sdX:

  1. EFI System Partition (ESP):
    • Size: 512MB
    • Type: EFI System
  2. Swap Partition:
    • Size: At least your RAM size, e.g., if you have 8GB RAM, use 8G or 10G.
    • Type: Linux swap (GUID: 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F)
  3. Root Partition (/):
    • Size: 30GB-50GB
    • Type: Linux filesystem
  4. Home Partition (/home):
    • Size: Remainder of the disk.
    • Type: Linux filesystem

Using gdisk for UEFI/GPT (Example on /dev/sda): gdisk offers more control over GPT partition types using GUIDs.

  1. Start gdisk on your target disk:
    gdisk /dev/sda
    
  2. Creating a New GPT (if necessary):
    If the disk has an MBR or is blank, gdisk might warn you. If you want to create a new GPT, it might do so automatically or you might need to use the o command (be careful, this wipes existing partition tables).
  3. Creating the ESP (/dev/sda1):
    • Command: n (new partition)
    • Partition number: 1 (default)
    • First sector: (default)
    • Last sector or size: +512M
    • Hex code or GUID: EF00 (this is gdisk's shorthand for EFI System Partition)
  4. Creating the Swap Partition (/dev/sda2):
    • Command: n
    • Partition number: 2
    • First sector: (default)
    • Last sector or size: +8G (or your desired swap size)
    • Hex code or GUID: 8200 (Linux swap)
  5. Creating the Root Partition (/dev/sda3):
    • Command: n
    • Partition number: 3
    • First sector: (default)
    • Last sector or size: +30G
    • Hex code or GUID: 8300 (Linux filesystem) or 8304 for Linux x86-64 root (optional detailed type)
  6. Creating the Home Partition (/dev/sda4):
    • Command: n
    • Partition number: 4
    • First sector: (default)
    • Last sector or size: (default, uses remaining space)
    • Hex code or GUID: 8300 (Linux filesystem)
  7. Verify Partitions:
    • Command: p (print partition table)
    • Review the list to ensure everything is correct (partition numbers, sizes, types).
  8. Write Changes:
    • Command: w (write table to disk and exit)
    • Confirm: Y
    • This step writes the changes. Be sure before confirming.

Verify with lsblk /dev/sda.

Scenario 3 UEFI/GPT with LVM (Logical Volume Management)

LVM adds a layer of abstraction over physical partitions, allowing for more flexible volume management, such as easy resizing of logical volumes, snapshots, and combining multiple disks into a single volume group.

Disk Layout Strategy:

  1. EFI System Partition (ESP):
    • Size: 512MB
    • Type: EFI System
    • Note:
      The ESP cannot be on an LVM volume. It must be a regular partition.
  2. (Optional but Recommended) /boot Partition:
    • Size: 1GB
    • Type: Linux filesystem
    • Note:
      While GRUB can boot from LVM, having a separate /boot partition (not on LVM) can simplify recovery and some bootloader configurations, especially for beginners. If you omit this, ensure your bootloader (GRUB) has LVM support compiled in and can access the kernel on the LVM root. For this guide, we'll include it.
  3. LVM Physical Volume Partition:
    • Size: Remainder of the disk.
    • Type: Linux LVM (GUID: E6D6D379-F507-44C2-A23C-238F2A3DF928, or 8E00 in gdisk)
    • This partition will house the LVM structures.

Inside LVM (after OS installation and chroot):

  • Physical Volume (PV):
    Created on the LVM partition (e.g., /dev/sda3).
  • Volume Group (VG):
    A pool of storage created from one or more PVs (e.g., vg0).
  • Logical Volumes (LVs):
    Carved out from the VG for:
    • lv_root (for /)
    • lv_home (for /home)
    • lv_swap (for swap)

Partitioning Steps (using cfdisk or gdisk):

  1. Create ESP (/dev/sda1, 512M, type EFI System).
  2. Create /boot partition (/dev/sda2, 1G, type Linux filesystem).
  3. Create LVM partition (/dev/sda3, remaining space, type Linux LVM).
    • In cfdisk: Select "Linux LVM".
    • In gdisk: Use hex code 8E00.
  4. Write changes and exit.

The LVM setup (PV, VG, LVs) will be done after partitioning and before formatting these LVs, typically right before or during the "Formatting Partitions" stage. We'll cover LVM creation commands there.

Scenario 4 UEFI/GPT with LUKS Full-Disk Encryption (on LVM)

This provides strong data protection by encrypting your main partitions. We'll encrypt the LVM physical volume.

Disk Layout Strategy:

  1. EFI System Partition (ESP):
    • Size: 512MB
    • Type: EFI System (unencrypted)
    • Mount point: /boot/efi (or /boot if it's also the boot partition, but /boot/efi is cleaner if /boot is separate)
  2. /boot Partition:
    • Size: 1GB
    • Type: Linux filesystem (unencrypted)
    • Mount point: /boot
    • Reasoning:
      The bootloader needs to load the kernel and initramfs before it can decrypt anything. So, /boot (containing kernel, initramfs, bootloader config) and ESP (containing bootloader executable) are typically left unencrypted. You can encrypt /boot with GRUB, but it adds complexity.
  3. LUKS Encrypted Partition:
    • Size: Remainder of the disk.
    • Type: Linux filesystem (this will be overwritten by LUKS).
    • This partition will be formatted as a LUKS container.
    • Inside LUKS: LVM will be set up.
      • PV on the opened LUKS container (e.g., /dev/mapper/cryptlvm).
      • VG on this PV.
      • LVs for root, home, swap within the VG.

Partitioning Steps (using cfdisk or gdisk):

  1. Create ESP (/dev/sda1, 512M, type EFI System).
  2. Create /boot partition (/dev/sda2, 1G, type Linux filesystem).
  3. Create a partition for LUKS (/dev/sda3, remaining space, type Linux filesystem).
  4. Write changes and exit.

The LUKS setup (cryptsetup luksFormat, cryptsetup open) and subsequent LVM setup will be done before formatting the LVs, during the "Formatting Partitions" stage.

Scenario 5 BIOS/MBR Setup (Legacy Systems)

For very old systems that only support BIOS booting and MBR partitioning.

Partitions to create on /dev/sdX (using fdisk or cfdisk with dos label type):

  1. (Optional) Boot Partition (/boot):
    • Size: 512MB - 1GB
    • Type: Linux (Type 83)
    • Purpose: Useful if your root filesystem is LVM or a type the MBR bootloader (like legacy GRUB) can't read directly. If root is a simple ext4, this might not be strictly needed, but it's good practice.
    • Bootable flag:
      This partition (or the root partition if /boot is not separate) often needs the "bootable" flag set in fdisk/cfdisk.
  2. Root Partition (/):
    • Size: 30GB-50GB
    • Type: Linux (Type 83)
  3. Swap Partition:
    • Size: RAM size or as needed.
    • Type: Linux swap / Solaris (Type 82)
  4. Home Partition (/home):
    • Size: Remainder of the disk.
    • Type: Linux (Type 83)

Using cfdisk for BIOS/MBR (Example on /dev/sda):

  1. Start cfdisk:
    cfdisk /dev/sda
    
  2. Select Label Type:
    Choose dos.
  3. Create partitions similar to the GPT examples, but the types will be simpler ("Linux", "Linux swap").
  4. Set Bootable Flag:
    Select the partition that will contain your bootloader's core files (usually the /boot partition if you have one, or the root partition if /boot is not separate). Choose [ Bootable ] to toggle the flag. Only one partition should typically be marked bootable on MBR.
  5. Write changes and quit.

Workshop Partitioning a Virtual Disk (UEFI/GPT with Swap for Hibernation)

Goal:
Gain hands-on experience partitioning a disk using cfdisk or gdisk for a UEFI/GPT system, including an ESP, root, home, and a dedicated swap partition. This prepares for hibernation.

Recommendation:
If you are installing on a real machine and are unsure, PRACTICE ON A VIRTUAL MACHINE FIRST or use a spare USB drive as your target disk (e.g., /dev/sdb). DO NOT experiment on a disk with important data unless you have backups and know what you are doing.

For this workshop, let's assume you are using a spare disk /dev/sdb (replace with your actual target, like /dev/sda if installing on a primary disk, or a VM's virtual disk).

Chosen Scheme:
Scenario 2 (UEFI/GPT with ESP, Swap, Root, Home)

Disk: /dev/sdb (example, VERIFY YOUR DISK LABEL) Partitions Plan:

  • /dev/sdb1: ESP, 512MB, Type: EFI System
  • /dev/sdb2: Swap, (e.g., 4GB if you have 4GB RAM, or adjust), Type: Linux swap
  • /dev/sdb3: Root (/), 30GB, Type: Linux filesystem
  • /dev/sdb4: Home (/home), Remainder, Type: Linux filesystem

Steps using cfdisk:

  1. Identify your target disk:

    lsblk
    
    Confirm the device name (e.g., /dev/sdb). Triple-check this!

  2. Unmount any existing partitions on the target disk (if any):
    If lsblk shows any mount points for /dev/sdb or its partitions (e.g., /dev/sdb1 mounted at /run/media/user/SOMETHING), unmount them:

    umount /dev/sdb*
    
    (The * is a wildcard, be careful. Or unmount individually: umount /dev/sdb1)

  3. Start cfdisk:

    cfdisk /dev/sdb
    

  4. Select Label Type:

    • If the disk is new or has an MBR, cfdisk will prompt for a label type.
    • Navigate to gpt using arrow keys and press Enter.
    • If the disk already has a GPT table you want to overwrite, you might need to delete existing partitions first. Select a partition, then choose [ Delete ].
  5. Create the EFI System Partition (/dev/sdb1):

    • With the "Free space" selected at the top, select [ New ] and press Enter.
    • Partition size: Type 512M and press Enter.
    • Primary/logical: (GPT doesn't use this distinction in the same way as MBR, just press Enter).
    • The new partition (e.g., /dev/sdb1) will be selected. Select [ Type ] and press Enter.
    • Scroll or type to find "EFI System". Select it and press Enter.
  6. Create the Swap Partition (/dev/sdb2):

    • Use arrow keys to select the "Free space" below /dev/sdb1.
    • Select [ New ] and press Enter.
    • Partition size: Type your desired swap size, e.g., 4G (for 4 Gigabytes) or 8G, and press Enter.
    • The new partition (/dev/sdb2) will be selected. Select [ Type ] and press Enter.
    • Scroll or type to find "Linux swap". Select it and press Enter.
  7. Create the Root Partition (/dev/sdb3):

    • Select the "Free space" below /dev/sdb2.
    • Select [ New ] and press Enter.
    • Partition size: Type 30G (or your chosen size for root) and press Enter.
    • The new partition (/dev/sdb3) will be selected. The default type "Linux filesystem" is usually correct. Press Enter to confirm (or select [ Type ] and choose "Linux filesystem" if needed).
  8. Create the Home Partition (/dev/sdb4):

    • Select the remaining "Free space" below /dev/sdb3.
    • Select [ New ] and press Enter.
    • Partition size: Press Enter to accept the default, which will use all remaining space.
    • The new partition (/dev/sdb4) will be selected. The default type "Linux filesystem" is correct. Press Enter.
  9. Review Your Partitions:
    Your screen should now list:

    Device        Start        End    Sectors   Size Type
    /dev/sdb1      2048    1050623    1048576   512M EFI System
    /dev/sdb2   1050624    9439231    8388608     4G Linux swap  (example size)
    /dev/sdb3   9439232   72886271   63447040    30G Linux filesystem (example size)
    /dev/sdb4  72886272  XXXXXXXXX  XXXXXXXXX   XXG Linux filesystem (remaining size)
    
    (Numbers will vary based on your disk and chosen sizes.)

  10. Write Changes to Disk:

    • This is the point of no return for the data on /dev/sdb.
    • Select [ Write ] using arrow keys and press Enter.
    • cfdisk will ask for confirmation: "Are you sure you want to write the partition table to disk?"
    • Type yes (all lowercase) and press Enter.
  11. Exit cfdisk:

    • Select [ Quit ] and press Enter.
  12. Verify the New Partition Table:

    • Run lsblk again:
      lsblk /dev/sdb
      
      Output should be similar to:
      NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
      sdb      8:16   0   XXG  0 disk
      ├─sdb1   8:17   0   512M  0 part
      ├─sdb2   8:18   0     4G  0 part  (example size)
      ├─sdb3   8:19   0    30G  0 part  (example size)
      └─sdb4   8:20   0   XXG  0 part  (remaining size)
      
    • You can also use fdisk -l /dev/sdb for a more detailed view.

Congratulations! You have successfully partitioned your disk according to the chosen scheme. The next step will be to format these newly created partitions with appropriate file systems. If you were using gdisk, the steps would involve using commands like n (new), t (change type code - EF00 for ESP, 8200 for swap, 8300 for Linux filesystem), p (print), and w (write).

3. Formatting Partitions and Mounting File Systems

After partitioning your disk, the next step is to create file systems on these raw partitions. A file system is a structure that allows the operating system to store, organize, and retrieve files on a storage device. We also need to activate the swap partition if one was created. Finally, we'll mount these file systems into a proper hierarchy under /mnt to prepare for the base system installation.

Choosing a File System

Arch Linux supports various file systems. Here are some common choices for your Linux partitions (/, /home, /boot if separate and not ESP):

  • Ext4 (Fourth Extended Filesystem):

    • Pros:
      Very mature, stable, widely used, and well-tested. Good all-around performance. Journaling helps protect against data corruption from crashes.
    • Cons:
      Lacks some modern features like built-in snapshots or transparent compression found in Btrfs or ZFS.
    • Recommendation:
      Excellent choice for reliability, especially for root (/) and home (/home) if you prefer stability and widespread support.
  • Btrfs (B-tree Filesystem):

    • Pros:
      Modern Copy-on-Write (CoW) filesystem with advanced features like snapshots (great for system rollbacks), checksums for data integrity, built-in RAID capabilities, transparent compression, and integrated volume management (can manage multiple devices and subvolumes which act like flexible partitions).
    • Cons:
      Younger than Ext4, and some advanced features are still maturing. Performance can sometimes be variable, especially with high fragmentation or certain CoW overheads.
    • Recommendation:
      Good for users who want advanced features like snapshots and data integrity. Often used for both / and /home. Requires a bit more understanding to manage its features effectively.
  • XFS (Extended File System):

    • Pros:
      High-performance filesystem, excels at parallel I/O and handling large files. Mature and robust.
    • Cons:
      Resizing (shrinking) XFS partitions can be difficult or impossible. Less feature-rich in terms of snapshots compared to Btrfs.
    • Recommendation:
      Suitable for large storage servers, systems dealing with very large files (e.g., video editing), or /home partitions if large file performance is critical.
  • FAT32 (File Allocation Table 32):

    • Use Case:
      This is required for the EFI System Partition (ESP). UEFI firmware can read FAT32.
    • Pros:
      Universally compatible.
    • Cons:
      Lacks journaling, permissions, and other features of modern Linux filesystems. Limited file and partition sizes (though generally not an issue for ESP).
  • Swap:

    • This isn't a file system for storing user files, but a special format for swap space.

For this guide, we'll primarily use Ext4 for / and /home due to its stability and simplicity, and FAT32 for the ESP. If you chose Btrfs or XFS, the mkfs command will change accordingly.

Formatting the Partitions

Let's assume you followed the workshop in the previous section and have these partitions on /dev/sdb (adjust device names like /dev/sda or /dev/nvme0n1pX as per your setup):

  • /dev/sdb1: EFI System Partition
  • /dev/sdb2: Swap Partition
  • /dev/sdb3: Root Partition
  • /dev/sdb4: Home Partition

Commands to format:

  1. Format the EFI System Partition (ESP):
    The ESP (e.g., /dev/sdb1) must be formatted as FAT32.

    mkfs.fat -F32 /dev/sdb1
    

    • mkfs.fat: Command to create a FAT filesystem.
    • -F32: Specifies FAT32 format.
    • /dev/sdb1: Your ESP partition. Double-check this device name!
  2. Format the Root Partition (/):
    Let's format the root partition (e.g., /dev/sdb3) as Ext4.

    mkfs.ext4 /dev/sdb3
    

    • mkfs.ext4: Command to create an Ext4 filesystem.
    • /dev/sdb3: Your root partition.
    • If you wanted Btrfs: mkfs.btrfs /dev/sdb3
    • If you wanted XFS: mkfs.xfs /dev/sdb3 (you might need to install xfsprogs first if not available: pacman -S xfsprogs)
  3. Format the Home Partition (/home) (if you created a separate one):
    Let's format the home partition (e.g., /dev/sdb4) as Ext4.

    mkfs.ext4 /dev/sdb4
    

    • /dev/sdb4: Your home partition.
    • Similarly, use mkfs.btrfs or mkfs.xfs if you chose those for /home.
  4. Initialize and Activate the Swap Partition:
    If you created a swap partition (e.g., /dev/sdb2):

    mkswap /dev/sdb2
    

    • mkswap: Command to set up a Linux swap area.
    • /dev/sdb2: Your swap partition.

    After initializing, you need to activate it for the current live session (it will be permanently enabled later via fstab):

    swapon /dev/sdb2
    
    You can verify swap is active with:
    free -h
    
    or
    swapon --show
    

Important Note on LVM/LUKS:

  • If you set up LVM (Scenario 3 in partitioning):
    1. Create Physical Volume (PV): pvcreate /dev/sdaX (your LVM partition)
    2. Create Volume Group (VG): vgcreate myvolumegroup /dev/sdaX
    3. Create Logical Volumes (LVs):
      lvcreate -L 20G myvolumegroup -n rootvol
      lvcreate -L 4G myvolumegroup -n swapvol  # Example swap size
      lvcreate -l 100%FREE myvolumegroup -n homevol # Uses remaining space
      
    4. Then format the LVs:
      mkfs.ext4 /dev/myvolumegroup/rootvol
      mkfs.ext4 /dev/myvolumegroup/homevol
      mkswap /dev/myvolumegroup/swapvol
      swapon /dev/myvolumegroup/swapvol
      
      (And format ESP and /boot partition as usual if they are separate non-LVM partitions.)
  • If you set up LUKS (Scenario 4 in partitioning):
    1. Encrypt the partition: cryptsetup luksFormat /dev/sdaX (your LUKS partition)
    2. Open the LUKS container: cryptsetup open /dev/sdaX cryptlvm (this creates /dev/mapper/cryptlvm)
    3. Then, set up LVM on /dev/mapper/cryptlvm as described above (e.g., pvcreate /dev/mapper/cryptlvm, etc.).
    4. Format LVs as above.

Mounting the File Systems

Now that the partitions are formatted, you need to mount them into a directory structure rooted at /mnt. This directory will temporarily represent the root filesystem of your new Arch Linux system.

  1. Mount the Root Partition (/):
    The root partition (e.g., /dev/sdb3 or /dev/myvolumegroup/rootvol if using LVM) must be mounted to /mnt.

    mount /dev/sdb3 /mnt
    

    • mount: The command to attach a filesystem to a specific directory.
    • /dev/sdb3: Your formatted root partition.
    • /mnt: The mount point.
  2. Create Mount Points for Other Partitions within /mnt:
    If you have other partitions like ESP (/boot or /boot/efi) and /home, you need to create directories for them inside /mnt before mounting.

    • For the ESP:
      The Arch Wiki and many guides recommend mounting the ESP at /mnt/boot. This is simple and works well. Another common practice is /mnt/efi, and then /boot would be part of the root filesystem or a separate partition. We will use /mnt/boot for the ESP here.

      mkdir /mnt/boot
      
      If you chose /mnt/efi (and /boot is not a separate partition to be mounted there):
      # mkdir -p /mnt/boot/efi  (if /boot is on root fs and ESP at /boot/efi)
      # OR
      # mkdir /mnt/efi (if ESP is at /efi and /boot is on root fs)
      

    • For the Home partition:

      mkdir /mnt/home
      

    • For a separate /boot partition (if you have one, e.g., in LVM/LUKS scenarios):
      If /dev/sda2 was your separate /boot partition (NOT the ESP):

      # mkdir /mnt/boot  (if not already made for ESP)
      # mount /dev/sda2 /mnt/boot
      # mkdir /mnt/boot/efi  (now create subdir for ESP)
      # mount /dev/sda1 /mnt/boot/efi (mount ESP here)
      
      However, for our primary example (Scenario 2 partitions: ESP, Swap, Root, Home), the ESP /dev/sdb1 will be mounted directly to /mnt/boot.

  3. Mount the EFI System Partition (ESP):
    Mount your ESP (e.g., /dev/sdb1) to the directory you created for it. For our example, /mnt/boot:

    mount /dev/sdb1 /mnt/boot
    

    • If you chose /mnt/efi as the mount point for ESP: mount /dev/sdb1 /mnt/efi
  4. Mount the Home Partition (/home):
    Mount your home partition (e.g., /dev/sdb4 or /dev/myvolumegroup/homevol) to /mnt/home:

    mount /dev/sdb4 /mnt/home
    

  5. Verify Mounts:
    Check that all partitions are mounted correctly:

    lsblk
    
    You should see your partitions listed with their respective mount points under /mnt (e.g., /mnt, /mnt/boot, /mnt/home). Example output for our Scenario 2:
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    sdb      8:16   0   XXG  0 disk
    ├─sdb1   8:17   0   512M  0 part /mnt/boot  <-- ESP
    ├─sdb2   8:18   0     4G  0 part [SWAP]     <-- Swap
    ├─sdb3   8:19   0    30G  0 part /mnt       <-- Root
    └─sdb4   8:20   0   XXG  0 part /mnt/home  <-- Home
    
    You can also use df -h to see disk usage and mount points.

Btrfs Specifics (Subvolumes) - Optional advanced topic

If you chose Btrfs for your root filesystem (e.g., on /dev/sdb3), you might want to use subvolumes for better organization and snapshot capabilities. A common Btrfs layout involves creating subvolumes for root (@) and home (@home), and potentially others like @var, @snapshots.

  1. Format the Btrfs partition:

    mkfs.btrfs -L myArchSystem /dev/sdb3
    
    (-L sets a label, optional).

  2. Mount the top-level Btrfs filesystem:

    mount /dev/sdb3 /mnt
    

  3. Create Btrfs subvolumes:

    btrfs subvolume create /mnt/@       # For root
    btrfs subvolume create /mnt/@home   # For home
    # Optionally for others:
    # btrfs subvolume create /mnt/@var
    # btrfs subvolume create /mnt/@snapshots
    

  4. Unmount the top-level Btrfs filesystem:

    umount /mnt
    

  5. Mount the Btrfs subvolumes with specific options:
    Common options include compress=zstd (or lzo), ssd (if on an SSD), noatime or relatime.

    # Mount the '@' subvolume as the system's root
    mount -o subvol=@,compress=zstd,ssd,noatime /dev/sdb3 /mnt
    
    # Create mount points for other subvolumes and ESP
    mkdir -p /mnt/home
    mkdir -p /mnt/boot # Or /mnt/efi, and then /mnt/boot/efi
    
    # Mount the '@home' subvolume
    mount -o subvol=@home,compress=zstd,ssd,noatime /dev/sdb3 /mnt/home
    
    # Mount ESP (e.g., /dev/sdb1)
    # mkfs.fat -F32 /dev/sdb1 (if not done)
    mount /dev/sdb1 /mnt/boot # Or /mnt/boot/efi
    
    # Activate swap (if using a swap partition)
    # mkswap /dev/sdb2
    # swapon /dev/sdb2
    
    If /home was on a separate Btrfs partition (e.g. /dev/sdb4), you'd format that, mount it temporarily, create its own @home subvolume, unmount, then mount the subvolume to /mnt/home.

This is a more advanced setup. For simplicity in the main guide, we are sticking to Ext4, but it's good to be aware of Btrfs subvolumes.

Workshop Formatting and Mounting Your Partitions

Goal: Format the partitions created in the previous workshop (ESP as FAT32, root as Ext4, home as Ext4, swap as swap). Mount them correctly under /mnt and activate swap.

Prerequisites: You have completed the partitioning workshop and have partitions similar to:

  • /dev/sdb1: ESP
  • /dev/sdb2: Swap
  • /dev/sdb3: Root
  • /dev/sdb4: Home (Remember to replace /dev/sdbX with your actual device names, e.g., /dev/sdaX or /dev/nvme0n1pX)

Steps:

  1. Verify Your Partition Scheme:
    Before formatting, list your partitions one last time to be absolutely sure of the device names and their intended purposes.

    lsblk
    
    Or for more detail:
    fdisk -l /dev/sdb
    
    Identify which partition is for ESP, which for swap, which for root (/), and which for home (/home). Let's say they are /dev/sdb1 (ESP), /dev/sdb2 (Swap), /dev/sdb3 (Root), /dev/sdb4 (Home).

  2. Format the EFI System Partition (ESP):
    Assuming /dev/sdb1 is your ESP:

    echo "Formatting ESP on /dev/sdb1 as FAT32..."
    mkfs.fat -F32 /dev/sdb1
    echo "ESP formatting complete."
    

  3. Initialize and Activate Swap Partition:
    Assuming /dev/sdb2 is your swap partition:

    echo "Initializing swap on /dev/sdb2..."
    mkswap /dev/sdb2
    echo "Activating swap on /dev/sdb2..."
    swapon /dev/sdb2
    echo "Swap setup complete. Verifying..."
    swapon --show
    free -h
    
    The swapon --show command should list your swap partition, and free -h should show non-zero total swap space.

  4. Format the Root Partition (/):
    Assuming /dev/sdb3 is your root partition, format as Ext4:

    echo "Formatting root partition /dev/sdb3 as Ext4..."
    mkfs.ext4 /dev/sdb3
    echo "Root partition formatting complete."
    
    (If you were to use Btrfs: mkfs.btrfs -f /dev/sdb3). The -f for btrfs might be needed if the partition previously held another filesystem.

  5. Format the Home Partition (/home):
    Assuming /dev/sdb4 is your home partition, format as Ext4:

    echo "Formatting home partition /dev/sdb4 as Ext4..."
    mkfs.ext4 /dev/sdb4
    echo "Home partition formatting complete."
    
    (If you were to use Btrfs: mkfs.btrfs -f /dev/sdb4).

  6. Mount the Root Partition:
    Mount your formatted root partition (/dev/sdb3) to /mnt:

    echo "Mounting root partition /dev/sdb3 to /mnt..."
    mount /dev/sdb3 /mnt
    echo "Root partition mounted."
    

  7. Create Mount Points within /mnt:
    We need directories for /boot (for ESP) and /home.

    echo "Creating /mnt/boot directory..."
    mkdir /mnt/boot
    echo "Creating /mnt/home directory..."
    mkdir /mnt/home
    echo "Mount point directories created."
    

  8. Mount the EFI System Partition (ESP):
    Mount your formatted ESP (/dev/sdb1) to /mnt/boot:

    echo "Mounting ESP /dev/sdb1 to /mnt/boot..."
    mount /dev/sdb1 /mnt/boot
    echo "ESP mounted."
    

  9. Mount the Home Partition:
    Mount your formatted home partition (/dev/sdb4) to /mnt/home:

    echo "Mounting home partition /dev/sdb4 to /mnt/home..."
    mount /dev/sdb4 /mnt/home
    echo "Home partition mounted."
    

  10. Verify All Mounts and Swap:
    Use lsblk to check the mount points and swapon --show for swap.

    echo "Verifying mounts with lsblk:"
    lsblk /dev/sdb # Or your main disk
    echo "Verifying swap status:"
    swapon --show
    echo "Verifying filesystem usage with df -h:"
    df -h
    
    You should see output similar to: For lsblk /dev/sdb:
    sdb
    ├─sdb1  /mnt/boot
    ├─sdb2  [SWAP]
    ├─sdb3  /mnt
    └─sdb4  /mnt/home
    
    For df -h, you'll see /mnt, /mnt/boot, and /mnt/home listed with their sizes and usage.

Reflection:

  • Were you able to format each partition with the correct filesystem type?
  • Did you successfully activate the swap partition? How did you verify it?
  • Are all your filesystems mounted at the correct locations under /mnt? What command did you use to verify this?
  • Why is the order of mounting (root first, then others into subdirectories of root's mount point) important? (Because the subdirectories like /mnt/boot must exist on the filesystem mounted at /mnt before you can mount something else into them.)

With your partitions formatted and correctly mounted, your system is now ready for the installation of the Arch Linux base packages.

4. Installing the Base System

Now that your partitions are prepared and mounted, it's time to install the core Arch Linux system. This involves two main steps: selecting optimal package download mirrors and then using the pacstrap script to download and install the base packages onto your target system (currently accessible via /mnt).

Selecting Mirrors

Arch Linux packages are downloaded from mirror servers located around the world. To ensure fast and reliable downloads, you should select mirrors that are geographically close to you and up-to-date.

The live environment comes with a default mirror list located at /etc/pacman.d/mirrorlist. However, this list might not be optimized for your location or current network conditions.

Using reflector to Optimize the Mirror List:
reflector is a script that can fetch the latest mirror status from the Arch Linux Mirror Status page, filter and sort them (e.g., by speed or age), and update your /etc/pacman.d/mirrorlist file.

  1. Ensure reflector is available and up-to-date (it usually is on recent ISOs, but good practice to check/refresh pacman's sync databases first):

    pacman -Syy
    
    This synchronizes the package databases from the mirrors currently in your /etc/pacman.d/mirrorlist.

  2. Back up the existing mirrorlist (optional, but good practice):

    cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
    

  3. Run reflector to generate a new mirrorlist:
    Here's an example command. You can customize it extensively:

    reflector --verbose --country 'United States' --country 'Canada' -a 6 --sort rate --save /etc/pacman.d/mirrorlist
    
    Let's break down this command:

    • --verbose: Shows more output about what reflector is doing.
    • --country 'United States' --country 'Canada': Filters mirrors by specified countries. You should replace these with your country or nearby countries. You can list multiple --country options. To see a list of available countries: reflector --list-countries.
    • -a 6: Filters for mirrors that have synchronized within the last 6 hours (-a means age).
    • --sort rate: Sorts the selected mirrors by their download speed (fastest first). Other sort options include age (most recently synchronized), score (uses a formula considering age and rate).
    • --save /etc/pacman.d/mirrorlist: Saves the generated list of mirrors to the specified file, overwriting the old one.

    A more general example, getting the 20 fastest HTTPS mirrors that synced in the last 12 hours from any country:

    reflector --verbose --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
    

    • --latest 20: Get the 20 most recently synchronized mirrors.
    • --protocol https: Prefers HTTPS mirrors.

    Recommendation:
    A good starting point for many users is to select a few countries nearby, sort by rate, and pick a reasonable number of mirrors (e.g., 5-10). Example for someone in Germany:

    reflector --verbose --country Germany --country France --country Netherlands -a 12 --sort rate --protocol https --save /etc/pacman.d/mirrorlist
    

  4. Verify the new mirrorlist (optional):
    You can open the file to see the selected mirrors:

    nano /etc/pacman.d/mirrorlist
    
    (Use Ctrl+X to exit nano). You should see Server = ... lines at the top, uncommented.

With an optimized mirror list, package downloads will be significantly faster.

Installing Essential Packages with pacstrap

The pacstrap script is used to install packages into the new system root (which is currently /mnt). It creates the necessary directory layout, installs the base packages, and sets up a minimal, functional Arch Linux environment.

  1. The pacstrap command:
    The basic command installs the base metapackage, the Linux kernel (linux), and firmware for common hardware (linux-firmware).

    pacstrap /mnt base linux linux-firmware
    

    • /mnt: The target directory where the new system will be installed.
    • base: A metapackage that pulls in all the essential utilities and libraries needed for a functional GNU/Linux system (things like systemd, bash, coreutils, pacman itself, etc.).
    • linux: The latest stable Arch Linux kernel package.
    • linux-firmware: Firmware files required by many hardware components (graphics cards, network adapters, etc.).
  2. Adding Other Useful Base Packages (Recommended):
    It's highly recommended to install a few more packages along with the base system. This makes configuring the system easier once you chroot into it. Common additions include:

    • A text editor: nano (easy to use) or vim (powerful, steeper learning curve).
    • Network management: networkmanager (provides both wired and wireless connectivity, widely used and user-friendly).
    • Man pages and documentation: man-db, man-pages, texinfo. These allow you to read manual pages for commands (e.g., man ls).
    • Optionally, other kernels: linux-lts (Long Term Support kernel, if you prefer more stability over the absolute latest features).
    • Filesystem utilities: If you used Btrfs or XFS, you might want to ensure btrfs-progs or xfsprogs are installed in the target system too (though base or kernel dependencies often pull these).

    An expanded pacstrap command might look like this:

    pacstrap /mnt base linux linux-firmware nano networkmanager man-db man-pages texinfo
    
    If you also want the LTS kernel:
    pacstrap /mnt base linux linux-lts linux-firmware nano networkmanager man-db man-pages texinfo
    

  3. Execution:
    Run your chosen pacstrap command. It will download all the required packages from the mirrors you selected and install them into /mnt. This process can take some time depending on your internet speed and the number of packages. You'll see progress bars and package names scrolling by.

    Example Output Snippet:

    ==> Creating install root at /mnt
    ==> Installing packages to /mnt
    :: Synchronizing package databases...
     core downloading...
     extra downloading...
     community downloading...
    :: There are XX members in group base:
    :: Repository core
       1) bash  2) bzip2  3) coreutils ...
    Enter a selection (default=all):  (Just press Enter here for all base packages)
    resolving dependencies...
    looking for conflicting packages...
    
    Packages (YY) package1-version package2-version ...
    
    Total Download Size:    ABC.XY MiB
    Total Installed Size:   XYZ.AB MiB
    
    :: Proceed with installation? [Y/n] (Press Y and Enter)
    :: Retrieving packages...
     downloading package1 from mirror...
     downloading package2 from mirror...
    ...
    :: Processing package changes...
    (1/YY) installing package1...
    (2/YY) installing package2...
    ...
    :: Running post-transaction hooks...
    (1/X) Arming ConditionNeedsUpdate...
    (2/X) Creating system user accounts...
    ...
    

  4. Verification (Optional but good):
    After pacstrap finishes without errors, you can peek into /mnt to see the newly installed system:

    ls /mnt
    
    You should see familiar Linux directories like bin, etc, usr, var, home, boot, etc. These are now populated with the base Arch Linux system.

Workshop pacstrap and Mirror Configuration

Goal:
Optimize the package mirror list using reflector and then install the Arch Linux base system, a kernel, firmware, a text editor, and NetworkManager onto your mounted partitions.

Prerequisites:

  • You have completed the "Formatting and Mounting" workshop.
  • Your root partition (e.g., /dev/sdb3) is mounted at /mnt.
  • Your ESP (e.g., /dev/sdb1) is mounted at /mnt/boot.
  • Your home partition (e.g., /dev/sdb4), if separate, is mounted at /mnt/home.
  • You have an active internet connection in the live environment.

Steps:

  1. Refresh Pacman Sync Databases:
    Before using reflector, ensure pacman's local database is up-to-date with the mirrors currently in /etc/pacman.d/mirrorlist.

    echo "Synchronizing package databases (pacman -Syy)..."
    pacman -Syy
    
    This step is important because reflector itself might need to be installed or updated, and it fetches a list of mirrors from a source defined in pacman's configuration.

  2. Backup Existing Mirrorlist:

    echo "Backing up current mirrorlist to /etc/pacman.d/mirrorlist.backup..."
    cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
    

  3. Run reflector:

    • First, find your country code if you don't know it:
      reflector --list-countries
      
      Note down your country and perhaps a couple of neighboring ones.
    • Now, construct your reflector command. For example, if you are in "Germany" and want the 10 fastest HTTPS mirrors updated in the last 12 hours, also considering "France" and "Netherlands":
      echo "Running reflector to optimize mirrorlist..."
      reflector --verbose \
          --country Germany --country France --country Netherlands \
          --age 12 \
          --protocol https \
          --sort rate \
          --threads 5 \
          --number 10 \
          --save /etc/pacman.d/mirrorlist
      
      • --threads 5: Use 5 parallel connections to test mirror speeds (can speed up reflector).
      • --number 10: Keep only the top 10 mirrors.
      • Adjust the countries, age, and number parameters to your preference.
      • If you prefer simplicity and global reach, a command like this works well:
        # reflector --verbose --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
        
    • Wait for reflector to finish. It will test various mirrors.
  4. Inspect the New Mirrorlist (Optional):

    echo "Displaying the first 15 lines of the new mirrorlist:"
    head -n 15 /etc/pacman.d/mirrorlist
    
    You should see uncommented Server = ... lines at the top.

  5. Install Base System and Additional Packages with pacstrap:
    We will install base, the standard linux kernel, linux-firmware, nano (text editor), networkmanager (for network management in the installed system), man-db, man-pages, and texinfo (for documentation).

    echo "Starting pacstrap. This may take some time..."
    pacstrap -K /mnt base linux linux-firmware nano networkmanager man-db man-pages texinfo
    

    • The -K option for pacstrap (or pacstrap /mnt ... since pacstrap 2.0) will copy the host's /etc/pacman.d/mirrorlist to /mnt/etc/pacman.d/mirrorlist and initialize pacman keys on the target. Before pacstrap 2.0, it was pacstrap -i /mnt ... and -i only prompted for base group, not copying mirrorlist nor keys. Modern pacstrap (after version that changed -i behavior) handles mirrorlist copy and keys initialization by default unless told not to. Using -K explicitly is good for clarity to initialize keys and copy mirrorlist, or just pacstrap /mnt ... is fine with modern versions. For simplicity and wider compatibility with ISO versions, pacstrap /mnt ... is often sufficient as it usually does the right thing. Let's stick to the simpler form unless issues arise.
    • Revised simpler command (modern pacstrap handles key init and mirrorlist copy from host):

      pacstrap /mnt base linux linux-firmware nano networkmanager man-db man-pages texinfo
      

    • When prompted Enter a selection (default=all): for the base group, just press Enter.

    • When asked :: Proceed with installation? [Y/n], type Y and press Enter.
    • Observe the download and installation process. This is the core of your Arch Linux system being laid down.
  6. Verify Installation (Basic Check):
    Once pacstrap completes successfully (no errors reported at the end):

    echo "Verifying some directories in /mnt..."
    ls /mnt # Should show bin, etc, usr, var, boot, home, etc.
    ls /mnt/usr/bin # Should show many executables
    ls /mnt/boot # Should show kernel (vmlinuz-linux) and initramfs images
    

Reflection:

  • How did reflector help in the installation process? What criteria did you use to select your mirrors?
  • What are the key components installed by pacstrap with base, linux, and linux-firmware?
  • Why did we include nano and networkmanager at this stage? (To have a text editor and network configuration tool immediately available after chrooting and on first boot).
  • If pacstrap failed, what would be your first troubleshooting steps? (Check internet connection, check mirrorlist for valid servers, check for typos in the command, ensure partitions are mounted correctly and have enough space).

Your Arch Linux base system is now installed on the disk! The next crucial step is to configure this system before you can boot into it. This involves generating an fstab file and then chrooting into your new environment.

5. Configuring the System

With the base packages installed, the next phase is to configure the newly installed system. This involves generating the file system table (fstab), changing root into the new system (arch-chroot), and then performing essential configurations like setting the time zone, locale, hostname, network, initramfs, and root password.

Generating an fstab

The fstab (file system table) file, located at /etc/fstab, is a system configuration file that defines how disk partitions and other block devices are mounted into the filesystem hierarchy.

The genfstab script is used to auto-detect and generate an fstab file based on the currently mounted partitions under /mnt.

  1. Run genfstab:

    genfstab -U /mnt >> /mnt/etc/fstab
    

    • -U: Use UUIDs (Universally Unique Identifiers) to identify the partitions. This is more robust than using device names like /dev/sda1, as device names can sometimes change.
    • /mnt: The root of the new system where the mounted partitions are. genfstab will scan this hierarchy.
    • >> /mnt/etc/fstab: Appends the output to the fstab file within the new system. Using >> (append) is generally safer than > (overwrite) if you were to run it multiple times, though for a fresh install > would also work if the file doesn't exist or is empty.
  2. Verify the generated fstab:
    It's crucial to check the contents of /mnt/etc/fstab to ensure it correctly reflects your partitioning scheme and mount options.

    nano /mnt/etc/fstab
    
    You should see entries for your root (/), ESP (/boot or /efi), home (/home), and swap partitions.

    Example fstab entries:

    # <file system> <dir> <type> <options> <dump> <pass>
    
    # /dev/sdb3 (root)
    UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx   /           ext4        rw,relatime 0 1
    
    # /dev/sdb1 (ESP mounted at /boot)
    UUID=YYYY-YYYY                              /boot       vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
    
    # /dev/sdb4 (home)
    UUID=zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz   /home       ext4        rw,relatime 0 2
    
    # /dev/sdb2 (swap)
    UUID=wwwwwwww-wwww-wwww-wwww-wwwwwwwwwwww   none        swap        defaults    0 0
    

    • <file system>: UUID of the partition.
    • <dir>: Mount point.
    • <type>: Filesystem type (e.g., ext4, vfat, swap, btrfs).
    • <options>: Mount options (e.g., rw for read-write, relatime for updating access times efficiently).
      • For vfat (ESP), common options include rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro. Some defaults might use utf8 for iocharset which is also fine.
      • For swap, defaults is usually sufficient.
    • <dump>: Used by the dump utility (usually 0 to disable).
    • <pass>: Determines the order for filesystem checks (fsck) at boot time.
      • 0: Do not check.
      • 1: Root filesystem (checked first).
      • 2: Other filesystems to be checked after root.

    Ensure all your intended persistent mounts are present and look correct. If you used Btrfs subvolumes, the fstab entries would include subvol=... options.

Chrooting into the New System

chroot (change root) is a command that changes the apparent root directory for the current running process and its children. This allows you to work directly within your newly installed Arch Linux system as if you had booted into it.

arch-chroot /mnt
  • arch-chroot is a wrapper script provided by Arch that handles mounting necessary virtual file systems like /proc, /sys, /dev into the chroot environment, making it fully functional.
  • After running this command, your shell prompt will likely change, indicating you are now operating within the /mnt environment as its root. For example, it might look like [root@archiso /]# or similar, but / now refers to the /mnt of the live environment. Any command you run will affect the new system.

You are now "inside" your new Arch Linux installation.

Setting the Time Zone

  1. List Time Zones (optional, to find yours):
    Time zones are located in /usr/share/zoneinfo/.
    ls /usr/share/zoneinfo/
    # Example: ls /usr/share/zoneinfo/Europe/
    # Example: ls /usr/share/zoneinfo/America/
    
  2. Create a symbolic link from /etc/localtime to your zoneinfo file:
    Replace Region/City with your actual time zone. For example, Europe/Berlin or America/New_York.

    ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
    
    Example for US Eastern Time:
    ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
    
    Example for London:
    ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
    

  3. Set the Hardware Clock:
    This command sets the hardware clock (RTC, the clock in your motherboard) from the system clock. It's generally recommended to set the hardware clock to UTC.

    hwclock --systohc
    

    • --systohc: Set hardware clock from system clock. By default, it assumes the hardware clock is in UTC. If your hardware clock is set to local time (common if dual-booting with Windows, though Windows can also be configured to use UTC), you might need hwclock --systohc --localtime. However, UTC is the Linux standard.

Localization

Localization involves configuring your system's language, character encoding, and keyboard layout preferences.

  1. Edit /etc/locale.gen:
    This file lists all available locales. You need to uncomment the locales you want to generate.

    nano /etc/locale.gen
    
    Find the line(s) for your desired locale(s) and remove the # at the beginning. For example, for US English with UTF-8 encoding:
    en_US.UTF-8 UTF-8
    
    If you need British English:
    en_GB.UTF-8 UTF-8
    
    For German (Germany):
    de_DE.UTF-8 UTF-8
    
    It's good practice to at least have en_US.UTF-8 UTF-8 uncommented as a fallback, in addition to your primary locale. Save the file and exit (Ctrl+O, Enter, Ctrl+X in nano).

  2. Generate Locales:
    Run the locale-gen command to generate the uncommented locales:

    locale-gen
    
    You should see output indicating the locales are being generated.

  3. Set the LANG variable in /etc/locale.conf:
    This file sets the default system-wide locale.

    echo "LANG=en_US.UTF-8" > /etc/locale.conf
    
    Replace en_US.UTF-8 with your primary chosen locale from locale.gen. For example:
    # echo "LANG=de_DE.UTF-8" > /etc/locale.conf
    

  4. Set Keyboard Layout Persistently (Console):
    To make the console keyboard layout (used in TTYs, before Xorg starts) persistent across reboots, create or edit /etc/vconsole.conf.

    nano /etc/vconsole.conf
    
    Add a line like:
    KEYMAP=us
    
    Replace us with your desired keymap (e.g., de-latin1, uk, fr). This is the same name you used with loadkeys earlier. Save and exit.

Network Configuration

  1. Set the Hostname:
    The hostname is a name for your computer on the network.

    echo "myarchpc" > /etc/hostname
    
    Replace myarchpc with your desired hostname (e.g., arch-desktop, yourname-laptop).

  2. Configure /etc/hosts:
    Add matching entries to /etc/hosts. This file is used for local hostname resolution.

    nano /etc/hosts
    
    Add the following lines (replace myarchpc with your chosen hostname):
    127.0.0.1   localhost
    ::1         localhost
    127.0.1.1   myarchpc.localdomain myarchpc
    
    Save and exit.

  3. Enable a Network Management Service:
    If you installed networkmanager with pacstrap (recommended), you should enable its service so it starts automatically on boot.

    systemctl enable NetworkManager
    

    • systemctl enable: This creates symbolic links that cause systemd to start the service during the boot process.
    • NetworkManager: The service name for NetworkManager.
    • If you chose a different network manager (e.g., systemd-networkd and systemd-resolved for wired/manual configuration), you would enable those services instead. For most desktop/laptop users, NetworkManager is convenient.

Initramfs (Initial RAM File System)

The initramfs is a gzipped cpio archive containing an initial root filesystem that is loaded into memory during the Linux boot process. It contains kernel modules and utilities necessary to mount the real root filesystem (e.g., drivers for your disk controller, LVM, LUKS decryption tools).

The mkinitcpio utility is used to generate initramfs images. The base package should have set up a default configuration in /etc/mkinitcpio.conf.

  1. Review /etc/mkinitcpio.conf (Optional but good to know):

    nano /etc/mkinitcpio.conf
    
    Pay attention to the HOOKS array. The default HOOKS line usually includes base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck.

    • If you are using LVM, you need the lvm2 hook (usually before filesystems).
    • If you are using LUKS encryption, you need the encrypt hook (usually before lvm2 if LVM is on LUKS, and before filesystems).
    • If you are using Btrfs on the root partition, the fsck hook is not needed for Btrfs (as btrfs check is not run automatically this way) and btrfs hook might be needed if root is on btrfs and something special is needed. The filesystems hook generally handles Btrfs mounting.
    • The order of hooks matters. For example, keyboard and keymap are needed before encrypt if you want to type your LUKS passphrase with the correct keyboard layout.
  2. Re-generate the Initramfs:
    Even if you didn't change the config, it's good practice to regenerate it, especially if multiple kernels were installed or to ensure it's built correctly within the chroot.

    mkinitcpio -P
    

    • -P (uppercase P): Generate initramfs for all presets defined in /etc/mkinitcpio.d/ (e.g., linux.preset, linux-lts.preset if you installed LTS kernel). This will create files like /boot/initramfs-linux.img and /boot/initramfs-linux-fallback.img.

Setting the Root Password

The root user is the superuser with unrestricted privileges. You must set a password for it.

passwd
You will be prompted to enter the new password twice. Choose a strong password and remember it.

Workshop System Configuration within Chroot

Goal:
Perform essential system configurations within the chroot environment: generate fstab, set timezone, configure locales, set hostname, enable NetworkManager, regenerate initramfs, and set the root password.

Prerequisites:

  • You have successfully completed the pacstrap workshop.
  • Your new Arch system is installed under /mnt.

Steps:

  1. Generate fstab:

    echo "Generating fstab..."
    genfstab -U /mnt >> /mnt/etc/fstab
    echo "fstab generated. Verifying its content (first 15 lines):"
    head -n 15 /mnt/etc/fstab
    
    (Optional: nano /mnt/etc/fstab to inspect fully). Ensure entries for /, /boot, /home (if separate), and swap look correct with UUIDs.

  2. Enter the Chroot Environment:

    echo "Entering chroot environment..."
    arch-chroot /mnt
    
    Your prompt should change, indicating you are now in the new system's root. pwd should show /.

  3. Set Time Zone:

    • Find your region/city (e.g., America/Los_Angeles, Europe/Paris).
    • Create the symlink (replace Your/City accordingly):
      echo "Setting timezone to America/Los_Angeles (example)..." # Change this to your actual desired timezone
      ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
      
    • Set hardware clock to UTC:
      echo "Setting hardware clock to UTC..."
      hwclock --systohc
      echo "Timezone and hardware clock set."
      date # To verify current system time
      
  4. Configure Locales:

    • Edit /etc/locale.gen to uncomment your locale(s). We'll uncomment en_US.UTF-8 UTF-8 and, for example, de_DE.UTF-8 UTF-8.
      echo "Configuring locales..."
      echo "Uncommenting en_US.UTF-8 and de_DE.UTF-8 in /etc/locale.gen..."
      sed -i '/^#en_US.UTF-8 UTF-8/s/^#//' /etc/locale.gen
      sed -i '/^#de_DE.UTF-8 UTF-8/s/^#//' /etc/locale.gen # Example for German
      # You can also use nano: nano /etc/locale.gen
      
    • Generate locales:
      locale-gen
      
    • Set default language in /etc/locale.conf (e.g., en_US.UTF-8):
      echo "Setting LANG=en_US.UTF-8 in /etc/locale.conf..."
      echo "LANG=en_US.UTF-8" > /etc/locale.conf
      
    • Set console keyboard layout in /etc/vconsole.conf (e.g., us or de-latin1):
      echo "Setting KEYMAP=us in /etc/vconsole.conf..."
      echo "KEYMAP=us" > /etc/vconsole.conf
      echo "Locales configured."
      
  5. Configure Network:

    • Set hostname (e.g., myarchbox):
      echo "Setting hostname to myarchbox..."
      echo "myarchbox" > /etc/hostname
      
    • Add entries to /etc/hosts:
      echo "Configuring /etc/hosts..."
      cat <<EOF > /etc/hosts
      127.0.0.1   localhost
      ::1         localhost
      127.0.1.1   myarchbox.localdomain myarchbox
      EOF
      # Make sure to use the same hostname as above in the 127.0.1.1 line
      
    • Enable NetworkManager service:
      echo "Enabling NetworkManager service..."
      systemctl enable NetworkManager
      echo "Network configured."
      
  6. Regenerate Initramfs:

    • If you used LVM or encryption, you would first edit /etc/mkinitcpio.conf to add lvm2 or encrypt hooks. For our standard setup, defaults are fine.
      echo "Regenerating initramfs images (mkinitcpio -P)..."
      mkinitcpio -P
      echo "Initramfs regeneration complete."
      
  7. Set Root Password:

    echo "Setting root password. Please enter a strong password twice."
    passwd
    
    Follow the prompts to set and confirm your root password.

Reflection:

  • What is the purpose of the fstab file, and why are UUIDs preferred?
  • What does arch-chroot do, and why is it necessary?
  • If you forget to set the correct timezone, what issues might you encounter? (Incorrect file timestamps, SSL certificate validation issues, problems with cron jobs).
  • Why is regenerating the initramfs (mkinitcpio -P) important, especially after kernel updates or changes to hooks? (To ensure the boot process has all necessary modules and configurations to find and mount the root filesystem).

You have now configured the core aspects of your new Arch Linux system. The final step before rebooting is to install a bootloader.

6. Bootloader Installation

A bootloader is a crucial piece of software that loads the operating system's kernel into memory when the computer starts. Without a bootloader, your system won't know how to boot into Arch Linux. We will cover two popular choices: GRUB (widely used, feature-rich) and systemd-boot (simpler, for UEFI systems only).

Important:
The choice of bootloader and its installation method depends on whether your system is using UEFI or legacy BIOS firmware. You should have verified this in the "Pre-installation Setup" section (ls /sys/firmware/efi/efivars).

Understanding Bootloaders

  • GRUB (Grand Unified Bootloader):

    • The most common bootloader for Linux distributions.
    • Highly configurable and powerful.
    • Supports BIOS and UEFI systems, various filesystems, LVM, LUKS encryption, and multi-booting with other operating systems.
    • Can be a bit more complex to configure than systemd-boot.
  • systemd-boot (formerly Gummiboot):

    • A simple UEFI boot manager. It does not work with BIOS systems.
    • Part of the systemd project.
    • Easier to configure as it involves simple text files for boot entries.
    • Typically requires the EFI System Partition (ESP) to be mounted at /boot (or it can manage kernels/initramfs images directly on the ESP if copied there).

You should still be in the arch-chroot environment for these steps.

Microcode Updates

Processor microcode is firmware for your CPU, released by Intel or AMD to fix bugs or security vulnerabilities. It's highly recommended to install and load microcode updates.

  1. Install the appropriate microcode package:
    • For Intel CPUs:
      pacman -S intel-ucode
      
    • For AMD CPUs:
      pacman -S amd-ucode
      
      Install the one corresponding to your CPU manufacturer. If unsure, you can install both; the bootloader will pick the correct one.

The bootloader needs to be configured to load this microcode before the kernel. GRUB usually handles this automatically if the package is installed when grub-mkconfig is run. For systemd-boot, you'll add an initrd line for it in the boot entry.

Option 1 GRUB (Grand Unified Bootloader)

GRUB is a versatile choice suitable for most systems.

GRUB Installation for UEFI Systems

Prerequisites:

  • You booted the Arch ISO in UEFI mode.
  • You have an EFI System Partition (ESP), typically mounted at /boot (as in our workshop) or /efi. If it's at /efi, adjust the --efi-directory path accordingly.
  • The efibootmgr package is needed by grub-install to interact with the UEFI firmware.

Steps:

  1. Install GRUB and efibootmgr:

    pacman -S grub efibootmgr
    

  2. Install GRUB to the ESP: The command installs GRUB's UEFI application to the ESP and creates an entry in the firmware's boot manager.

    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
    

    • --target=x86_64-efi: Specifies the target architecture and firmware type.
    • --efi-directory=/boot: Crucial! This is the mount point of your ESP. If your ESP is mounted at /efi, use --efi-directory=/efi.
    • --bootloader-id=GRUB: This is the name that will appear in the UEFI boot menu for this GRUB installation (e.g., "GRUB"). You can change it (e.g., "ArchLinux").
    • --recheck: Can be added if you encounter issues; it forces grub-install to re-probe devices.
    • No device path (like /dev/sda) is specified for UEFI.

    If successful, you'll see "Installation finished. No error reported."

  3. Generate the GRUB Configuration File (grub.cfg): GRUB needs a configuration file (/boot/grub/grub.cfg) that tells it what operating systems and kernels to boot. The grub-mkconfig tool generates this file by scanning your system.

    grub-mkconfig -o /boot/grub/grub.cfg
    

    • -o /boot/grub/grub.cfg: Specifies the output file path.
    • This command should detect your Arch Linux kernel(s) (e.g., linux and linux-lts if installed) and the microcode updates (if intel-ucode or amd-ucode is installed).
    • It will also detect other operating systems like Windows if os-prober is installed (pacman -S os-prober) and they are present. For os-prober to work effectively with GRUB, you might need to enable it in /etc/default/grub by uncommenting/adding GRUB_DISABLE_OS_PROBER=false before running grub-mkconfig.

GRUB Installation for BIOS/MBR Systems

Prerequisites:

  • You booted the Arch ISO in BIOS/Legacy mode.
  • You have an MBR partition table (or GPT with a BIOS boot partition if doing advanced setup, but standard MBR is simpler for pure BIOS).

Steps:

  1. Install GRUB:
    (You don't need efibootmgr for BIOS.)

    pacman -S grub
    

  2. Install GRUB to the Master Boot Record (MBR):
    This command installs GRUB's boot code to the MBR of your disk (or to a BIOS boot partition if you have one and specify it).

    grub-install --target=i386-pc /dev/sdX
    

    • --target=i386-pc: Specifies the target for BIOS systems.
    • /dev/sdX: Crucial! This is your main boot disk (e.g., /dev/sda), NOT a partition like /dev/sda1. GRUB will be written to the MBR of this disk.
    • --recheck: Can be added if needed.

    If successful, you'll see "Installation finished. No error reported."

  3. Generate the GRUB Configuration File (grub.cfg):
    Same command as for UEFI:

    grub-mkconfig -o /boot/grub/grub.cfg
    

Option 2 systemd-boot (UEFI Systems Only)

systemd-boot is a simpler alternative to GRUB for UEFI systems. It's less feature-rich but often easier to manage if your needs are basic.

Prerequisites:

  • UEFI system and UEFI boot mode.
  • ESP mounted at /boot. This is the most straightforward setup for systemd-boot, as it expects kernels and initramfs images to be directly on the ESP. If your ESP is mounted elsewhere (e.g., /efi), you'd need to copy kernel, initramfs, and microcode to /efi and adjust paths in loader entries. For this guide, we assume ESP is at /boot.

Steps:

  1. Install systemd-boot boot manager to the ESP:
    The bootctl command is used to manage systemd-boot.

    bootctl --path=/boot install
    

    • --path=/boot: Specifies the mount point of your ESP.
    • This command installs systemd-boot binaries to the ESP (e.g., /boot/EFI/systemd/systemd-bootx64.efi and /boot/EFI/BOOT/BOOTX64.EFI as a fallback). It also creates a boot entry in the firmware.
  2. Configure the Loader (/boot/loader/loader.conf):
    This file contains general settings for systemd-boot.

    nano /boot/loader/loader.conf
    
    A minimal configuration might look like:
    default arch.conf  # Or arch-*.conf, refers to your default entry file name
    timeout 3          # Seconds to wait before auto-booting default
    console-mode max   # Try to set highest console mode
    editor no          # Disable editing kernel parameters from menu (set to 'yes' to enable)
    

    • default: Specifies which boot entry file in /boot/loader/entries/ to boot by default. We will create arch.conf next.
    • If you use default @saved, systemd-boot will remember the last selected entry.
    • You can use wildcards like default arch-*.conf and it will pick the one that sorts first alphabetically if you have multiple arch entries.
  3. Create Boot Entries (/boot/loader/entries/):
    For each kernel you want to boot, you create a .conf file in /boot/loader/entries/.

    • Example for the standard linux kernel (/boot/loader/entries/arch.conf):

      nano /boot/loader/entries/arch.conf
      
      Add the following content (replace YOUR_ROOT_PARTITION_UUID):
      title   Arch Linux
      linux   /vmlinuz-linux
      initrd  /intel-ucode.img   # Or /amd-ucode.img if you have AMD
      initrd  /initramfs-linux.img
      options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw
      

      • title: The name displayed in the boot menu.
      • linux: Path to the kernel image (relative to /boot).
      • initrd: Path to the microcode image (must be listed before the main initramfs).
      • initrd: Path to the initramfs image.
      • options: Kernel command-line parameters.
        • root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx: Crucial! Specifies the root filesystem.
          • Find the UUID of your root partition (e.g., /dev/sdb3) by running: blkid -s UUID -o value /dev/sdb3 (run this command outside chroot, or if inside chroot, use the correct device path your system sees).
        • rw: Mount root filesystem as read-write.
        • Other options can be added here (e.g., quiet for less boot verbosity, resume=UUID=... for hibernation).
    • Example for linux-lts kernel (if installed) (/boot/loader/entries/arch-lts.conf):

      nano /boot/loader/entries/arch-lts.conf
      
      title   Arch Linux (LTS Kernel)
      linux   /vmlinuz-linux-lts
      initrd  /intel-ucode.img   # Or /amd-ucode.img
      initrd  /initramfs-linux-lts.img
      options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw
      
      (Use the same root partition UUID).

    Finding the Root Partition UUID:
    While still in chroot, you can use blkid on the device name your new system will see. If your root partition was /dev/sdb3 in the live environment and is now / inside chroot, you still need the UUID for /dev/sdb3. It's often easier to get this from the /etc/fstab you generated:

    cat /etc/fstab
    
    Look for the line corresponding to / and copy its UUID.

    Alternatively, exit chroot temporarily, run blkid /dev/sdb3 (your root part), copy UUID, then arch-chroot /mnt again.

Workshop Installing and Configuring GRUB (UEFI)

Goal:
Install the necessary microcode package, then install and configure GRUB as the bootloader for a UEFI system where the ESP is mounted at /boot.

Prerequisites:

  • You are still in the arch-chroot /mnt environment.
  • Your system is UEFI-based and you booted the live ISO in UEFI mode.
  • Your ESP is mounted at /boot.
  • Packages like base, linux, linux-firmware are installed.

Steps:

  1. Install Microcode:

    • Determine your CPU manufacturer. If unsure, you can look at lscpu | grep "Vendor ID". GenuineIntel for Intel, AuthenticAMD for AMD.
    • Let's assume you have an Intel CPU for this example. If AMD, use amd-ucode.
      echo "Installing Intel microcode (intel-ucode)..."
      pacman -S intel-ucode
      # If AMD: pacman -S amd-ucode
      echo "Microcode package installed."
      
  2. Install GRUB and efibootmgr:

    echo "Installing GRUB and efibootmgr..."
    pacman -S grub efibootmgr
    echo "GRUB and efibootmgr installed."
    

  3. Run grub-install for UEFI:
    Ensure your ESP is indeed mounted at /boot within the chroot (it should be if you followed previous steps: / from the live ISO's /mnt is now / in chroot, and /mnt/boot from live ISO is now /boot in chroot).

    echo "Running grub-install for UEFI..."
    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=ARCHGRUB --recheck
    

    • We use --bootloader-id=ARCHGRUB to give it a distinct name in the UEFI boot menu.
    • --recheck is a good addition to ensure devices are properly scanned.
    • If this command fails, common issues include:
      • Not being in UEFI boot mode (chroot from a BIOS-booted live ISO).
      • ESP not mounted correctly at --efi-directory.
      • efibootmgr not installed or not working.
      • No space on ESP (unlikely with 512MB but possible if much else is there).
    • If successful, it will say: "Installation finished. No error reported."
  4. Generate GRUB Configuration File:
    Optional: If you plan to dual-boot with Windows and want GRUB to detect it, install os-prober first and ensure it's enabled.

    # Optional for dual-boot detection:
    # pacman -S os-prober
    # nano /etc/default/grub
    #   Ensure GRUB_DISABLE_OS_PROBER=false is present and uncommented. Save.
    
    Now generate grub.cfg:
    echo "Generating GRUB configuration file (grub.cfg)..."
    grub-mkconfig -o /boot/grub/grub.cfg
    

    • This command should detect your Linux kernels (e.g., vmlinuz-linux) and the installed microcode (intel-ucode.img or amd-ucode.img). It will automatically add the microcode as an initrd line before the main initramfs-linux.img in the GRUB menu entries.
    • Inspect the output. You should see lines like "Found linux image: /boot/vmlinuz-linux", "Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux.img".
  5. Verify Bootloader Files (Optional but good practice):
    Check if GRUB files are present on the ESP:

    ls /boot/EFI/ARCHGRUB/ # Should contain grubx64.efi
    ls /boot/grub/         # Should contain grub.cfg and other files
    

Reflection:

  • Why is microcode important, and how does GRUB handle loading it? (GRUB, via grub-mkconfig and os-prober or internal scripts, detects the ucode package and adds it as an initial ramdisk before the main initramfs).
  • What is the purpose of efibootmgr in a UEFI GRUB installation? (It allows grub-install to interact with the motherboard's UEFI firmware to register the GRUB bootloader application, so the firmware knows to load it).
  • What are the key differences in grub-install commands for UEFI vs. BIOS?
    • UEFI: grub-install --target=x86_64-efi --efi-directory=/path/to/esp --bootloader-id=NAME (no device like /dev/sda).
    • BIOS: grub-install --target=i386-pc /dev/sda (device specified, MBR targeted).
  • If, after reboot, GRUB doesn't appear, what could be wrong? (UEFI boot order not pointing to GRUB, grub-install failed to write to firmware, Secure Boot enabled and GRUB not signed, ESP not formatted correctly or not recognized).

With the bootloader installed, your Arch Linux system should now be bootable! The next step is to exit the chroot, unmount partitions, and reboot.

7. Post-installation Setup

You've successfully installed the base Arch Linux system, configured it, and installed a bootloader. It's time to reboot into your new installation and perform essential post-installation tasks to make it a usable desktop or server environment.

Exiting Chroot and Unmounting

  1. Exit the Chroot Environment:
    If you are still inside the arch-chroot /mnt environment, type:

    exit
    
    This will return you to the live ISO's shell (root@archiso ~ #).

  2. Unmount All Partitions:
    It's crucial to unmount all partitions you mounted under /mnt before rebooting. The -R (recursive) option for umount can be helpful, but sometimes it's better to unmount explicitly, starting from the most deeply nested. If your mounts were /mnt, /mnt/boot, /mnt/home:

    umount /mnt/home  # If you had a separate home
    umount /mnt/boot  # Unmount ESP (or separate /boot)
    umount /mnt       # Unmount root
    
    Alternatively, umount -R /mnt attempts to unmount /mnt and everything beneath it.
    umount -R /mnt
    
    If you encounter "target is busy" errors, ensure no processes (like an open terminal still cd-ed into /mnt) are using the mounts. You can use fuser -km /mnt/path to kill processes using a mount point, but unmounting in reverse order of mounting usually works. Also, if you activated swap on a partition (swapon /dev/sdXN), you can deactivate it now, though the system will handle it on shutdown/reboot:
    swapoff /dev/sdXN # e.g., swapoff /dev/sdb2
    

  3. Reboot the System:

    reboot
    
    Important: Remove the Arch Linux installation USB drive as soon as the computer starts to reboot. Otherwise, you might boot back into the live environment.

First Boot into the New System

If everything went well, you should see your bootloader (GRUB or systemd-boot) menu. Select your Arch Linux entry and press Enter. After the kernel loads and systemd initializes, you should be greeted by a login prompt on a TTY (text console):

Arch Linux <kernel_version> (tty1)
myarchbox login:
(Replace myarchbox with the hostname you set).

Login as the root user with the password you set earlier.

Troubleshooting Boot Issues:

  • System doesn't boot / No bootloader menu:
    • Check BIOS/UEFI boot order: Ensure the hard drive with Arch Linux is the primary boot device and the correct UEFI entry (e.g., "ARCHGRUB") is selected.
    • Secure Boot: If enabled, it might be blocking GRUB. Try disabling Secure Boot in UEFI settings.
    • Bootloader installation error: You might need to boot back into the Arch ISO, arch-chroot again, and try reinstalling/reconfiguring the bootloader.
  • Kernel Panic:
    • Often indicates issues with initramfs, missing kernel modules, or incorrect root= parameter in bootloader config.
    • Check fstab and bootloader configuration for correct UUIDs/device names.
    • Rebuild initramfs (mkinitcpio -P) in chroot.
  • Stuck at "A start job is running for...":
    • Often related to fstab entries for partitions that can't be mounted (wrong UUID, filesystem corruption, device not found).
    • Check fstab carefully.

Creating a User Account

Operating as root for daily tasks is dangerous. You should create a regular user account for yourself.

  1. Create the User:
    Replace yourusername with your desired username.

    useradd -m -G wheel -s /bin/bash yourusername
    

    • -m: Creates the user's home directory (e.g., /home/yourusername).
    • -G wheel: Adds the user to the wheel group. The wheel group is traditionally used to control who can use sudo.
    • -s /bin/bash: Sets the user's default login shell to Bash. Other shells like zsh or fish can be used if installed (pacman -S zsh, then use /bin/zsh).
  2. Set a Password for the New User:

    passwd yourusername
    
    Enter and confirm a strong password for your new user.

Setting up Sudo

sudo (superuser do) allows permitted users to execute commands as the root user (or other users) by prefixing commands with sudo.

  1. Install sudo (if not already pulled in by base or another package, though it usually is):

    pacman -S sudo
    

  2. Configure sudo using visudo:
    The sudoers file (/etc/sudoers) controls who can use sudo and what they can do. Always edit this file using the visudo command, as it checks for syntax errors before saving. A syntax error in /etc/sudoers can lock you out of sudo.

    visudo
    
    This will open /etc/sudoers in a text editor (usually vi or nano by default, visudo respects the EDITOR environment variable). Look for the line:
    # %wheel ALL=(ALL:ALL) ALL
    
    Uncomment it by removing the # at the beginning:
    %wheel ALL=(ALL:ALL) ALL
    
    This line means: "Users in the wheel group can execute any command (ALL) on any host (ALL=) as any user ((ALL:ALL))". Save the file and exit:

    • In vi: Press Esc, then type :wq and Enter.
    • In nano: Press Ctrl+O, Enter (to write), then Ctrl+X (to exit).

Now, log out of the root session (exit) and log back in as your new user (yourusername). You should be able to use sudo, e.g., sudo pacman -Syu. You'll be prompted for your user's password, not the root password.

Graphics Drivers

To use a graphical desktop environment, you need graphics drivers.

  1. Identify Your Graphics Card:

    lspci -k | grep -A 2 -E "(VGA|3D)"
    
    This command lists PCI devices and filters for VGA-compatible controllers or 3D controllers. Look for "Kernel driver in use" and the model of your card (NVIDIA, AMD, Intel).

  2. Install Drivers:

    • Intel Integrated Graphics: The open-source drivers are part of Mesa and usually work out-of-the-box.
      sudo pacman -S mesa libva-intel-driver intel-media-driver vulkan-intel
      
      (libva-intel-driver and intel-media-driver are for video acceleration; vulkan-intel for Vulkan support).
    • AMD Radeon Graphics (Open Source): Modern AMD GPUs are well-supported by open-source drivers in Mesa.
      sudo pacman -S mesa xf86-video-amdgpu vulkan-radeon libva-mesa-driver mesa-vdpau
      
      (xf86-video-amdgpu is the Xorg DDX driver, vulkan-radeon for Vulkan, libva-mesa-driver and mesa-vdpau for video acceleration). For very old AMD cards, you might need xf86-video-ati.
    • NVIDIA Graphics: You have options:
      • Open-source nouveau driver: Part of Mesa. Installed by default if mesa is present. Performance is generally lower than proprietary drivers, especially for newer cards and gaming.
        sudo pacman -S mesa
        
      • Proprietary NVIDIA driver:
        Offers the best performance and features.
        There are several versions:
        • nvidia: For recent GPUs.
        • nvidia-lts: For use with the linux-lts kernel.
        • nvidia-dkms: Builds the kernel module automatically if you use custom kernels or update kernels frequently.
        • Older drivers for legacy cards: nvidia-390xx-dkms, nvidia-470xx-dkms. Check the Arch Wiki for which driver your card needs. For a recent card with the standard linux kernel:
          sudo pacman -S nvidia nvidia-utils nvidia-settings
          
          If using linux-lts:
          sudo pacman -S nvidia-lts nvidia-settings
          
          After installing NVIDIA proprietary drivers, you often need to reboot or at least rebuild your initramfs (sudo mkinitcpio -P) and restart your display manager for changes to take effect properly, especially if nouveau was previously active. nouveau also needs to be blacklisted, but the nvidia package often handles this.

Installing a Desktop Environment or Window Manager

Arch Linux doesn't come with a graphical environment by default. You need to install one.

  1. Install Xorg Server (Display Server):
    Most desktop environments and window managers require Xorg.

    sudo pacman -S xorg-server xorg-xinit xorg-apps
    

    • xorg-server: The main X server.
    • xorg-xinit: For launching X sessions with startx (useful for window managers or testing).
    • xorg-apps: A group of basic X applications and utilities.
  2. Choose and Install a Desktop Environment (DE) or Window Manager (WM):

    • Desktop Environments (provide a full suite of integrated applications and tools):

      • GNOME: Modern, user-friendly, can be resource-intensive.
        sudo pacman -S gnome gnome-tweaks
        sudo systemctl enable gdm  # GNOME Display Manager
        
      • KDE Plasma: Highly customizable, feature-rich, moderately resource-intensive.
        sudo pacman -S plasma-meta sddm konsole dolphin
        # plasma-meta pulls in most of plasma. sddm is a display manager. konsole terminal, dolphin file manager.
        sudo systemctl enable sddm
        
      • XFCE: Lightweight, fast, traditional desktop.
        sudo pacman -S xfce4 xfce4-goodies lightdm lightdm-gtk-greeter
        sudo systemctl enable lightdm
        
      • Cinnamon: Traditional desktop layout, developed by Linux Mint.
        sudo pacman -S cinnamon lightdm lightdm-gtk-greeter
        sudo systemctl enable lightdm
        
      • LXQt: Very lightweight Qt-based DE.
        sudo pacman -S lxqt sddm
        sudo systemctl enable sddm
        
    • Window Managers (provide window management, often require more manual configuration for a full "desktop" experience):

      • i3wm (Tiling): Popular, keyboard-driven, highly efficient.
        sudo pacman -S i3-wm i3status i3lock dmenu suckless-tools
        # dmenu for application launching, suckless-tools for 'st' terminal (optional)
        # You'd typically launch i3 via .xinitrc and startx, or via a display manager.
        
        Create ~/.xinitrc: echo "exec i3" > ~/.xinitrc. Then run startx.
      • Openbox (Stacking): Lightweight, highly configurable.
        sudo pacman -S openbox obconf lxappearance tint2
        # obconf for config, lxappearance for theming, tint2 for panel
        
  3. Reboot or Start Display Manager:
    After installing a DE and enabling its display manager, you typically need to reboot for the display manager to take over the login screen:

    reboot
    
    Alternatively, you can try starting it manually if you don't want to reboot yet: sudo systemctl start gdm (or sddm, lightdm).

Sound Configuration

Modern Linux systems typically use PipeWire for audio management. It aims to replace both PulseAudio and JACK.

  1. Install PipeWire and related packages:

    sudo pacman -S pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber
    

    • pipewire: The core PipeWire server.
    • pipewire-alsa: ALSA configuration for PipeWire.
    • pipewire-pulse: A drop-in replacement for PulseAudio server (applications expecting PulseAudio will work).
    • pipewire-jack: JACK client library support for PipeWire.
    • wireplumber: A session and policy manager for PipeWire (recommended). (Alternatively, pipewire-media-session can be used but WirePlumber is newer).
  2. Enable PipeWire Services for your User:
    PipeWire services usually run at the user level. They are often automatically started by the desktop environment or via XDG autostart. If they don't start automatically, you can enable them for your user:

    systemctl --user enable --now pipewire pipewire-pulse wireplumber
    
    You might need to log out and log back in, or reboot.

  3. Test Sound:

    • Install a media player or use a web browser with audio.
    • Install pavucontrol (PulseAudio Volume Control, works with pipewire-pulse too) for a graphical mixer:
      sudo pacman -S pavucontrol
      
      Launch pavucontrol to check output devices and levels.

Useful Applications

Install some common applications. Logged in as your regular user:

  • Web Browser:
    sudo pacman -S firefox  # Or chromium, etc.
    
  • Terminal Emulator (if your DE's default isn't preferred):
    sudo pacman -S alacritty  # Or kitty, terminator, tilix
    
  • Office Suite:
    sudo pacman -S libreoffice-fresh # Or libreoffice-still
    
  • Media Player:
    sudo pacman -S vlc
    
  • Archive Manager:
    sudo pacman -S file-roller # For GNOME/GTK
    # sudo pacman -S ark # For KDE/Qt
    
  • Bluetooth support (if needed):
    sudo pacman -S bluez bluez-utils
    sudo systemctl enable --now bluetooth.service
    # For GUI management, install blueman (GTK) or bluedevil (KDE)
    # sudo pacman -S blueman
    

Yay or Paru (AUR Helpers) - Optional

The Arch User Repository (AUR) contains thousands of community-contributed packages. AUR helpers like yay or paru automate fetching, building, and installing AUR packages.

Do NOT run makepkg or AUR helpers as root.

  1. Install base-devel and git:
    These are needed to build packages.
    sudo pacman -S --needed base-devel git
    
  2. Install yay (example):

    cd /tmp # Or any other temporary build directory in your home, like ~/builds
    git clone https://aur.archlinux.org/yay.git
    cd yay
    makepkg -si
    

    • git clone: Downloads the yay PKGBUILD.
    • cd yay: Enters the directory.
    • makepkg -si:
      • m: Resolves dependencies using pacman.
      • s: Builds the package.
      • i: Installs the package using pacman -U. Follow prompts. Once yay is installed, you can remove the yay build directory from /tmp or ~/builds.

    To use yay (similar syntax to pacman):

    yay -S package-name-from-aur  # Search and install
    yay -Syu                      # Update official repo packages then AUR packages
    

Workshop Setting up a Basic Usable System

Goal:
After the first reboot into your Arch Linux installation, create a regular user, set up sudo, install graphics drivers, a lightweight desktop environment (XFCE), and PipeWire for sound. Also, install Firefox.

Prerequisites:

  • You have successfully rebooted into your Arch Linux installation and are logged in as root.
  • You have an active internet connection (NetworkManager should be handling this if enabled and configured). If not, use nmtui or nmcli as root to connect.

Steps:

  1. Create a New User:
    Replace student with your desired username.

    echo "Creating user 'student'..."
    useradd -m -G wheel -s /bin/bash student
    echo "Set password for 'student':"
    passwd student
    # Follow prompts to set the password
    echo "User 'student' created."
    

  2. Install and Configure sudo:

    echo "Installing sudo..."
    pacman -S sudo --noconfirm # --noconfirm to skip prompt if already installed
    echo "Configuring sudoers with visudo..."
    # This sed command non-interactively uncomments the %wheel line.
    # Be careful with sed on system files; visudo is safer for manual edits.
    sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
    # Alternatively, and more safely, run 'visudo' and uncomment manually:
    # EDITOR=nano visudo  (then uncomment '%wheel ALL=(ALL:ALL) ALL')
    echo "sudo configured."
    

  3. Log Out as Root and Log In as New User:

    exit
    
    At the login prompt, log in as student (or your chosen username) with the password you set.

  4. Test sudo:
    Try updating the system (this also refreshes package lists).

    sudo pacman -Syu
    
    You should be prompted for student's password. If it works, sudo is set up correctly.

  5. Install Graphics Drivers:

    • First, identify your graphics hardware:
      lspci -k | grep -A 2 -E "(VGA|3D)"
      
    • For this workshop, we'll assume Intel integrated graphics as it's common in VMs and many laptops. If you have AMD/NVIDIA, adjust the package names.
      echo "Installing Intel graphics drivers (mesa)..."
      sudo pacman -S mesa libva-intel-driver intel-media-driver vulkan-intel
      echo "Graphics drivers installed."
      
  6. Install Xorg Server:

    echo "Installing Xorg server components..."
    sudo pacman -S xorg-server xorg-xinit xorg-apps
    echo "Xorg server installed."
    

  7. Install XFCE Desktop Environment and LightDM Display Manager:

    echo "Installing XFCE4 and LightDM..."
    sudo pacman -S xfce4 xfce4-goodies lightdm lightdm-gtk-greeter mousepad parole ristretto
    # mousepad (text editor), parole (media player), ristretto (image viewer) are common XFCE apps.
    echo "Enabling LightDM service..."
    sudo systemctl enable lightdm
    echo "XFCE4 and LightDM installed and enabled."
    

  8. Install PipeWire for Sound:

    echo "Installing PipeWire for audio..."
    sudo pacman -S pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber pavucontrol
    echo "PipeWire installed."
    # User services will typically be auto-started by XFCE.
    

  9. Install Firefox:

    echo "Installing Firefox..."
    sudo pacman -S firefox
    echo "Firefox installed."
    

  10. Reboot:

    echo "System setup complete. Rebooting into graphical environment..."
    sudo reboot
    

After Rebooting:

  • You should be greeted by the LightDM login screen.
  • Log in as student.
  • The XFCE desktop should load.
  • Test:
    • Open a terminal (XFCE Terminal).
    • Launch Firefox and browse the web.
    • Play an audio file or a YouTube video to test sound (use pavucontrol to check/adjust if needed).
    • Check display resolution.

Reflection:

  • Why is it important to create a non-root user and use sudo? (Security principle of least privilege).
  • What are the main components of a graphical desktop on Linux? (X server, Desktop Environment/Window Manager, Display Manager, supporting libraries like Mesa).
  • If XFCE didn't start, what logs would you check? (/var/log/Xorg.0.log, journalctl -xe for systemd service errors related to LightDM).
  • How does PipeWire integrate with applications that expect PulseAudio or ALSA? (Through pipewire-pulse and pipewire-alsa compatibility layers).

You now have a functional Arch Linux system with a graphical desktop! The next sections will briefly touch upon further customization and troubleshooting.

8. Advanced Configuration and Customization

With a working Arch Linux system, you can now delve into tailoring it precisely to your needs. This section provides pointers to some common areas of advanced configuration and customization. The Arch Wiki will be your best friend for in-depth information on these topics.

Kernel Management

Arch Linux provides several kernel packages. You installed linux (the latest stable). You might consider others:

  • linux-lts (Long Term Support):

    • Receives security and bug fixes for a longer period. May offer more stability if you encounter issues with the mainline kernel or prefer fewer major updates.
    • To install: sudo pacman -S linux-lts linux-lts-headers (headers are for building external modules).
    • After installation, update your bootloader configuration:
      • GRUB:
        sudo grub-mkconfig -o /boot/grub/grub.cfg should detect it.
      • systemd-boot:
        You'll need to create a new entry in /boot/loader/entries/ (e.g., arch-lts.conf) pointing to /vmlinuz-linux-lts and /initramfs-linux-lts.img.
  • linux-zen (Zen Kernel):

    • A kernel optimized for desktop, multimedia, and gaming performance. It includes various patches and different scheduler settings.
    • To install: sudo pacman -S linux-zen linux-zen-headers.
    • Update bootloader configuration as above.
  • Custom Kernels: You can compile your own kernel for ultimate control (an advanced topic).

Managing Multiple Kernels:
If you have multiple kernels, your bootloader will typically list them, allowing you to choose at boot time. This is useful for testing new kernels or having a fallback.

Power Management

For laptops, effective power management is crucial for battery life.

  • tlp: A popular and highly effective command-line tool for advanced power management. It applies various tweaks automatically on boot and when switching between AC and battery power.

    • Install: sudo pacman -S tlp tlp-rdw (tlp-rdw is for radio device wizard, optional but often recommended).
    • Enable and start the service:
      sudo systemctl enable tlp.service
      sudo systemctl start tlp.service
      # For radio device wizard (Wi-Fi, Bluetooth switching):
      sudo systemctl enable NetworkManager-dispatcher.service # If not already
      sudo systemctl mask systemd-rfkill.service systemd-rfkill.socket # tlp handles this
      
    • Configuration is in /etc/tlp.conf. Defaults are usually sensible.
    • Check status: sudo tlp-stat
  • powertop: A tool to diagnose issues with power consumption and identify power-hungry applications or settings.

    • Install: sudo pacman -S powertop
    • Run calibration (on battery): sudo powertop --calibrate
    • Interactive mode: sudo powertop (navigate tabs, see tunables).

Font Rendering

Good font rendering significantly improves readability and visual appeal.

  • Install Fonts:
    Arch repositories have many font packages.
    sudo pacman -S noto-fonts ttf-dejavu ttf-liberation adobe-source-han-sans-otc-fonts
    # noto-fonts: Google's comprehensive font family
    # ttf-dejavu, ttf-liberation: Good general-purpose fonts
    # adobe-source-han-sans-otc-fonts: Good CJK fonts
    
  • Fontconfig:
    Controls how fonts are selected and rendered.
    • The defaults are usually good, but you can customize antialiasing, hinting, subpixel rendering, etc., by creating/editing ~/.config/fontconfig/fonts.conf or system-wide in /etc/fonts/local.conf.
    • Example for enabling full hinting and RGBA subpixel rendering (if your monitor supports it): Create ~/.config/fontconfig/fonts.conf (or /etc/fonts/local.conf):
      <?xml version='1.0'?>
      <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
      <fontconfig>
        <match target="font">
          <edit name="antialias" mode="assign">
            <bool>true</bool>
          </edit>
          <edit name="hinting" mode="assign">
            <bool>true</bool>
          </edit>
          <edit name="hintstyle" mode="assign">
            <const>hintfull</const>
          </edit>
          <edit name="rgba" mode="assign">
            <const>rgb</const>  <!-- or rgba, bgr, vbgr, etc. depending on subpixel layout -->
          </edit>
        </match>
      </fontconfig>
      
      You may need to log out and back in for changes to apply fully. LCD Font test websites can help you determine your subpixel layout.

Backups

Regular backups are essential.

  • Timeshift:
    Excellent for creating filesystem snapshots, similar to Windows System Restore or macOS Time Machine. Great for rolling back system updates if something breaks.
    • Supports Btrfs snapshots (if using Btrfs) or rsync for other filesystems.
    • Install: sudo pacman -S timeshift
    • Run timeshift-launcher to configure. Recommended to store snapshots on a separate partition/disk.
  • Rsync-based scripts:
    For backing up /home or other important data to an external drive or server. E.g., rsync -avh --delete /home/yourusername /path/to/backup/drive/.
  • Déjà Dup or Vorta (BorgBackup frontend):
    GUI tools for user data backups.
    • sudo pacman -S deja-dup
    • sudo pacman -S borg vorta (Borg is a powerful deduplicating backup program)

Security

  • Firewall:
    • UFW (Uncomplicated Firewall):
      A simple frontend for iptables/nftables.
      sudo pacman -S ufw
      sudo ufw enable         # Enables the firewall
      sudo ufw default deny incoming
      sudo ufw default allow outgoing
      sudo ufw status verbose # Check status
      # Example: sudo ufw allow ssh (or a port number like 22/tcp)
      
    • Firewalld:
      More advanced, supports zones. Often default on RHEL-based systems.
      sudo pacman -S firewalld
      sudo systemctl enable --now firewalld
      # Use firewall-cmd to configure or firewall-config (GUI)
      
  • AppArmor or SELinux:
    Mandatory Access Control systems that can confine applications. More advanced to set up. AppArmor is generally considered easier.
    • sudo pacman -S apparmor
    • Add apparmor=1 security=apparmor to kernel parameters in bootloader config.
    • Enable AppArmor service: sudo systemctl enable --now apparmor.service
    • Install profiles: sudo pacman -S apparmor-profiles (hypothetical, check AUR or community repo).
  • Keep System Updated:
    Regularly run sudo pacman -Syu.
  • Fail2Ban:
    Scans log files and bans IPs that show malicious signs (too many password failures, seeking exploits, etc.).
    • sudo pacman -S fail2ban
    • Configure jails in /etc/fail2ban/jail.local.
    • sudo systemctl enable --now fail2ban

Dotfiles Management

"Dotfiles" are user-specific configuration files (e.g., ~/.bashrc, ~/.config/i3/config). Managing them with version control (like Git) allows you to track changes, sync them across machines, and easily set up a new system.

  • Create a Git repository (e.g., ~/.dotfiles).
  • Move your config files/directories into it.
  • Use symbolic links to link them back to their original locations (e.g., ln -s ~/.dotfiles/bashrc ~/.bashrc).
  • Many tools and scripts exist to help manage this (e.g., stow, yadm).

Workshop Installing an AUR Helper and Customizing Appearance

Goal:
Install yay (an AUR helper). Use yay to install a custom icon theme and a system information tool like neofetch. Apply the icon theme if your DE supports it.

Prerequisites:

  • A working Arch Linux installation with a desktop environment (e.g., XFCE from the previous workshop).
  • Internet connection.
  • Logged in as your regular user (e.g., student).

Steps:

  1. Install base-devel and git (if not already done):
    These are prerequisites for building AUR packages.

    sudo pacman -S --needed base-devel git
    
    Enter your password when prompted.

  2. Clone yay repository and build it:

    cd ~  # Go to your home directory (or a dedicated builds directory like ~/builds)
    git clone https://aur.archlinux.org/yay.git
    cd yay
    makepkg -si
    

    • git clone: Downloads the source files (PKGBUILD) for yay.
    • cd yay: Enters the directory.
    • makepkg -si:
      • s: Syncs dependencies (installs them using pacman).
      • i: Installs the built package using pacman -U.
    • You'll be prompted for your password by sudo when makepkg tries to install dependencies or the final package.
    • Review the PKGBUILD if prompted (good practice, though yay is widely trusted). Press N to skip editing unless you want to inspect it. Then proceed with the build.
  3. Verify yay installation:

    yay --version
    
    You should see the yay version printed.

  4. Clean up the yay build files (optional):

    cd ~
    rm -rf yay
    

  5. Search for an Icon Theme using yay:
    Let's look for the "Papirus" icon theme, which is very popular.

    yay -Ss papirus icon theme
    

    • -Ss: Searches both official repositories and AUR. You'll see results. papirus-icon-theme is likely the one from official repos or AUR. If it's in official repos, pacman could install it. If it's AUR-only or you want the latest git version from AUR:
      yay -S papirus-icon-theme  # Or a specific AUR variant if you prefer
      
      When installing from AUR with yay:
    • It might ask if you want to show diffs of PKGBUILDs or skip review. For trusted packages like Papirus, skipping review (N) is often fine after initial trust is established.
    • It will then download sources, build, and install.
  6. Install neofetch:
    neofetch is a command-line system information tool that displays a logo of your OS and system details. It's often in official repositories, but yay can install it too.

    yay -S neofetch
    

  7. Run neofetch:
    Open your terminal and type:

    neofetch
    
    You should see an ASCII art Arch Linux logo and system information.

  8. Apply the Icon Theme (XFCE example):

    • Open XFCE Settings Manager (usually xfce4-settings-manager or from the application menu).
    • Go to "Appearance."
    • Select the "Icons" tab.
    • You should see "Papirus" (or variants like Papirus-Dark, Papirus-Light) in the list. Select it.
    • The icons in your system should change.
    • (The method varies for other DEs like GNOME (use GNOME Tweaks) or KDE Plasma (System Settings -> Appearance -> Icons)).
  9. Customize neofetch (Optional Exploration):
    neofetch is highly customizable via its config file at ~/.config/neofetch/config.conf.

    • If the file doesn't exist, neofetch uses defaults. You can copy the default config to customize:
      mkdir -p ~/.config/neofetch/
      cp /etc/neofetch/config.conf ~/.config/neofetch/config.conf
      
      (The path to default config might vary; neofetch --help can show it, or just run neofetch once to potentially create ~/.config/neofetch/config.conf automatically with defaults).
    • Open ~/.config/neofetch/config.conf with a text editor (e.g., mousepad ~/.config/neofetch/config.conf).
    • Explore the options. You can change which info is displayed, the order, the ASCII art, colors, etc.
    • For example, find info "OS" distro and change it to info "Operating System" distro to change the label.
    • Save the file and run neofetch again to see changes.

Reflection:

  • What is the AUR, and why are AUR helpers like yay useful? (Community repo; automate build/install process).
  • What are the security implications of using the AUR? (Packages are user-produced; inspect PKGBUILDs for unknown/untrusted packages).
  • How does your desktop environment manage themes and icons? Where are these settings typically found?
  • Explore neofetch's configuration. What interesting pieces of system information can it display?

This workshop gives you a taste of extending your system with community packages and customizing its look and feel. Arch Linux offers endless possibilities for personalization.

9. Hibernation Setup

Hibernation (suspend-to-disk) saves the content of your RAM to your swap space and powers off the computer. When you turn it back on, the system restores its state from swap, allowing you to resume exactly where you left off. This requires a sufficiently large swap partition or swap file and correct configuration.

We will primarily focus on hibernation with a swap partition, as it's generally more straightforward to set up. Hibernation with a swap file is possible but more complex.

Prerequisites for Hibernation:

  • A swap partition (recommended size: RAM size + a bit more, e.g., sqrt(RAM_size_in_GB) * 1GB). If your RAM is 8GB, a 9-10GB swap partition is a good idea. If you have a lot of RAM (e.g., 32GB), you might not need much more than RAM size unless you use a lot of it.
  • You know the UUID of your swap partition.
  • You are comfortable editing kernel parameters and mkinitcpio.conf.

Configuring for Hibernation with a Swap Partition

  1. Identify Your Swap Partition and its UUID:
    If you don't remember your swap partition device name or UUID:

    lsblk -f
    
    Look for the partition with TYPE="swap". Note its device name (e.g., /dev/sdb2) and its UUID. Alternatively, if it's already in your /etc/fstab:
    grep swap /etc/fstab
    
    This should show a line like: UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none swap defaults 0 0. Copy this UUID. Let's call it SWAP_UUID.

  2. Configure the Bootloader with the resume Kernel Parameter:
    The kernel needs to know which swap partition to use for resuming from hibernation.

    • For GRUB:

      1. Edit /etc/default/grub:
        sudo nano /etc/default/grub
        
      2. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT (or GRUB_CMDLINE_LINUX if the default one is empty). It might look like GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3".
      3. Add the resume=UUID=SWAP_UUID parameter. For example:
        GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 resume=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        
        Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with your actual swap partition's UUID.
      4. Save the file.
      5. Re-generate the GRUB configuration:
        sudo grub-mkconfig -o /boot/grub/grub.cfg
        
    • For systemd-boot:

      1. Edit your loader entry file(s) in /boot/loader/entries/ (e.g., arch.conf, arch-lts.conf).
        sudo nano /boot/loader/entries/arch.conf
        
      2. Find the options line. It might look like options root=UUID=YYYY-...YYY rw.
      3. Add resume=UUID=SWAP_UUID to this line. For example:
        options root=UUID=YYYY-...-YYY rw resume=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        
      4. Save the file. Repeat for any other kernel entries if you have them.
  3. Configure the Initramfs with the resume Hook:
    The initramfs needs to be able to handle the resume process early in boot. This is done by adding the resume hook.

    1. Edit /etc/mkinitcpio.conf:
      sudo nano /etc/mkinitcpio.conf
      
    2. Find the HOOKS=(...) line. It usually looks something like:
      HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck)
      
    3. Add the resume hook. The resume hook must come AFTER udev and preferably before filesystems. A good place is after block or keyboard/keymap if those are present and before filesystems. Example:

      HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block resume filesystems fsck)
      
      If you use LVM and your swap is on an LVM LV, the lvm2 hook should come before resume. If you use LUKS encryption and swap is encrypted, encrypt hook comes before lvm2 (if applicable) and resume. The general order for complex setups is often block encrypt lvm2 resume filesystems.

    4. Save the file.

    5. Re-generate the initramfs:

      sudo mkinitcpio -P
      

  4. Reboot:
    A reboot is necessary for the new kernel parameters and initramfs to take effect.

    sudo reboot
    

  5. Test Hibernation:
    After rebooting, try to hibernate:

    sudo systemctl hibernate
    
    Your computer should save its state and power off. When you turn it back on, it should resume to your previous session.

    Troubleshooting Hibernation:

    • System reboots instead of resuming:
      This is common.
      • Check dmesg | grep -i "resume\|hibernation" for error messages after a failed resume.
      • Ensure SWAP_UUID is correct in kernel parameters and fstab.
      • Ensure swap partition is large enough.
      • Ensure resume hook is correctly placed in mkinitcpio.conf and initramfs was rebuilt.
      • Some hardware/drivers can be problematic. Check Arch Wiki for hardware-specific quirks.
    • Slow resume/hibernation:
      Could be I/O speed of swap device.
    • System hangs:
      Could be driver issues.

Hibernation with a Swap File (More Complex)

Hibernating to a swap file is possible but requires more careful setup because the kernel needs to know the physical offset of the swap file on the disk. This is particularly tricky with CoW filesystems like Btrfs (though Btrfs has specific procedures).

General Steps for a Swap File on Ext4/XFS:

  1. Create a Swap File:
    (Let's assume you don't have a swap partition active).

    # Example: Create an 8GB swap file
    sudo fallocate -l 8G /swapfile # Preferred method if supported
    # OR
    # sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 status=progress
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    # sudo swapon /swapfile # Activate temporarily for testing, but not for hibernation yet
    

  2. Add Swap File to /etc/fstab:

    /swapfile none swap defaults 0 0
    
    Then run sudo swapon -a or reboot to make it active.

  3. Get Root Filesystem UUID and Swap File Offset:

    • ROOT_UUID: UUID of the partition where /swapfile resides (e.g., your / partition). Get it from lsblk -f or cat /etc/fstab.
    • SWAP_FILE_OFFSET: This is the physical offset of the swap file on the disk.
      • Crucial: The swap file must be contiguous and not fragmented. fallocate usually ensures this.
      • Install btrfs-progs if not present, as it provides filefrag: sudo pacman -S btrfs-progs (even if not using Btrfs filesystem, filefrag utility is useful).
      • Run: sudo filefrag -v /swapfile
      • Look at the output. You need the value from the physical_offset column for the first extent (usually under the 0: row, in the physical_offset column of the ext: logical_offset physical_offset length expected section). It's a number.
  4. Configure Kernel Parameters:

    • GRUB (/etc/default/grub):
      GRUB_CMDLINE_LINUX_DEFAULT="... resume=UUID=ROOT_UUID resume_offset=SWAP_FILE_OFFSET"
      
      Then sudo grub-mkconfig -o /boot/grub/grub.cfg.
    • systemd-boot (/boot/loader/entries/arch.conf):
      options root=UUID=... rw resume=UUID=ROOT_UUID resume_offset=SWAP_FILE_OFFSET
      
  5. Configure mkinitcpio.conf:
    Add the resume hook as described for swap partitions. The hook will use the kernel parameters.

  6. Rebuild Initramfs: sudo mkinitcpio -P

  7. Reboot and Test.

Important for Swap Files:

  • If the swap file is reallocated or defragmented, its resume_offset might change, breaking hibernation. This is why swap partitions are often preferred for reliability.
  • Swap files on Btrfs have specific requirements (no CoW on the file, specific setup). Consult the Arch Wiki for "Btrfs swap file".

Workshop Enabling Hibernation (with Swap Partition)

Goal:
Configure your Arch Linux system (which should have a swap partition from earlier workshops) to support hibernation.

Prerequisites:

  • Your Arch Linux system is running.
  • You created a dedicated swap partition during installation (e.g., /dev/sdb2).
  • You are logged in as a user with sudo privileges.
  • You are using GRUB (as set up in a previous workshop). If using systemd-boot, adapt step 2.

Steps:

  1. Identify Swap Partition UUID: Open a terminal and find the UUID of your swap partition.

    lsblk -no NAME,TYPE,FSTYPE,UUID | grep swap
    
    This should output something like:
    sdb2 swap swap    xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    
    Copy the UUID (the long string of hex characters). Let's refer to it as YOUR_SWAP_UUID. Verify it's also correctly listed in /etc/fstab:
    cat /etc/fstab
    

  2. Add resume Kernel Parameter to GRUB:

    sudo nano /etc/default/grub
    
    Find the line GRUB_CMDLINE_LINUX_DEFAULT="...". It might contain quiet or other parameters. Add resume=UUID=YOUR_SWAP_UUID inside the quotes. For example, if it was GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3", change it to: GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 resume=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" (Replace xxxx... with your actual swap UUID). Save the file (Ctrl+O, Enter, Ctrl+X in nano).

  3. Update GRUB Configuration:

    sudo grub-mkconfig -o /boot/grub/grub.cfg
    
    Watch the output to ensure no errors.

  4. Add resume Hook to mkinitcpio.conf:

    sudo nano /etc/mkinitcpio.conf
    
    Find the HOOKS=(...) line. Add resume to the HOOKS array, typically after block and before filesystems. Example original: HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems fsck) Example modified: HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block resume filesystems fsck) Save the file.

  5. Regenerate Initramfs:

    sudo mkinitcpio -P
    
    Wait for it to complete without errors.

  6. Reboot the System:

    sudo reboot
    

  7. Test Hibernation:
    After the system reboots and you log in:

    • Open a few applications (e.g., terminal, text editor, web browser).
    • Then, try to hibernate:
      sudo systemctl hibernate
      
    • The system should save its state to disk and power off.
    • Turn the computer back on. It should boot up and restore your applications and their state as they were before hibernation.
  8. Troubleshooting (if it reboots or doesn't resume):

    • If it doesn't resume, log in and check kernel messages:
      journalctl -b -1 -g "resume\|hibernation"
      # -b -1 shows logs from previous boot
      # -g searches for lines containing "resume" or "hibernation"
      
    • Double-check:
      • The swap UUID in /etc/default/grub (and that grub-mkconfig was run).
      • The resume hook in /etc/mkinitcpio.conf (and that mkinitcpio -P was run).
      • The swap partition is active (swapon --show).
      • The swap partition is large enough (at least RAM size).

Reflection:

  • Why are both a kernel parameter (resume=UUID=...) and an initramfs hook (resume) needed for hibernation? (Kernel parameter tells the already-booted kernel where to find the hibernation image; the initramfs hook helps the early boot process handle the resume operation before the main rootfs is mounted).
  • What are the potential downsides or complexities of hibernating to a swap file compared to a swap partition? (Offset changes, fragmentation issues, specific filesystem considerations like Btrfs).
  • If hibernation fails, what's a systematic way to diagnose the problem? (Check logs, verify configurations step-by-step, ensure sufficient swap space).

Successfully setting up hibernation can be very convenient, especially for laptop users.

10. Troubleshooting Common Issues

Even with careful installation, you might encounter issues. This section covers some common problems and basic troubleshooting steps. The Arch Wiki is your ultimate resource for detailed troubleshooting. Remember to approach problems methodically.

No Network Connectivity

Symptoms:

  • Cannot ping external sites (e.g., ping archlinux.org).
  • Web browser shows "Server not found."
  • pacman cannot download packages.

Troubleshooting Steps:

  1. Check Physical Connection:

    • Wired:
      Is the Ethernet cable properly plugged in at both ends? Are there link lights on the network adapter?
    • Wireless:
      Is Wi-Fi turned on? Are you connected to the correct network? (Use nmcli dev wifi list if using NetworkManager).
  2. Check IP Address and Interface Status:

    ip link show
    ip addr show
    

    • Is your network interface (e.g., enp2s0, wlan0) listed as UP? If DOWN, try sudo ip link set dev <interface> up.
    • Does it have an IP address (inet)? If not, DHCP might have failed.
  3. Check Network Service Status: If you're using NetworkManager (common):

    systemctl status NetworkManager
    

    • Is it active (running)? If not, sudo systemctl start NetworkManager and sudo systemctl enable NetworkManager.
    • Check NetworkManager's own logs: journalctl -u NetworkManager. If you're using systemd-networkd:
      systemctl status systemd-networkd
      systemctl status systemd-resolved # For DNS
      networkctl status <interface>
      
  4. Restart Network Service:

    sudo systemctl restart NetworkManager
    

  5. Check DHCP Client:
    NetworkManager uses an internal DHCP client. If using systemd-networkd, ensure its DHCP client is configured for the interface. If you manually try dhclient or dhcpcd, ensure only one DHCP client is active for an interface.

  6. Check DNS Resolution:

    cat /etc/resolv.conf
    

    • Does this file contain nameserver entries (e.g., nameserver 1.1.1.1, nameserver 8.8.8.8)?
    • NetworkManager and systemd-resolved usually manage this file. If it's missing or incorrect, DNS lookups will fail.
    • Test DNS: ping 8.8.8.8 (pings Google's DNS server by IP). If this works but ping google.com fails, it's a DNS issue.
  7. Check Firewall:
    If you configured a firewall (UFW, firewalld), ensure it's not blocking necessary traffic (especially DNS on port 53/udp and 53/tcp, or outgoing HTTP/HTTPS).

    sudo ufw status # If using UFW
    sudo firewall-cmd --state # If using firewalld
    

  8. Router/Modem: Try rebooting your router/modem.

Bootloader Problems

Symptoms:

  • System boots directly into BIOS/UEFI setup.
  • GRUB rescue prompt appears (grub rescue>).
  • systemd-boot menu doesn't appear or shows no entries.
  • Error messages like "No bootable device found."

Troubleshooting (requires booting from Arch Linux Live ISO):

  1. Boot from Arch Live ISO:
    Ensure you boot in the same mode (UEFI or BIOS) as your installation.
  2. Connect to Internet, Mount Partitions:
    • Connect to Wi-Fi/Ethernet.
    • Identify your partitions (lsblk).
    • Mount your root partition to /mnt.
    • Mount your ESP to /mnt/boot (or /mnt/efi if that's your setup).
    • Mount any other necessary partitions like /mnt/home.
    • If using LVM/LUKS, open/activate them first.
  3. arch-chroot into your system:
    arch-chroot /mnt
    
  4. Troubleshoot GRUB:
    • Ensure grub and efibootmgr (for UEFI) are installed (pacman -Q grub efibootmgr).
    • Reinstall GRUB:
      • UEFI: grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --recheck (adjust /boot and GRUB ID if needed).
      • BIOS: grub-install --target=i386-pc /dev/sdX --recheck (replace /dev/sdX with your disk).
    • Regenerate grub.cfg:
      grub-mkconfig -o /boot/grub/grub.cfg
      
    • Check /etc/default/grub for errors.
    • Check UEFI boot order (efibootmgr command from within chroot) - make sure GRUB is the top entry.
      efibootmgr # Lists entries
      # efibootmgr -o XXXX,YYYY # Sets boot order, use with caution
      
  5. Troubleshoot systemd-boot:
    • Ensure ESP is mounted at /boot.
    • Reinstall: bootctl --path=/boot install.
    • Check /boot/loader/loader.conf for syntax errors and correct default entry.
    • Check entry files in /boot/loader/entries/ (e.g., arch.conf):
      • Correct paths to kernel (/vmlinuz-linux), initramfs (/initramfs-linux.img), and microcode.
      • Correct root=UUID=... parameter.
      • Ensure files (vmlinuz-linux, etc.) actually exist in /boot.
  6. Exit chroot, unmount, reboot.

Graphics Issues

Symptoms:

  • Black screen after bootloader or when starting graphical session.
  • Graphical session starts but is slow, tearing, or incorrect resolution.
  • Error messages about "Failed to start Light Display Manager" or similar.

Troubleshooting:

  1. Check Which Driver is Loaded:

    lspci -k | grep -A 2 -E "(VGA|3D)"
    
    Look for "Kernel driver in use". Is it i915 (Intel), amdgpu (AMD), nouveau or nvidia (NVIDIA)?

  2. Check Xorg Logs: The primary log file for Xorg is /var/log/Xorg.0.log. (If Xorg fails and restarts, it might be Xorg.1.log).

    cat /var/log/Xorg.0.log | less
    
    Look for lines starting with (EE) (error) or (WW) (warning). These often pinpoint the issue (driver not found, configuration error).

  3. Ensure Correct Drivers Are Installed:

    • Intel: mesa, libva-intel-driver, intel-media-driver.
    • AMD: mesa, xf86-video-amdgpu (or xf86-video-ati for old cards).
    • NVIDIA: nvidia and its utils, or ensure nouveau is being used if intended. If using proprietary NVIDIA, ensure nouveau is blacklisted (lsmod | grep nouveau should show nothing). The NVIDIA packages usually handle blacklisting.
  4. Mesa Installation:
    Ensure mesa is installed, as it provides OpenGL implementation used by most DEs. pacman -Q mesa

  5. Early KMS Start:
    Kernel Mode Setting (KMS) should ideally start early in the boot process. Ensure kms hook is in /etc/mkinitcpio.conf (it's usually in the default HOOKS array) and rebuild initramfs (sudo mkinitcpio -P). For NVIDIA proprietary drivers, KMS setup can be different. Check Arch Wiki for "NVIDIA KMS".

  6. Display Manager Issues:
    If Xorg seems fine but DE doesn't start, check Display Manager logs:

    journalctl -u gdm   # For GDM
    journalctl -u sddm  # For SDDM
    journalctl -u lightdm # For LightDM
    

  7. Xorg Configuration (less common now):
    Modern Xorg often auto-configures well. Manual Xorg config in /etc/X11/xorg.conf.d/ is less common but sometimes needed for specific hardware or multi-monitor setups. Errors here can break X.

  8. Switch to a TTY:
    If the GUI is frozen or black, try switching to a text console: Ctrl+Alt+F2 (or F3-F6). Log in and troubleshoot from there. Ctrl+Alt+F1 or Ctrl+Alt+F7 usually returns to the graphical session.

Sound Issues

Symptoms:

  • No sound output.
  • No microphone input.
  • Applications report sound errors.

Troubleshooting (assuming PipeWire setup):

  1. Check PipeWire Services:

    systemctl --user status pipewire pipewire-pulse wireplumber
    
    Are they active (running)? If not: systemctl --user enable --now pipewire pipewire-pulse wireplumber.

  2. Volume Levels and Muting:

    • Use pavucontrol (PulseAudio Volume Control - works with PipeWire-Pulse).
      • Check "Output Devices" tab: Is the correct device selected? Is it unmuted? Is the volume slider up?
      • Check "Playback" tab: Are applications listed? Is their output unmuted and volume up? Directed to correct sink?
    • Use alsamixer (console mixer):
      alsamixer
      
      Press F6 to select your sound card. Check master volume, PCM, speaker, headphone levels. MM means muted; press M to unmute. Use arrow keys to adjust volume.
  3. Correct Output Device:
    Sometimes the wrong device (e.g., HDMI audio when you want analog speakers) is selected as default. Set the correct default sink in pavucontrol ("Output Devices" tab, click the checkmark icon next to the desired device).

  4. Application-Specific Settings:
    Some applications have their own audio output/input settings.

  5. Reinstall PipeWire Packages:

    sudo pacman -S pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber
    

  6. Check dmesg for Sound Card Errors:
    dmesg | grep -i "snd\|sof\|audio" might show firmware loading issues or hardware detection problems. You might need additional firmware (e.g., sof-firmware).

Package Management Errors (Pacman)

  • "Invalid or corrupted package (PGP signature)":
    Your system's keyring or the package signature is out of date or corrupt.

    1. Update Arch keyring: sudo pacman -Sy archlinux-keyring
    2. Re-initialize keys: sudo pacman-key --init
    3. Populate keys: sudo pacman-key --populate archlinux
    4. Then try your pacman command again. If it persists, try refreshing all keys: sudo pacman-key --refresh-keys. This can take a while.
  • "File exists in filesystem" errors during update/install:
    Pacman thinks a file it wants to install/update is already owned by another package or exists untracked.

    • Identify the conflicting file path.
    • Find which package owns it (if any): pacman -Qo /path/to/conflicting/file.
    • If it's owned by another package, there might be a packaging conflict you need to resolve (uninstall one, or one package might replace another).
    • If it's an untracked file, you can try renaming/deleting it (at your own risk, understand what the file is) and retrying the pacman command. Or use sudo pacman -S --overwrite /path/to/conflicting/file package-name to force overwrite that specific file. Use --overwrite '*' with extreme caution.
  • "Failed to commit transaction (conflicting files)": Similar to above.

  • "Database lock" (/var/lib/pacman/db.lck):
    Pacman or another utility (like an AUR helper) is already running or was interrupted.

    • Ensure no other pacman/yay instance is running.
    • If you're sure none are running, remove the lock file: sudo rm /var/lib/pacman/db.lck.
  • "Error: GPGME error: No data" when updating mirrors or system:
    Usually a temporary mirror issue or network problem.

    • Refresh mirrorlist with reflector.
    • Run sudo pacman -Syyu (double y forces refresh of all sync databases).

Kernel Panics

Symptoms:

  • System freezes during boot, displaying many lines of text, often including "Kernel panic - not syncing: ..." followed by an error message and a call trace.

Troubleshooting:

  • Note the Error Message: The message after "Kernel panic - not syncing:" is crucial. Search for it online (especially on the Arch Wiki/forums).
  • Hardware Issues: Kernel panics can be caused by failing RAM, overheating CPU, faulty motherboard, or disk errors. Run hardware diagnostics if possible (memtest86+ for RAM).
  • Driver Issues: A buggy kernel module can cause a panic.
  • Incorrect Kernel Parameters: Especially root= or resume=.
  • Corrupted Filesystem: fsck might be needed.
  • Boot with an Older Kernel: If you have multiple kernels installed (e.g., linux and linux-lts), try booting the other one from your bootloader menu. If it works, the issue is likely with the problematic kernel or its specific modules/config.
  • Chroot and Rebuild Initramfs: sudo mkinitcpio -P.
  • Chroot and Reinstall Kernel: sudo pacman -S linux (or linux-lts).

Workshop Debugging a Simulated Bootloader Problem (GRUB UEFI)

Goal:
Intentionally "break" the GRUB UEFI boot setup and then use the Arch Live ISO to chroot in and repair it. This simulates a common real-world recovery scenario.

Scenario:
Your Arch Linux system with GRUB (UEFI, ESP at /boot) is currently booting fine. We will simulate a scenario where GRUB's core EFI file is "accidentally" deleted.

Warning:
This involves modifying boot files. While the fix is straightforward, ensure you're comfortable or doing this in a VM.

Steps to Simulate the Problem (from your running Arch system):

  1. Identify GRUB's EFI file:
    It's typically at /boot/EFI/YOUR_BOOTLOADER_ID/grubx64.efi. If your bootloader ID was GRUB or ARCHGRUB:
    ls /boot/EFI/GRUB/grubx64.efi  # Or /boot/EFI/ARCHGRUB/grubx64.efi
    
  2. "Accidentally" rename/move it (safer than deleting for a simulation):
    # Adjust BOOTLOADER_ID if yours is different (e.g., ARCHGRUB)
    sudo mv /boot/EFI/GRUB/grubx64.efi /boot/EFI/GRUB/grubx64.efi.broken
    
  3. Reboot:
    sudo reboot
    
    Expected Outcome:
    The system will likely fail to find GRUB. It might drop you into the UEFI firmware settings, show an error like "No bootable media," or try to network boot. It won't boot Arch.

Steps to Fix the Problem (using Arch Live ISO):

  1. Boot from Arch Live ISO:
    Ensure you boot it in UEFI mode.
  2. Verify Boot Mode:
    ls /sys/firmware/efi/efivars (should list files).
  3. Connect to the Internet
    (not strictly needed for this fix, but good practice).
  4. Identify Your Partitions:
    lsblk. Note your root partition (e.g., /dev/sda3) and ESP (e.g., /dev/sda1).
  5. Mount Partitions:
    # Example assuming /dev/sda3 is root, /dev/sda1 is ESP
    sudo mount /dev/sda3 /mnt
    sudo mount /dev/sda1 /mnt/boot # If ESP was mounted at /boot
    # If you had a separate /home, mount it too: sudo mount /dev/sdaX /mnt/home
    
  6. arch-chroot into Your System:
    arch-chroot /mnt
    
  7. Diagnose within Chroot:

    • You could just rename the file back: mv /boot/EFI/GRUB/grubx64.efi.broken /boot/EFI/GRUB/grubx64.efi. But let's practice a full reinstall as if it were truly gone or corrupted.
  8. Reinstall GRUB:

    • Ensure grub and efibootmgr are present (they should be): pacman -Q grub efibootmgr.
    • Run the grub-install command you used originally. Adjust --efi-directory and --bootloader-id if they were different from this example:
      grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --recheck
      
      This command should recreate the /boot/EFI/GRUB/grubx64.efi file and ensure the UEFI firmware entry is correct. "Installation finished. No error reported." is the goal.
  9. Regenerate grub.cfg (Good practice, though not strictly needed if only EFI file was missing):

    grub-mkconfig -o /boot/grub/grub.cfg
    

  10. Exit Chroot, Unmount, and Reboot:

    exit
    umount -R /mnt # Or umount /mnt/boot then /mnt
    reboot
    
    Remove the Live ISO. Your system should now boot normally via GRUB.

Reflection:

  • What was the key file that, when missing, prevented GRUB from loading? (grubx64.efi on the ESP).
  • Why is it important to boot the live ISO in the same mode (UEFI/BIOS) as your installed system when doing repairs? (Tools like grub-install and efibootmgr behave differently or are unavailable in the wrong mode).
  • What are the essential steps for chrooting into a broken system for repair? (Boot live media, mount system partitions correctly, arch-chroot).
  • Besides reinstalling, what other GRUB-related files could cause boot issues if corrupted or misconfigured? (/boot/grub/grub.cfg, files in /boot/grub/<arch-type>/).

This workshop demonstrates a fundamental recovery technique applicable to many boot-related problems.

Conclusion

Congratulations on successfully navigating the Arch Linux installation process! By building your system from the ground up, you've gained invaluable insight into the inner workings of a GNU/Linux distribution. This hands-on experience is one of Arch's greatest strengths, fostering a deeper understanding and appreciation for the components that make up a modern operating system.

The Arch Way Recap

Throughout this journey, you've encountered the core principles of Arch Linux, often referred to as "The Arch Way":

  • Simplicity:
    You began with a minimal base and added only what you needed, configuring services through straightforward text files.
  • User-Centrality:
    You were in control at every step, making decisions about your partitioning scheme, bootloader, desktop environment, and system services. This control comes with responsibility, empowering you to create a system tailored precisely to your requirements.
  • Modernity:
    You installed the latest stable software packages, and the rolling-release model ensures you'll continue to receive updates as they become available.
  • Pragmatism & Versatility:
    Arch provides the tools and the framework; you decide how to use them to build anything from a lightweight server to a feature-rich desktop workstation.

Keeping Your System Up-to-Date

Arch Linux is a rolling-release distribution, meaning regular updates not only provide new features but also crucial security patches and bug fixes.

  • Update Regularly:
    It's good practice to update your system frequently, perhaps once a week or every few days.

    sudo pacman -Syu
    

    • -S: Sync packages.
    • y: Refresh local package databases from the server (use yy to force refresh all, useful if mirrors changed or after a long time).
    • u: Upgrade installed packages.
  • Read Arch News Before Major Updates:
    Before running -Syu, especially if it's been a while, check the Arch Linux homepage (https://archlinux.org/news/) for any news items that might require manual intervention during an update. This is rare but important.

  • AUR Packages: If you use an AUR helper like yay:

    yay -Syu  # Updates official repo packages then AUR packages
    # or simply
    yay       # Alias for yay -Syu
    
    Be mindful that AUR packages are user-submitted and compiled on your system; they might occasionally have issues or require attention during updates.

Further Learning Resources

Your learning journey with Arch Linux doesn't end here. The skills you've developed are a foundation for further exploration.

  • The Arch Wiki (https://wiki.archlinux.org/):
    This is your primary resource. It's an incredibly comprehensive and well-maintained knowledge base covering almost every aspect of Arch Linux and Linux in general. If you have a question or want to configure something, the Arch Wiki likely has an article on it.
  • Arch Linux Forums (https://bbs.archlinux.org/):
    A place to ask questions (after searching the Wiki and forums first!), share solutions, and discuss Arch Linux with the community.
  • Man Pages:
    Don't forget the manual pages for commands: man <command>.
  • /usr/share/doc/:
    Many packages install additional documentation here.

Encouragement

Installing Arch Linux can be challenging, but the rewards – a system built to your specifications and a profound understanding of its architecture – are well worth the effort. You've demonstrated patience, attention to detail, and a willingness to learn. These qualities will serve you well as you continue to explore the vast and exciting world of Linux.

Embrace the "do-it-yourself" philosophy, continue to experiment (perhaps in a virtual machine first for risky changes), and don't be afraid to break things – that's often how the best learning happens. The Arch community and the extensive documentation are there to support you.

Welcome to the Arch Linux community! Enjoy your new system.