Overview
Quick installation guide (not really) of Artix Linux with runit init system, which will also work for Arch. I wrote this as a reference for myself in the future and others and also to proof that installation is very easy and usually takes about 10 minutes.
Encryption
I prefer installing system on an encrypted partition, because as of time of writing this I keep my main system on an external ssd for portability. Encryption is also necessary on laptops because anyone can load to it from live usb of any linux distro and do whatever they want with filesystem. Which can be done for windows to, but getting encryption on that is hard and pointless, because microsoyft will put your key on their servers.
One unconvinience that comes with using encryption is the need to put two passwords to unlock your system: one for disk and one for user, so I will show you how to setup autologin to user account and enter only encryption password.
Disk preparation
Use lsblk
to view available partitions and disks. Find one that you will
be installing on by it's size. Later it will be called /dev/sdX
.
Partition disk with fdisk
. Use p
, d
, n
, w
, to print current
partition table, delete partition, create partition, write changes to disk respectively.
I usually create 1G boot partition, 8G swap partition and use the rest space
for an actual system.
# boot
mkfs.fat -F32 /dev/sdX1
# swap
mkswap /dev/sdX2
swapon /dev/sdX2
# encrypted root
cryptsetup luksFormat /dev/sdX3
cryptsetup open /dev/sdX3 root
mkfs.btrfs /dev/mapper/root
# mount
mount --mkdir /dev/sdX1 /mnt/boot
mount /dev/mapper/root /mnt
# actual intall (use `pacstrap` on arch)
basestrap /mnt linux linux-firmware base base-devel runit elogind-runit \
networkmanager networkmanager-runit cryptsetup lvm2 lvm2-runit grub vim
Basic settings
# fstab
fstabgen -U /mnt >>/mnt/etc/fstab
# chroot (use `arch-chroot` on arch)
artix-chroot /mnt bash
# timezone
ln -s /usr/share/zoneinfo/<Region>/<City> /etc/localtime
hwclock --systohc
# locale
echo "en_US.UTF-8 UTF-8" >/etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >/etc/locale.conf
# hostname and hosts
echo "artix" >/etc/hostname
# 127.0.0.1 localhost
# ::1 localhost
# 127.0.1.1 artix.localdomain artix
vim /etc/hosts
# NetworkManager
ln -s /etc/runit/sv/NetworkManager /etc/runit/runsvdir/current
# root password
passwd
# create your user
useradd -G wheel -m thsx
passwd thsx
# uncomment '%wheel ALL=(ALL:ALL) ALL' to enable root access
visudo
Grub encryption
# add '--autologin thsx' to GETTY_ARGS variable
vim /etc/runit/sv/agetty-tty1/conf
# add 'encrypt lvm2' after 'block' to HOOKS array
vim /etc/mkinitcpio.conf
mkinitcpio -p linux
exit
lsblk -f >>/mnt/etc/default/grub
artix-chroot /mnt bash # use `arch-chroot` on arch
vim /etc/default/grub
Change GRUB_TIMEOUT
to 0.
After that go to the end of the file and delete all output from
lsblk -f
but the two lines with luksCrypt (1) and btrfs (2) filesystems.
Add their UUIDs in the next format to GRUB_CMDLINE_LINUX_DEFAULT
variable:
`cryptdevice=UUID=
<uuid of (1)>:cryptlvm root=UUID=
<uuid of (2)>`
After thar remove all lsblk -f
output or it will mess up your grub config.
# install grub and reboot into new system
grub-install /dev/sdX
grub-mkconfig -o /boot/grub/grub.cfg
exit
reboot
Done! After following instructions above you will be able to install one of the best arch-based distro.