Today my imaginary friend asked me: How did you even get it installed? – It being the coveted Arch Linux. Herbert, said imaginary friend, is using Fedora for all his university work, but he wants to use Arch. Everything he has read has told him that when he uses Arch all of the world’s secrets will be known. People will bow to his prowess. He will be a bastion of knowledge and wisdom.
I had a good laugh at his expense.
Welcome to the Fanatical Arch Linux Blog
Here we do all sorts of Linux shenanigans from systems administration, virtualization, software development, and shit posting. But we’re not on any Linux operating system. We’re using Arch Linux, by the way.
This first run through is going to be how I setup my system. Is it the best way? No. Is it the correct way? I think so, but it’s not universally accepted. Do you have to use the services and packages I used? No.
I understand that some people will take issue with systemd, my window manager, my display manager, my login manager, etc. This should be cookie cutter enough to where you can swap out one service for another. You could go through the installation guide, too, and read top to bottom. But I understand the number of choices and analysis paralysis and just wanting a push in the right direction all come into play. Hopefully this run down helps you in some shape or form. If not, email @SgtAwesomesauce for troubleshooting.
There may be typos or commands entered incorrectly because I’m going from memory and my current setup. Sorry in advance.
Install the Boot Media
Download from archlinux.org and create a media. Use Rufus, use Etcher, use dd
. Not important.
Run the Boot Media
Select “Arch Linux x86_64” at the prompt
Format your disk
I use cfidsk
, but you have a ton of options.
lsblk -f
will show you the drive.
cfdisk /dev/nvme0n1
Delete everything.
I create a 512M partition and the use the rest of the space for a second partition. The first partition is EFI system. The second is fine at Linux Filesystem.
I use LUKS because I don’t trust anyone.
cryptsetup -y -v luksFormat --type luks2 /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 cryptroot
Now I format with ext4 and fat32. You can use xfs, you can use ZFS, you can use BTRFS – I use ext4.
mkfs.ext4 /dev/mapper/cryptroot
mkfs.fat -F32 /dev/nvme0n1p1
Mount the Partitions
mount /dev/mapper/cryptroot /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
Pacstrap
As of Summer of this year the mirrors auto sort to the closest location. But you can dig around /etc/pacman.d/mirrorlist
if you want. For now, we get the base system. Remember, I work with C and C++ and Makefiles so my bootstrap might be different than the Small Linux Build VFIO Minimalist ZFS Nested VM setup
pacstrap /mnt base base-devel linux linux-firmware vim git sudo
Generate the fstab Template
Required for mounting to work properly
genfstab -U /mnt >> /mnt/etc/fstab
Time
timedatectl set-ntp true
Jump into the system
arch-chroot /mnt
Timezone and Locale
ln -sf /usr/share/zoneinfo/America/Chicago
hwclock --systohc
vim /etc/locale.gen
# untick UTF-8 and ISO-whatever (under UTF-8)
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Hosts and Networking
echo hostname > /etc/hostname
echo "127.0.0.1 hostname" >> /etc/hosts
echo "::1 hostname" >> /etc/hosts
echo "127.0.1.1 hostname.localdomain.net" >> /etc/hosts
vim /etc/systemd/network/wired.network
[Match]
Name=enp4s0
[Network]
Address=172.16.0.101/16
Gateway=172.16.0.1
DNS=172.16.0.1
systemctl enable systemd-networkd
systemctl enable systemd-resolved
Add encrypt to Linux
vim /etc/mkinitcpio.conf
HOOKS=(base udev autodetect modconf block filesystems keyboard encrypt fsck)
mkinitcpio -P
Setup Root Password
passwd
Add MicroCode
pacman -S amd-ucode
Systemd Boot
bootctl install
lsblk -f | tail -n 2 | head -n 1 | awk '{ print $4 }' >> /boot/loader/entries/arch.conf
vim /boot/loader/entries/arch.conf
title I Use Arch BTW
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options cryptdevice=UUID=string from awk:cryptroot root=/dev/mapper/cryptroot
vim /boot/loader/loader.conf
timeout 3
default arch.conf
Swapfile
dd if=/dev/zero of=/swapfile count=4096 bs=1M status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
vim /etc/fstab
/swapfile none swap defaults 0 0
GTFO
exit
umount -a
shutdown -r now
Now you’ll want to create a user and setup some sort of GUI if you’re going to use it as a desktop:
useradd -m -G wheel chris
passwd chris
EDITOR=vim visudo
# uncomment wheel
# I also uncomment Color and multilib from /etc/pacman.conf before moving on -- You'll need to run pacman -Sy too
# Need resolve.conf to be configured too
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
# GUI shit
pacman -S xorg-server xorg-apps xf86-video-vesa mesa
pacman -S nvidia nvidia-utils lib32-nvidia-utils
pacman -S gnome gnome-extra plasma kde-applications suckless-tools xfce4 awesomewm openbsd
systemctl enable gdm
r
e
b
o
o
t
You should have a fairly decent usable Arch Linux desktop. I know I do
The next shenanigans are going to be using LXC and KVM to run some full stack
ARE YOU FULL STACK BRO?
Because if you’re not you’re gonna be