Arch-Linux

Installation and configuration documentation of my Arch Linux setup in GitHub Pages.

Basic installation of an x86_64 machine

This page describes how to install a fresh and minimal Arch Linux system for x86_64 machines on a single drive (SSD or HDD).

Both EFI and BIOS configurations are supported. Only the boot loader (GRUB) needs some different arguments. (see EFI and BIOS)

You can check in which mode you’ve booted: If the folder /sys/firmware/efi exists, the kernel has booted in EFI mode, else it’s booted in BIOS mode. You can even install a hybrid EFI/BIOS system (thus bootable in both EFI and BIOS mode) by installing in one mode (i.e. BIOS), then reboot in the other (i.e. EFI) and do the Install GRUB bootloader part again.

Both Ext4 and Btrfs root file systems are described, so you can make a choice.

On this page, Ext4 is taken as de facto standard for installations but Btrfs could be considered for its snapshot and volume support and transparent compression.

Download the most recent iso

Go to https://www.archlinux.org/download/ and download the most recent iso file

Write the iso file to a USB stick

dd if=<isofile> of /dev/sda bs=4M

… boot the device from the USB stick

Determine and define the drive to install on

You can use lsblk -f to determine the drive to install to. When the drive is determined as i.e. /dev/sdX do:

export DRIVE=/dev/sdX # or i.e. /dev/mmcblk0 for eMMC devices
BOOT=${DRIVE}1 # or ${DRIVE}p1 for eMMC devices
ROOT=${DRIVE}2 # or ${DRIVE}p2 for eMMC devices

Partitioning

Call:

gdisk $DRIVE

… and configure as follows:

  1. o
    1. Y
  2. n
    1. default
    2. 4M
    3. +124M
    4. ef00
  3. n
    1. all defaults
  4. n
    1. default
    2. default
    3. default
    4. ef02
  5. w
    1. Y

Preparing filesystems

Format Boot partition

mkfs.fat -F32 $BOOT

Format & Mount Root partition

Ext4

mkfs.ext4 -L OS $ROOT
mount -o noatime $ROOT /mnt

Btrfs

OPTIONS=noatime,space_cache,compress=lzo,subvol=subvol_root
mkfs.btrfs -L OS $ROOT
mount $ROOT /mnt
btrfs subvolume Create /mnt/subvol_root
umount /mnt
mount -o $OPTIONS $ROOT /mnt

Mount Boot partition

mkdir /mnt/boot
mount -o noatime $BOOT /mnt/boot

Creating minimal environment

pacstrap -c /mnt base linux grub btrfs-progs efibootmgr
genfstab -Up /mnt >> /mnt/etc/fstab

You can omit the btrfs-progs package when not using btrfs. You can omit the efibootmgr package when booting in BIOS mode.

Initialize bootloader configuration in Bootstrap environment

Bootstrap into target environment

arch-chroot /mnt

Install GRUB bootloader

EFI

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

BIOS

grub-install --recheck $DRIVE

Initialize GRUB bootloader configuration

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

Finalize

exit
reboot

For configuration of installation essentials, please see Installation Essentials