Archlinux on Hetzner Cloud with Btrfs#

Post Install#

Pacman#

nano /etc/pacman.conf
# uncomment Color, VerbosePkgLists and ParallelDownloads

# init pacman
nano /etc/pacman.d/mirrorlist

pacman-key --init
pacman-key --populate archlinux

# refresh package lists
pacman -Syyu

Install snapper#

pacman -S snapper
snapper -c root create-config /
btrfs subvolume delete /.snapshots
mkdir /.snapshots
# edit /etc/fstab and mount /@snapshots to /.snapshots
mount /.snapshots
# reboot and see if all is mounted

# first manual test snapshot
snapper -c root create --description test01

# check if snapshot is stored
ls -ls /.snapshots

# install snap-pac to let pacman automatically use snapper to create pre/post snapshots
# install grub-btrfs to be able to boot from snapshots
pacman -S snap-pac grub-btrfs

# the grub main menu needs to be generated to make a menuentry for the snapshots sub menu
# see https://github.com/Antynea/grub-btrfs#-usage
grub-mkconfig -o /boot/grub/grub.cfg

# enable daemon script that automatically updates the grub menu when it sees a snapshot being created or deleted
# see https://github.com/Antynea/grub-btrfs#systemd-instructions
systemctl enable --now grub-btrfsd

Other#

# enable periodic TRIM
# see https://wiki.archlinux.org/title/Solid_state_drive#Periodic_TRIM
systemctl enable --now fstrim.timer

Other Post Install Todo#

  • secure sshd

  • check if TRIM and ssd options are correct

    • https://wiki.archlinux.org/title/btrfs#SSD_TRIM

    • https://wiki.archlinux.org/title/Solid_state_drive#Periodic_TRIM

    • https://btrfs.readthedocs.io/en/latest/Trim.html

    • https://btrfs.readthedocs.io/en/latest/btrfs-man5.html#mount-options

  • setup sudo and secure root

  • apply general recommendations: https://wiki.archlinux.org/title/General_recommendations

  • apply security: https://wiki.archlinux.org/title/Security

  • check “system maintenance”: https://wiki.archlinux.org/title/System_maintenance

  • no fsck in hooks (mkinitcpio)?