EZ Arch Encrypted Installation
Sep 1, 2018
- Download the Arch ISO.
-
Find your disk.
fdisk -l
- Partition (zero out the drive first using
dd
/ secure erase if you want to).fdisk /dev/nvme1n1
n
1
- enter
+550M
n
2
- enter
- enter
t
1
1
w
- Encrypt.
aes-xts
should be the fastest if your CPU supports AES instructions. Most modern CPUs do. Also, Grub does not support LUKS2 yet so do not bother trying it.cryptsetup benchmark
cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-urandom luksFormat /dev/nvme1n1p2
cryptsetup luksOpen /dev/nvme1n1p2 rootfs
- Format.
mkfs.vfat -F32 /dev/nvme1n1p1
mkfs.ext4 /dev/mapper/rootfs
- Mount.
mount /dev/mapper/rootfs /mnt
mkdir /mnt/boot
mount /dev/nvme1n1p1 /mnt/boot
- Install.
pacstrap /mnt base base-devel
genfstab -U /mnt > /mnt/etc/fstab
arch-chroot /mnt bash
- Grub.
pacman -S grub efibootmgr linux linux-firmware
- Edit
/etc/mkinitcpio.conf
and addencrypt
to theHOOKS
field mkinitcpio -p linux
- Edit
/etc/default/grub
and uncommentGRUB_ENABLE_CRYPTODISK
- Change
GRUB_CMDLINE_LINUX
toGRUB_CMDLINE_LINUX="cryptdevice=UUID=<uuid>:rootfs"
- Replace the UUID above with the encrypted partition UUID from
blkid
grub-install --target=x86_64-efi --bootloader-id=arch --efi-directory=/boot --recheck
grub-mkconfig -o /boot/grub/grub.cfg
- Swap. If you have tons of RAM this isn’t really necessary. Having a swap file instead of a partition makes things easier in case you need to remove the swap device or increase/decrease its size. It will also be encrypted since it’s located inside the LUKS partition.
dd if=/dev/zero of=/swap bs=1M count=2k
chmod 0600 /swap
mkswap /swap
swapon /swap
- Edit
/etc/fstab
and add/swap none swap defaults 0 0
- Time zone.
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
- Locale.
- Edit
/etc/locale.gen
and uncomment your locale. Probably en_US.UTF-8. locale-gen
- Edit
/etc/locale.conf
and addLANG=en_US.UTF-8
- Edit
- Hostname.
- Edit
/etc/hostname
and set it to what the machine should be called.
- Edit
- User.
useradd -m -g users -G wheel,storage,network,power,rfkill -s /bin/bash <username>
passwd <username>
passwd root
- Edit
/etc/sudoers
and uncomment%wheel ALL=(ALL) ALL
- Reboot.
exit
reboot
-
If you did everything correctly, you should see a Grub OS selection that will take you to a prompt to enter your password.
- I’ll be installing GNOME, but you can choose anything you like.
sudo systemctl start dhcpcd.service
sudo pacman -S xorg xorg-server gnome gnome-extra
sudo systemctl enable NetworkManager.service
sudo systemctl enable gdm.service
reboot
That’s pretty much it. Check out my short guide about improving desktop responsiveness.