# dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress && sync
# wifi-menu
# useradd -M -G wheel -s /usr/bin/zsh ssh_user
# echo "ssh_user:ssh_user-password"|chpasswd
# echo "root:root-password"|chpasswd
# systemctl start sshd.service
# mount -o remount,size=10G /run/archiso/cowspace
# vim /etc/pacman.conf
----------------------
[archzfs]
Server = http://archzfs.com/$repo/$arch
# pacman-key -r F75D9D76
# pacman-key --lsign-key F75D9D76
# pacman -Sy linux-headers zfs-linux zfs-utils
# modprobe zfs
# touch /etc/zfs/zpool.cache
# wipefs -a /dev/sdx
# parted /dev/sdx
-----------------
(parted) mklabel gpt
(parted) mkpart ESP fat32 1MiB 1GiB
(parted) name 1 boot
(parted) set 1 boot on
(parted) mkpart primary ext4 1GiB 99%
(parted) name 2 root
# cryptsetup luksFormat --type luks2 -v -s 512 /dev/sdx2
# cryptsetup open /dev/sdx2 cryptroot
canmount=off
makes it so actual data is stored inside the parent dataset; but
the hierarchical structure exists for possible children.
Double check before you run any of these; not all are necessarily required either
# zpool create -o ashift=12 -o cachefile=/etc/zfs/zpool.cache -m none -R /mnt zroot /dev/mapper/cryptroot
# zfs create -o mountpoint=none -o compression=lz4 zroot/ROOT
# zfs create -o mountpoint=/ zroot/ROOT/default
# zfs create -o mountpoint=/root zroot/home/root
# zfs create -o mountpoint=/home/<username> zroot/home/<username>
# zpool set bootfs=zroot zroot
# zfs set relatime=on zroot
# zfs set compression=lz4 zroot
# zfs create -V 16G -b 4096 -o logbias=throughput -o sync=always -o primarycache=metadata -o com.sun:auto-snapshot=false zroot/swap
# mkswap -f /dev/zvol/zroot/swap
# zpool export zroot
# zpool import -R /mnt zroot
# mkdir /mnt/boot
# mount /dev/sdx1 /mnt/boot
# pacstrap -i /mnt base base-devel
# genfstab -U -p /mnt | grep boot >> /mnt/etc/fstab
# vim /mnt/etc/fstab
--------------------
/dev/zvol/zroot/swap none swap discard 0 0
# arch-chroot /mnt /bin/bash
# vi /etc/locale.gen
--------------------
Uncomment en_US.UTF-8 UTF-8
# locale-gen
# vi /etc/locale.conf
---------------------
LANG=en_US.UTF-8
# pacman -S vim
# pacman -S terminus-font
# vim /etc/pacman.conf
----------------------
[archzfs]
Server = http://archzfs.com/$repo/$arch
SigLevel = Never
# pacman-key -r F75D9D76
# pacman-key --lsign-key F75D9D76
# pacman -Sy linux-headers zfs-linux zfs-utils
# systemctl enable zfs.target
# systemctl enable zfs-import-cache
# systemctl enable zfs-mount
# vim /etc/modprobe.d/zfs.conf
------------------------------
options scsi_mod scan=sync
# ARC
#options zfs zfs_arc_max=4294967296
# 6 gb
#options zfs zfs_arc_max=6442450944
# 10 gb
options zfs zfs_arc_max=10737418240
# metadata limit
# 5 gb
options zfs zfs_arc_meta_limit=5368709120
# vim /etc/mkinitcpio.conf
--------------------------
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck consolefont keymap encrypt zfs)
# mkinitcpio -p linux
# passwd
# vim /etc/hostname
-------------------
<hostname>
# bootctl --path=/boot install
# vim /boot/loader/loader.conf
------------------------------
default arch
timeout 4
editor 0
# blkid /dev/sdx2 > partitionid.txt
# vim /boot/loader/entries/arch.conf
------------------------------------
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=<UUID>:cryptroot:allow-discards zfs=zroot/ROOT/default rw pcie_aspm=force
# vim /boot/loader/entries/arch-fallback.conf
---------------------------------------------
title Arch Linux Fallback
linux /vmlinuz-linux
initrd /initramfs-linux-fallback.img
options cryptdevice=UUID=<UUID>:cryptroot:allow-discards zfs=zroot/ROOT/default rw
# pacman -S openssh tlp smartmontools ethtool x86_energy_perf_policy wpa_supplicant inetutils netctl iwd wireless-regdb dialog netctl iwd dhcpcd util-linux device-mapper cryptsetup
# exit
# cp /etc/zfs/zpool.cache /mnt/etc/zfs/
# umount /mnt/boot
# zpool export zroot
# reboot
# nmcli d wifi list
# nmcli dev wifi connect <SSID> password <password>
# ping google.com
# pacman -S zsh
# useradd -m -G wheel -s /bin/zsh <username>
# zfs allow <username> create,mount,mountpoint,snapshot zroot/home/<username>
# chown -R <username> /home/<username>
# passwd <username>
# visudo
--------
Uncomment %wheel ALL=(ALL) ALL
# pacman -S rsync xorg-server xf86-video-intel xorg-xinit xorg-xrandr i3 pulseaudio pavucontrol termite conky git libyaml gcc6 imagemagick xorg-xbacklight mpv notify-osd ttf-inconsolata ttf-bitstream-vera ttf-dejavu ttf-droid ttf-fira-mono ttf-fira-sans ttf-freefont ttf-liberation ttf-roboto ttf-ubuntu-font-family
# exit
$ cp /etc/X11/xinit/xinitrc .xinitrc
$ vim .xinitrc
--------------
exec i3
$ gsettings set org.gnome.desktop.interface scaling-factor 2
$ vim .Xresources
-----------------
Xft.dpi: 166
Xft.autohint: false
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xft.hinting: true
Xft.antialias: true
Xft.rgba: rgb
$ startx
$ setxkbmap be