1. Creating Live Media
Downloading an Arch Image File
- Visit https://archlinux.org/download/ for a torrent link or to view a list of official mirrors for various image downloads.
- I download the latest available ISO, updated monthly, from Berkley University’s mirror: https://mirrors.ocf.berkeley.edu/archlinux/iso/latest/
Verify Image Integrity
- Use the instructions and hash values at https://archlinux.org/download/ to verify the integrity of the downloaded image.
Write Image to Bootable Media
Windows
- Use a tool like Balena Etcher or Rufus to flash the downloaded ISO to a connected USB drive
Linux
- Use a tool like
fdisk,blkid, orfdisk -lto identify USB drive by device identifier andddto directly write the ISO to a connected USB drive. For example:sudo dd bs=4M if=/path/to/filename.iso of=/dev/sdX status=progress && sync
Booting from Live Media
- With the image written to the USB drive, boot from it by using BIOS to override primary boot sequence – selecting the USB drive
- Once the live media’s bootloader appears, use the first option to load the Arch install environment in memory
2. Target Disk Preparation
Identify Target Disk
Use lsblk, blkid or fdisk –l to display disk details.
You will see various device identifiers, such as sda, sdb, nvme0n1, vda etc…
Use the provided information to determine the device identifier of your target disk.
In this guide, I’ll be using the device identifier /dev/nvme0n1 as the target disk. This will of course vary, replace /dev/nvme0n1 with your target disk identifier. Commands listed below that are enclosed in angle brackets are intended to act more as placeholders, requiring the user to input the appropriate option.
Structuring Disk Properties
fdisk </dev/nvme0n1>
In our terminal, we are now interacting with the fdisk program and so the prompt will appear differently. We’re going to be setting up a small disk sector for the EFI system and a large sector for our primary install.
Note: If you’re prompted to remove signatures, it indicates it’s not a fresh install. Make sure you’ve specified the correct disk before inadvertently wiping out the wrong disk.
Partition Table
Use fdisk command g to create a new empty partition table using the GUID Partition Table scheme.
Partition 1 – Boot Partition / EFI Partition
- Use fdisk command
nto create a new partition - Partition Number – 1 (default)
- Sector starting point – Use default
-
Sector ending point – Type
+512Mto specify the partition’s end point, which will reflect the overall size of the partition. -
Partition Type – Use fdisk command
tto set a partition’s type. If prompted, specify partition number 1. Use theuefialias to change to EFI System.
Partition 2 – Primary Partition
- Use fdisk command
nto create a new partition - Partition Number – 2 (default)
- Sector starting point – Use default
-
Sector ending point – Press the [Enter/Return] key to select the end of the disk or specify an size, such as
+500Gor+20Gfor example -
Partition Type – Use fdisk command
tto set a partition’s type. Specify partition number 2. Use thelvmalias to change to Linux LVM.
Verify and Write Changes to Disk
- Use fdisk command
pto display the partition table. Confirm target disk’s device name and the partition layout. - After confirming desired changes, use fdisk command
wto write changes to disk
Structuring Logical Volume Groups
-
pvcreate --dataalignment 1m /dev/nvme0n1p2
This command creates a physical volume on the specified block device/dev/nvme0n1p2with a data alignment of 1 MB. You should target partition 2 as the EFI System will not be set up for LVM. -
vgcreate <lvg0> /dev/nvme0n1p2
This command creates a volume group namedlvg0on the physical volume/dev/nvme0n1p2. A volume group is a collection of physical volumes that can be used to create logical volumes. -
lvcreate –L <40GB> lvg0 -n <rootvol>
This command creates a logical volume namedrootvolwith a size of 40 GB on the volume grouplvg0. It’s intended to host the / directory. A logical volume is a virtual disk that can be created on a volume group and can be used as a normal block device. -
lvcreate –l 100%FREE lvg0 –n <homevol>
This command creates a logical volume namedhomevolwith a size equal to the remaining free space in the volume grouplvg0. It’s intended to host the /home directory. The-loption specifies the size of the logical volume as a percentage of the total free space in the volume group. -
modprobe dm_mod
This command loads the device-mapper module, which is required for creating and managing logical volumes. -
vgscan
This command scans for all volume groups on the system and updates the system’s volume group metadata. -
vgchange –ay
This command activates all volume groups on the system that are not already active. The–ayoption stands for “activate yes”, which forces the activation of all volume groups.
Disk Formatting
-
mkfs.fat -F32 /dev/nvme0n1p1
Formats the EFI partition with Fat32 -
mkfs.ext4 /dev/lvg0/rootvol
Formats the root logical volume with ext4 -
mkfs.ext4 /dev/lvg0/homevol
Formats the home logical volume with ext4
Mounting Target Filesystem
This is necessary so the live environment can interact with the target virtual filesystem
-
mount /dev/lvg0/rootvol /mnt mkdir /mnt/homemount /dev/lvg0/homevol /mnt/home
Generate fstab file
The fstab file is used to automatically mount the filesystem at startup using the UUID of the disk(s)
-
mkdir /mnt/etc genfstab –Up /mnt >> /mnt/etc/fstab
3. Main Install
-
pacstrap /mnt
Installs the base packages needed for the Arch Linux system in the/mntdirectory. The/mntdirectory is usually the mount point for the root partition of the target system. -
arch-chroot /mnt
Changes the root filesystem environment to the/mntdirectory. -
pacman –S linux linux-headers linux-lts linux-lts-headers
Installs the Linux kernel and the kernel headers, as well as the LTS (Long-Term Support) version of the kernel and the kernel headers. Use themkinitcpiorepository for initramfs. -
pacman –S base-devel openssh sudo nano vi networkmanager wpa_supplicant wireless_tools netctl dialog gzip which
Installs additional packages, including:
-
sshfor secure remote access -
sudofor executing commands with root privileges - the
nanotext editor - The
vitext editor -
NetworkManagerfor managing network interfaces -
wpa_supplicantfor Wi-Fi support -
wireless_toolsfor wireless configuration -
netctlfor network profiles -
dialogfor creating menus -
gzipfor compression -
whichfor finding the location of executables.
-
systemctl enable NetworkManager
Enables NetworkManager to start automatically at boot time. -
systemctl enable sshd
Enables the SSH daemon to start automatically at boot time. -
pacman –S lvm2
Installs LVM (Logical Volume Manager) support. -
nano /etc/mkinitcpio.conf
Opens the mkinitcpio configuration file for editing. It is used to build the initial ramdisk image initramfs. Find the following line (1) and change to match line (2)-
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)
The original line in the file -
HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard fsck)
The modified line in the file, which adds the lvm2 hook to the list of hooks.
-
-
mkinitcpio –p linux
Regenerates the initramfs image for the default Linux kernel. -
mkinitcpio –p linux-lts
Regenerates the initramfs image for the LTS Linux kernel. -
nano /etc/locale.gen
Opens the locale.gen file for editing. Uncomment your locale code by removing the leading #. This will been_US.UTF-8 UTF-8for English – US. Save and close. -
locale-gen
Generates the locales that were uncommented in the locale.gen file. -
passwd
Set the root account password. -
useradd –m –g users –G wheel <user>
Creates a new user account and adds it to theusersgroup and thewheelgroup, which allows the user to execute commands with root privileges using sudo. -
passwd <user>
Set user account password -
EDITOR=nano visudo
Opens the sudoers file for editing with the Nano text editor. Uncomment “# %wheel ALL=(ALL) ALL” and save. Remove the#symbol from the beginning of the%wheel ALL=(ALL) ALLline, which allows users in thesudogroup to execute any command with root privileges using thesudocommand. -
usermod -L root
Locks root user account
4. Bootloader Configuration
Installing Grub and creating EFI directory
-
pacman –S grub dosfstools os-prober mtools efibootmgr
Installs tools that are necessary for this process
-
grub: This is the GRand Unified Bootloader, a widely used bootloader program for Linux systems that allows the user to choose which operating system or kernel to boot at startup. -
dosfstools: This package includes utilities for creating, modifying, and checking FAT file systems, which are commonly used on bootable drives and disks. -
os-prober: This is a tool for detecting other operating systems installed on the system, which can be useful for configuring the bootloader and multi-boot systems. -
mtools: This package provides utilities for working with MS-DOS file systems, which are sometimes used for bootable media and disk images. -
efibootmgr: This tool is used for managing the EFI Boot Manager, which is responsible for loading the operating system and other boot-related files on UEFI-based systems. It allows the user to view and modify the boot configuration, including adding or removing boot entries, changing the boot order, and setting boot parameters.
-
mkdir /boot/efi
Creates the efi directory needed to install the bootloader to -
mount /dev/nvme0n1p1 /boot/efi
Mounts the EFI partition to the efi directory which is necessary to interact with that partition
Configuring Grub
-
grub-install --target=x86_64-efi --bootloader-id=<bootloaderID> --recheck
Installs grub for UEFI systems. The bootloaderID is a placeholder for how you want to identify this partition. -
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
This file contains translated messages for the GRUB bootloader, which is used to configure the bootloader to display messages and menus in English. -
grub-mkconfig –o /boot/grub/grub.cfg
Generates a new GRUB configuration file based on the current system configuration. This file is used by the GRUB bootloader to determine which operating system to boot and how to configure the boot process.
5. First Boot
Exiting Install Environment
exitreboot now
Setting Date and Time
timedatectl list-timezonestimedatectl set-timezone America/Dallassystemctl enable systemd-timesyncd
Setting Hostname
- sudo
hostnamectl set-hostname <myhost> echo "127.0.0.1 localhost" | sudo tee -a /etc/hostsecho "::1 localhost ip6-localhost ip6-loopback" | sudo tee -a /etc/hostsecho "127.0.0.1 <myhost>" | sudo tee -a /etc/hosts
Installing CPU Microcode Support
pacman –S amd-ucode
orpacman -S intel-ucode
6. Desktop Environment Setup
1. Display Server Install
X11
To install X11, run the following command:pacman -S xorg-server
Wayland
To install Wayland, run the following command:pacman -S wayland
2. Video Driver Install
AMD
To install the video driver for AMD, run the following command:pacman -S mesa xf86-video-amdgpu
NVIDIA
To install the video driver for NVIDIA, run the following command:pacman -S nvidia nvidia-lts
Intel
To install the video driver for Intel, run the following commands:pacman -S mesa xf86-video-intel
Virtual Video Driver
To install the virtual video driver, run the following commands:pacman -S virtualbox-guest-utils xf86-video-vmware systemctl enable vboxservice
3. Desktop Environment w/ Recommended Display Manager Install
Gnome
To install Gnome, run the following command:pacman -S gnome gnome-tweaks
To enable Gnome Display Manager (GDM), run the following command:systemctl enable gdm
Plasma KDE
To install Plasma KDE, run the following command:pacman -S plasma-meta kde-applications
To enable SDDM Display Manager, run the following command:systemctl enable sddm
XFCE
To install XFCE, run the following command:pacman -S xfce4 xfce4-goodies
To enable recommended display manager for XFCE, run the following command:systemctl enable lightdm
Mate
To install Mate, run the following command:pacman -S mate mate-extra
To enable recommended display manager for Mate, run the following command:systemctl enable lightdm
Leave a Reply