Arch Linux is a rolling update distribution of Linux with great documentation, and a minimalist approach. I gravitate toward tools which encourage me to start small and gradually grow my understanding and skills. Arch is maybe even a little extreme for me in that regard, after installing Arch you have a system that is so bare bones it isn’t even useful. You then have all the choices in the world for how to set it up. This blog and my next one, Arch Linux First Steps, is documentation of the choices I made for my system.
This was written during my second install of Arch Linux on this laptop. I allowed my previous install to get stale for about 8 months. Arch Linux, being a rolling update distribution, was mad at me when I tried to update it after so long.
WARNING This is also an install where I completely wiped my computer including the prior Windows OS. If you want a dual boot system some of these steps might still work but you’ll probably want to find another example of a dual boot Arch install.
I curled down the PGP key here: https://www.archlinux.org/download/ And the ISO image here: https://mirrors.ocf.berkeley.edu/archlinux/iso/2019.11.01/
gpg --keyserver-options auto-key-retrieve --verify archlinux-2019.11.01-x86_64.iso.sig
Load ISO onto USB flash drive.
diskutil unmountDisk /dev/disk2 dd if=path/to/arch.iso of=/dev/rdisk2 bs=1m
Load on Lenovo Thinkpad t470s
When the Lenovo logo shows up hit
F12 to enter the “BOOT Menu”. Select the USB Drive.
Setup the wifi connection.
Check the disk out a bit.
nvme0n1 device for me has 238.5G, where
nvme0n1p1 is 1G for boot and
nvme0n1p2 is 237.5G. Remember, I’m documenting this during a re-install and it will likely look different for you.
cgdisk /dev/nvme0n1 I was shown:
1 1024.0 MiB EFI System boot 2 237.5 GiB Linux filesystem root
I want to clear these and recreate these partions in order to re-install Arch from scratch. So I navigated in
cgdisk /dev/nvme0n1 to both and deleted them. I then created new partitions with the following details.
2048 -> 512M guid: ef00 name: boot EFI all the rest guid: 8e00 (for LVM) name: Arch LVM
Create the EFI partition filesystem
mkfs.vfat -F32 -n EFI /dev/nvme0n1p1
Setup the encryption
cryptsetup -y -v luksFormat /dev/nvme0n1p2 cryptsetup open --typ luks /dev/nvme0n1p2 archlv # check it's there ls /dev/mapper/archlv # create physical volume pvcreate /dev/mapper/archlv # create virtual group vgcreate archvg /dev/mapper/archlv # Under the vg, you create logical volumes. lvcreate -L16G archvg -n swap lvcreate -L30G archvg -n root lvcreate -l 100%FREE archvg -n home # Then list the block to see what you've done. lsblk
Should have an
archlv and the vgs listed under the
mkfs.ext4 /dev/mapper/archvg-root mkfs.ext4 /dev/mapper/archvg-home mkswap /dev/mapper/archvg-swap swapon /dev/mapper/archvg-swap
Check that with
free -m to see the swap and free memory.
These steps actually mount everything we’ve been doing in the ISO install disk onto the computers filesystem.
mount /dev/mapper/archvg-root /mnt mkdir /mnt/boot mount /dev/nvme0n1p1 /mnt/boot mkdir /mnt/home mount /dev/mapper/archvg-home /mnt/home
Install base system
Install reflector and set the mirrorlist
This tool is awesome, was happy to learn of it. My first time installing Arch I didn’t know anything about the mirrorlist and I had slow download speeds.
pacman -S reflector reflector -c 'United States' -f 12 -l 12 --verbose --save /etc/pacman.d/mirrorlist
reflector --help to somewhat understand what’s happening here.
Install base arch to
Installs some basics into our minimal install.
pacstrap /mnt base base-devel linux linux-firmware intel-ucode sudo emacs vim tmux git networkmanager
Check it out with
Generate a filesystem table.
Note I learned later that I maybe should have used UUIDs in my filesystem table with the
genfstab -p /mnt >> /mnt/etc/fstab
Check that out with
Enter and setup the new system
Signs us out of the ISO and into our Arch install. Woot!
Setup the clock.
ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime hwclock --systohc --utc
Set root password with
vim /etc/locale.gen to uncomment the
en_US.UTF-8 UTF-8 and
en_US ISO-8859-1 lines. Then run
locale > /etc/locale.conf.
Set the hostname:
echo "nackjicholson" > /etc/hostname
Edit the hosts file with vim.
# Static table lookup for hostnames. # See hosts(5) for details. 127.0.0.1 nackjicholson.localdomain nackjicholson ::1 nackjicholson.localdomain nackjicholson
Edit the “HOOKS” line in
HOOKS=(base udev autodetect modconf block keyboard encrypt lvm2 filesystems fsck)
And run the following to generate the ramdisks.
mkinitcpio -p linux
NOTE For some reason this didn’t work for me, failing with “ERROR: Hook ‘lvm2’ cannot be found. I had to do
pacman -S lvm2 and then try again.
bootctl --path=/boot/ install
default arch timeout 5 editor 0
editor 0 disables a tricky hack I don’t really understand about entering the kernel. Okie doke!
title Arch Linux (ENCRYPTED) linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options cryptdevice=UUID=XXXX:archlv root=/dev/mapper/archvg-root quiet rw
To get the value of the UUID in there, you use
:read ! blkid /dev/nvme0n1p2 from within vim.
exit # exit arch-chroot umount -R /mnt reboot
root user with the password you set.
This is a minimal install of a Arch Linux on an SSD nvme disk. I hope it all worked for you too! Feel free to email me with any corrections or issues you faced. Check out my next entry on my own personal first steps on Arch Linux, things like installing the GNOME desktop environment and setting up the WiFi and such. Thanks for reading!