rj1.su - my website
git clone https://github.com/rj1/rj1.su
install-arch-linux-full-disk-encryption.md (4117B) - raw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | --- title: arch linux installation notes date: "2021-05-16" lastmod: "2022-12-05" --- install information: - systemd-boot - luks encryption - zen kernel - sway ## verify we booted via efi {{< highlight shell >}} ls /sys/firmware/efi/efivars {{< / highlight >}} if this command shows the directory without error, proceed ## system clock ```shell timedatectl set-ntp true ``` ## partitioning I use cfdisk | partition | size | code | fs | -------------------|-----------|------|------| | boot (/dev/sda1) | 512.0 MiB | ef00 | efi | | root (/dev/sda2) | the rest | 8300 | ext4 | ## create encrypted root partition ```shell cryptsetup luksFormat /dev/sda2 cryptsetup open /dev/sda2 cryptroot mkfs.ext4 /dev/mapper/cryptroot mount /dev/mapper/cryptroot /mnt ``` ## create boot partition ```shell mkfs.fat -F32 /dev/sda1 mkdir /mnt/boot mount /dev/sda1 /mnt/boot ``` ## install base arch system ```shell pacstrap /mnt base linux-zen linux-zen-headers linux-firmware sudo neovim ``` ## generate fstab file ```shell genfstab -U /mnt /mnt/etc/fstab ``` ## chroot into your fresh install ```shell arch-chroot /mnt ``` ## set timezone ```shell ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime hwclock --systohc ``` ## locale ```shell echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen locale-gen localectl set-locale LANG=en_US.UTF-8 ``` ## basic network configuration ```shell echo "myhostname" > /etc/hostname ``` modify `/etc/hosts` ``` 127.0.0.1 localhost 127.0.1.1 myhostname.localdomain myhostname ``` replace `myhostname` with whatever you like create `/etc/systemd/network/20-wired.network` ``` [Match] Name=enp3s0 [Network] DHCP=yes DNS=1.1.1.1 DNS=1.0.0.1 [DHCP] UseDNS=false ``` edit `/etc/systemd/resolved.conf` to change dns client settings make sure software that relies on resolv.conf works ```shell ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf ``` ```shell systemctl enable systemd-networkd systemd-resolved ``` ## mkinitcpio configuration modify `/etc/mkinitcpio.conf`, add 'encrypt' to hooks ``` HOOKS=(base udev autodetect modconf block filesystems keyboard encrypt fsck) ``` ## generate initramfs ```shell mkinitcpio -P ``` ## set root passwd ```shell passwd ``` ## patch cpu microcode install either `amd-ucode` or `intel-ucode` depending on your system's cpu ```shell pacman -S intel-ucode ``` ## software ```shell pacman -S sudo base-devel zsh git tmux openssh ``` ## create user ```shell useradd -m -G wheel,seat -s /bin/zsh rj1 passwd rj1 ``` ## sudo ```shell echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers su rj1 ``` ## bootloader ### install systemd-boot ```shell bootctl install ``` ### create `/boot/loader/entries/arch.conf` ```shell title arch linux /vmlinuz-linux-zen initrd /intel-ucode.img initrd /initramfs-linux-zen.img options cryptdevice=UUID=UID-GOES-HERE:cryptroot root=/dev/mapper/cryptroot rw ``` `:r!blkid /dev/sda2 -sUUID -ovalue` in vim to insert the desired UUID ### modify `/boot/loader/loader.conf` ```shell default arch.conf timeout 2 console-mode max modifyor no ``` ### review boot config ```shell bootctl list ``` ## reboot ``` exit reboot ``` ## software ``` sway waybar alacritty noto-fonts-cjk noto-fonts-emoji swappy weechat libnotify mako notmuch mitmproxy oath-toolkit qrencode zbar grim slurp wf-recorder fzf swaybg wl-clipboard swayidle firefox chromium ncmpcpp php python ruby ruby-docs foot nmap bc mpd mpc ncmpcpp ripgrep fd qt5-wayland qt6-wayland mpv resolvconf wireplumber pipewire pipewire-jack pipewire-alsa pipewire-pulse alsa-utils bat man-db netcat rsync hugo isync msmtp w3m alot newsboat jq zathura zathura-pdf-mupdf pass wireguard-tools yadm ``` ## enable services systemctl enable seatd other ones like pipewire, etc. ## aur software ```shell git clone https://aur.archlinux.org/paru-bin.git cd paru makepkg -si paru -S tessen rofi-lbonn-wayland pinentry-rofi pass-coffin pass-otp vimiv-qt \ nerd-fonts-hack swaylock-effects-git nnn-nerd nvm dict dstask wob tomb rofimpd ``` ```shell yadm clone https://git.sr.ht/~rj1/dotfiles ``` have fun! |