Arch Linux Installation Guide
for Mobile Workstation "Aneeka"
by Paul Moffat - 220601
Guide Notes (230305)
- This guide is a modification of the guide originally created for my previous Laptop "Cera". At the time I was too impatient to create a specific third installation guide for this new computer so I just used the previous laptop's guide as a reference and adjusted as required. This web guide represents those changes as accurately as I can remember.
- This guide was utilised to support a new installation of Arch Linux on a new mobile workstation laptop computer (Aneeka) that was bought to replace the previous laptop (Cera) after being sold. I was looking for a more powerful and versatile mobile computer with capabilities that the previous laptop couldn't effectively provide. This new mobile workstation provided a stronger processor, RTX graphics card, increased storage capacity and higher RAM (especially after I upgraded it).
- Unlike the previous laptop, this mobile workstation is able to support up to 4 separate internal storage devices so I was able to buy an additional 1TB M2 SSD and install Arch Linux along side the existing Windows 10 Professional installation. This worked for me as having the Windows 10 installation available for my work related requirements as well is especially useful.
- Initially I had only added a single M2 SSD for Arch Linux and split that device into root and home partitions. I have since though purchased two additional 2TB M2 SSDs to act as secondary data/backup drives for each OS. Unlike the system drives, where Windows is encrypted by Bitlocker and Linux by LUKS, these drives remain unencrypted for the most part. I had decided I would use Veracrypt file volumes to encrypt data on these drives where needed but keep them otherwise unencrypted for performance and open transfer requirements. For example, Linux can read the Windows NTFS data drive so it is useful as a means to transfer documents and software between those two operating systems.
- I had also since the installation of Arch Linux upgraded the RAM on this computer from the 32 GB that it came with right up to its supported maximum of 128 GB. I had created a 2 GB swapfile as part of the installation process of Arch but as of now highly doubt it would ever be used; atleast any time soon. But I decided it could remain regardless.
- Suffice to say, this computer is insane and performs incredibly well through Linux. To be fair, this computer literally represents the best computer I've ever owned. Regardless of the fact it is a laptop it outperforms all other computers I've ever had including all the desktop computers.
Partitions Overview
- Partition 1 - EFI
Size |
512 MB |
Type |
1 (EFI System) |
- Partition 2 - BOOT
Size |
512 MB |
Type |
4 (BIOS boot) |
- Partition 3 - SYSTEM
Size |
All Remaining Free Space |
Type |
43 (Linux LVM) |
Partition 3 - SYSTEM will be further partitioned into root and home sub-partitions using LVM. No swap partition will be created. A minimal 2 gig swap file will be created which can be resized as required.
Installation Instructions
BIOS
Make sure UEFI is ENABLED in the BIOS before beginning the setup/installation process!
Networking
Initialise DHCP Client |
# dhcpcd |
Verify Available Network Devices |
# ip addr show |
Configure Wifi Access using Internet Wireless Control Utility
Start IWCTL |
# iwctl |
List Available Wireless Network Devices |
device list |
Scan For Available Wireless Access Points |
station <DEVICE> scan |
Get List Of Available Wireless Access Points |
station <DEVICE> get-networks |
Connect To Available Wiress Access Point |
station <DEVICE> connect <SSID> |
Exit IWCTL |
CTRL+D |
Verify Wifi Interface Availability |
# ip addr show |
Verify Internet Connection Availability |
# ping -c 5 8.8.8.8 |
Disk Configuration (UEFI with Encryption)
Create Physical Disk Partition Table
Verify Disk Device ID Intended to Install Arch onto |
# fdisk -l |
Configure Device Partitions using fdisk |
# fdisk /dev/<DEVICE> |
Verify Existing Partition Table |
p |
Create New GPT Partition Table |
g |
Create EFI Partition (512 megabytes)
New Partition |
n |
Partition Number - Accept Default of 1 |
ENTER |
First Sector - Accept Default |
ENTER |
Last Sector |
+512M |
Remove Existing Type (if asked) |
y |
Create New Type |
t |
Partition Number - Accept Default of 1 (if asked) |
ENTER |
Choose Partition Type "EFI System" |
1 |
Create BOOT Partition (512 megabytes)
New Partition |
n |
Partition Number - Accept Default of 2 |
ENTER |
First Sector - Accept Default |
ENTER |
Last Sector |
+512M |
Remove Existing Type (if asked) |
y |
Create New Type |
t |
Partition Number - Accept Default of 2 |
ENTER |
Choose Partition Type "BIOS boot" |
4 |
Create System (LVM) Physical Partition (all remaining free space)
New Partition |
n |
Partition Number - Accept Default of 2 |
ENTER |
First Sector - Accept Default |
ENTER |
Last Sector |
ENTER |
Remove Existing Type (if asked) |
y |
Create New Type |
t |
Partition Number - Accept Default of 3 |
ENTER |
Choose Partition Type "Linux LVM" |
43 |
Finalise Physical Partition Table
Verify the Partition Table |
p |
Write the Partition Table (save) |
w |
Quit fdisk (if required) |
q |
Verify Changes to Disk |
# fdisk -l |
Format Startup Physical Partitions
Format EFI Partition |
# mkfs.fat -F32 /dev/<device>1 |
Format BOOT Partition |
# mkfs.ext4 /dev/<device>2 |
Encrypt LVM Physical Partition |
# cryptsetup luksFormat /dev/<device>3 |
IGNORE Warning |
"Warning: Locking Directory ... is missing!" |
Open LVM Physical Partition |
# cryptsetup open --type luks /dev/<device>3 lvm |
Create Physical Volume |
# pvcreate --dataalignment 1m /dev/mapper/lvm |
Create Volume Group |
# vgcreate vg0 /dev/mapper/lvm |
Create Root Logical Volume |
# lvcreate -L 256GB vg0 -n lv_root |
Create Home Logical Volume |
# lvcreate -l 100%FREE vg0 -n lv_home |
Activate LVM Kernel Module |
# modprobe dm_mod |
Scan Volume Groups |
# vgscan |
Activate Volume Groups |
# vgchange -ay |
Format LVM Logical Partitions
Format ROOT Partition |
# mkfs.ext4 /dev/vg0/lv_root |
Format HOME Partition |
# mkfs.ext4 /dev/vg0/lv_home |
Mount ROOT Partition |
# mount /dev/vg0/lv_root /mnt |
Create HOME Directory |
# mkdir /mnt/home |
Create BOOT Directory |
# mkdir /mnt/boot |
Create ETC Directory |
# mkdir /mnt/etc |
Mount HOME Partition |
# mount /dev/vg0/lv_home /mnt/home |
Mount BOOT Partition |
# mount /dev/<device>2 /mnt/boot |
Create EFI Directory |
# mkdir /mnt/boot/EFI |
Mount EFI Partition |
# mount /dev/<device>1 /mnt/boot/EFI |
Generate File System Table |
# genfstab -U -p /mnt >> /mnt/etc/fstab |
Verify File System Table |
# cat /mnt/etc/fstab |
Backup File System Table |
# cp /mnt/etc/fstab /mnt/etc/fstab.bak |
Install Arch Linux
Install Base Packages |
# pacstrap -i /mnt base |
Transfer to Arch Installation |
# arch-chroot /mnt |
Configure Package Mirrors
Install Reflector Mirror Script |
# pacman -Sy reflector |
Set 10 Fastest NZ Mirrors |
# reflector --verbose --latest 10 --country 'New Zealand' --sort rate --save /etc/pacman.d/mirrorlist |
Verify Mirror List |
# cat /etc/pacman.d/mirrorlist |
Install Kernel & Headers |
# pacman -S linux linux-lts linux-headers linux-lts-headers |
Install Linux Firmware |
# pacman -S linux-firmware |
Install CPU Firmware Microcode |
# pacman -S intel-ucode |
Install LVM Support Package |
# pacman -S lvm2 |
Install Boot Packages |
# pacman -S dosfstools efibootmgr grub mtools os-prober |
Install Networking Packages |
# pacman -S dialog netctl networkmanager openssh wireless_tools wpa_supplicant |
Install SUDO (if required) |
# pacman -S sudo |
Install Base Development Packages |
# pacman -S base-devel |
Install Console Text Editors |
# pacman -S emacs micro nano vim |
Configure Arch Linux
Create Swap File |
# dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress |
Change Permissions |
# chmod 600 /swapfile |
Create Swap Space |
# mkswap /swapfile |
Append Swapfile to FSTAB |
# echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab |
Verify Updated FSTAB |
# cat /etc/fstab |
Test Updated FSTAB |
# mount -a |
Enable Swap Memory |
# swapon -a |
Check Memory for Swap |
# free -m |
Setup Ramdisk Environment
Edit MKINITCPIO Configuration |
# micro /etc/mkinitcpio.conf |
Find the line that begins with |
"HOOKS=" |
Between "block" & "filesystems" add |
... encrypt lvm2 ... |
Generate Image for Primary Kernel |
# mkinitcpio -p linux |
Generate Image for LTS Kernel |
# mkinitcpio -p linux-lts |
Setup Locale Configuration
Open Locale-Gen Config |
# micro /etc/locale.gen |
Uncomment-Out Line |
en_NZ.UTF-8 UTF-8 |
Set English Language Locale |
# localectl set-locale LANG="en_NZ.UTF-8" |
Set US Style Keymap |
# echo 'KEYMAP=us' > /etc/vconsole.conf |
Generate Locales |
# locale-gen |
Set System to Use NZ Timezone |
# timedatectl set-timezone "Pacific/Auckland" |
Enable Timezone Sync Service |
# systemctl enable systemd-timesyncd |
Install Grub onto MBR |
# grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck |
Create Locale Folder (if missing) |
# mkdir /boot/grub/locale |
Install English Locale Messages |
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo |
Open Grub Configuration |
# micro /etc/default/grub |
Uncomment Line |
GRUB_ENABLE_CRYPTODISK=y |
Find Line Beginning With |
"GRUB_CMDLINE_LINUX_DEFAULT=" |
At (Above) - Make First Parameter |
... cryptdevice/dev/<device>3:vg0:allow-discards |
Generate Grub Configuration |
# grub-mkconfig -o /boot/grub/grub.cfg |
Setup Local Host Name |
# hostnamectl set-hostname Aneeka |
Set Hostname File |
# echo 'Aneeka' > /etc/hostname |
Verify Hostname File |
# cat /etc/hostname |
Open Hosts File |
# micro /etc/hosts |
Add After Comment Lines
1 |
127.0.0.1 localhost |
2 |
127.0.0.1 localhost.localdomain |
2 |
127.0.0.1 local |
4 |
127.0.1.1 Aneeka.localdomain Aneeka |
4 |
<local network ip address> Aneeka |
6 |
::1 localhost |
7 |
::1 ip6-localhost |
8 |
::1 ip6-loopback |
9 |
fe80::1%lo0 localhost |
10 |
ff00::0 ip6-localnet |
11 |
ff00::0 ip6-mcastprefix |
12 |
ff02::1 ip6-allnodes |
13 |
ff02::2 ip6-allrouters |
14 |
ff02::3 ip6-allhosts |
15 |
255.255.255.255 broadcasthost |
16 |
0.0.0.0 0.0.0.0 |
|
Verify Hostname |
# hostnamectl |
Enable Network Manager Service |
# systemctl enable NetworkManager |
Enable SSH Service |
# systemctl enable sshd |
Set ROOT Password (VERY IMPORTANT!) |
# passwd |
Create Primary User Account |
# useradd -m -g users <username> |
Configure Primary User Groups |
# usermod -aG wheel,audio,video,optical,storage,power <username> |
Open Sudo Configuration |
# EDITOR=micro visudo |
Uncomment Line |
%wheel ALL=(ALL) ALL |
Install Graphical User Interface (GUI)
Install XORG Server |
# pacman -S xorg-server |
Install X Video Drivers |
# pacman -S xf86-video-intel |
Install NVIDIA Video Drivers |
# pacman -S nvidia nvidia-lts |
Install SDDM Login Manager |
# pacman -S sddm |
Install KDE Plasma (Desktop Environment) |
# pacman -S plasma-desktop |
Install Konsole (Terminal) |
# pacman -S konsole |
Install Dolphin (File Manager) |
# pacman -S dolphin |
Enable SDDM Service |
# systemctl enable sddm.service |
Exit Installation
Exit CHROOT Environment |
# exit |
Unmount EVERYTHING |
# umount -a |
IGNORE Errors |
"BUSY" |
Remove/Eject |
<Installation Media> |
Start Arch Linux (New Install)
Reboot Computer |
# reboot |
If Arch Linux Boots Successfully |
SHAKE FIST IN GLORIOUS SUCCESS! |
Otherwise... |
hang head in shameful defeat... |