lsblk
- list block devicessudo umount /dev/sdx
- ensure usb is not mountedsudo dd bs=4M if=path/to/input.iso of=/dev/sdx oflag=sync status=progress
ls /sys/firmware/efi/efivars
- if the directory exist then UEFI is supported
the iwd
internet wireless daemon is included in the ISO by default and provides the iwctl
utility.
iwctl
- run the interactive promptdevice list
- list all wireless NICsstation wlan0 scan
station wlan0 get-networks
station wlan0 connect <ssid>
ping archlinux.org
alternatively:
iwctl --passphrase passphrase station <device> connect <ssid>
cfdisk /dev/nvme0n1
- create a boot partition minimum 300MB, and recommended 512MB
- ensure that the boot partition type is an
EFI System
- create a root partition consisting with the rest of the space
- ensure that the root partition type is a
Linux Filesystem
NOTE: the main advantage of separate partitions for root
and home
is that personal data can be retrieved even when the system is reinstalled or corrupted. the disadvantage is only a limited amount of programs can be installed on the root parition. i do not use this type of partitioning because i like to have a flexible system where size is not a constraint.
cryptsetup -y -v luksFormat /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 root
the mkfs
utility is provided by the package util-linux
and util-linux-libs
included on the ISO from the linux kernel archive. To format DOS file systems such as FAT32 after this guide, install the package dosfstools
.
mkfs.vfat -F 32 /dev/nvme0n1p1
- UEFI needs FAT32mkfs.ext4 /dev/mapper/root
- root partition ext4 is standard
mount /dev/mapper/root /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
lsblk
dd if=/dev/zero of=/mnt/swapfile bs=1M count=2048 status=progress
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapflie
pacstrap /mnt base base-devel linux linux-firmware zsh sudo neovim
genfstab -U /mnt >> /mnt/etc/fstab
- the-U
flag utilises UUIDsarch-root /mnt
ln -sf /usr/share/zoneinfo/Australia/NSW
hwclock --systohc
timedatectl set-ntp true
nvim /etc/locale.gen
# Uncomment the following lines
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
locale-gen
echo LANG=en_AU.UTF-8 > /etc/locale.conf
hostnamectl hostname <name>
orecho '<name>' > /etc/hostname
nvim /etc/hosts
# Insert/Modify the following lines
127.0.0.1 localhost
::1 localhost
127.0.1.1 hostname.localdomain hostname
nvim /etc/mkinitcpio.conf
# add keyboard between autodetect and modconf, add encrypt between block and filesystems`
HOOKS=(base udev autodetect keyboard modconf block encrypt filesystems keyboard fsck)
mkinitcpio -P
pacman -S grub efibootmgr intel-ucode (or amd-ucode for AMD processors)
blkid -s UUID -o value /dev/nvme0n1p2 to get the UUID of the device
nvim /etc/default/grub
# replace xxxx with the UUID of the nvme0n1p2 device to tell GRUB about the encrypted file system
GRUB_TIMEOUT=0
GRUB_CMDLINE_LINUX="cryptdevice=UUID=xxxx:root"
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg to configure GRUB
pacman -S networkmanager
systemctl enable --now NetworkManager
exit && reboot
nmcli d wifi list
nmcli d wifi connect ESSID password MY_PASSWORD
sudo pacman -S pipewire pipewire-pulse
sudo pacman -S bluez bluez-utils
sudo systemctl enable bluetooth.service
sudo pacman -S nftables
sudo nvim /etc/nftables.conf
## Comment rules if they are not needed
#tcp dport ssh accept comment "allow sshd"
sudo systemctl enable nftables --now
sudo systemctl enable systemd-timesyncd.service --now
sudo pacman -S tlp tlp-rdw
sudo systemctl enable tlp --now
sudo systemctl enable NetworkManager-dispatcher --now
sudo tlp-stat
- follow the instructions provided by
tlp-stat
sudo systemctl enable --now fstrim.timer
sudo pacman -S reflector
sudo nvim /etc/xdg/reflector/reflector.conf
sudo systemctl enable reflector.timer --now
sudo echo 'vm.swappiness=10' > /etc/sysctl.d/99-swappiness.conf'
passwd root
EDITOR=nvim; VISUAL=nvim; visudo
ornvim /etc/sudoers
- uncomment%sudo
groupsudo passwd -l root
- (optional lock out root for security)
## Uncomment to allow members of group sudo to execute any command
%sudo ALL=(ALL) NOPASSWD: ALL
useradd -m -G wheel,sudo,video <username>
passwd <username>
su - <username>
sudo pacman -S git
git config --global user.email <email>
git config --global user.name <username>
git config --global init.defaultBranch <branchname>
git clone --bare <git-repo-url> $HOME/.local/share/.dotrepo
alias dot="git --git-dir=$HOME/.local/share/.dotrepo --work-tree=$HOME"
dot checkout
dot config --local status.showUntrackedFlies no