Deployment


Update time.

timedatectl set-ntp true

Prepare disk.

gdisk /dev/nvme0n1
## Command (? for help): **o**
## This option deletes all partitions and creates a new protective MBR.
## Proceed? (Y/N): **y**
##
## Command (? for help): **n**
## Partition number (1-128, default 1): **1**
## First sector (34-4000797326, default = 2048) or {+-}size{KMGTP}: **0**
## Last sector (2048-4000797326, default = 4000797326) or {+-}size{KMGTP}: **+1M**
## Current type is 8300 (Linux filesystem)
## Hex code or GUID (L to show codes, Enter = 8300): **ef02**
## Changed type of partition to 'BIOS boot partition'
##
## Command (? for help): **n**
## Partition number (2-128, default 2): **2**
## First sector (34-4000797326, default = 4096) or {+-}size{KMGTP}: **4096**
## Last sector (4096-4000797326, default = 4000797326) or {+-}size{KMGTP}: **+550M**
## Current type is 8300 (Linux filesystem)
## Hex code or GUID (L to show codes, Enter = 8300): **ef00**
## Changed type of partition to 'EFI system partition'
##
## Command (? for help): **n**
## Partition number (3-128, default 3): **3**
## First sector (34-4000797326, default = 1130496) or {+-}size{KMGTP}: **1130496**
## Last sector (1329152-500118158, default = 500117503) or {+-}size{KMGTP}: **4000797326**
## Current type is 8300 (Linux filesystem)
## Hex code or GUID (L to show codes, Enter = 8300): **8309**
## Changed type of partition to 'Linux LUKS'
##
## Command (? for help): **w**
##
## Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
## PARTITIONS!!
##
## Do you want to proceed? (Y/N): **y**
## OK; writing new GUID partition table (GPT) to /dev/nvme0n1.
## The operation has completed successfully.

Create and open encrypted container.

cryptsetup luksFormat --type luks1 --use-random -S 1 -s 512 -h sha512 -i 5000 /dev/nvme0n1p3
## WARNING: Device /dev/nvme0n1p3 already contains a 'crypto_LUKS' superblock signature.
##
## WARNING!
## ========
## This will overwrite data on /dev/nvme0n1p3 irrevocably.
##
## Are you sure? (Type 'yes' in capital letters): **YES**
## Enter passphrase for /dev/nvme0n1p3:
## Verify passphrase:
## cryptsetup luksFormat --type luks1 --use-random -S 1 -s 512 -h sha512 -i 5000  7.25s user 0.08s system 23% cpu 31.822 total

cryptsetup open /dev/nvme0n1p3 cryptlvm
## Enter passphrase for /dev/nvme0n1p3:
## cryptsetup open /dev/nvme0n1p3 cryptlvm  15.41s user 0.01s system 45% cpu 33.880 total

Create logical volumes.

mkfs.btrfs -L arch /dev/mapper/cryptlvm
mount /dev/mapper/cryptlvm /mnt

btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@swap
btrfs filesystem mkswapfile --size 8g --uuid clear /mnt/@swap/swapfile
umount /mnt

mount -o noatime,compress=zstd,subvol=@ /dev/mapper/cryptlvm /mnt
mkdir /mnt/home
mount -o noatime,compress=zstd,subvol=@home /dev/mapper/cryptlvm /mnt/home
mkdir /mnt/swap
mount -o noatime,subvol=@swap /dev/mapper/cryptlvm /mnt/swap
swapon /mnt/swap/swapfile

mkfs.fat -F32 /dev/nvme0n1p2
mkdir /mnt/efi
mount /dev/nvme0n1p2 /mnt/efi

Install operating system.

pacstrap /mnt base dhcpcd linux linux-firmware btrfs-progs mkinitcpio openssh sudo vim

Enter system chroot.

genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt

Preparation


Configure local time.

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
hwclock --systohc

Configure localization.