archinstall/prep-BTRFS-UEFI-Encrypted.sh

44 lines
1.4 KiB
Bash

localectl set-keymap de-latin1-nodeadkeys
timedatectl set-timezone Europe/Berlin
timedatectl set-ntp yes
parted --script /dev/vda \
mklable gpt \
mkpart "efi" fat32 1MiB 501MiB \
set 1 esp on \
mkpart "root" btrfs 501MiB 100%
mkfs.vfat /dev/vda1 -n EFI
cryptsetup --cipher aes-xts-plain64 --hash sha512 --use-random --verify-passphrase luksFormat /dev/vda2
cryptsetup luksOpen /dev/vda2 cryptroot
mkfs.btrfs /dev/mapper/cryptroot -L arch
mount /dev/mapper/cryptroot /mnt
cd /mnt
btrfs subvolume create @
btrfs subvolume create @home
btrfs subvolume create @var
btrfs subvolume create @log
btrfs subvolume create @cache
cd ~
umount -R /mnt
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@ /dev/mapper/cryptroot /mnt
mkdir -p /mnt/{home,boot,var}
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@home /dev/mapper/cryptroot /mnt/home
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@var /dev/mapper/cryptroot /mnt/var
mkdir -p /mnt/var/{cache,log}
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@log /dev/mapper/cryptroot /mnt/var/log
mount -o noatime,compress=zstd,space_cache=v2,discard=async,subvol=@cache /dev/mapper/cryptroot /mnt/var/cache
mount /dev/vda1 /mnt/boot
pacstrap /mnt base linux linux-lts linux-zen linux-firmware amd-ucode vim git btrfs-progs
genfstab -U /mnt >> /mnt/etc/fstab
ln -sf /run/systemd/resolve/stub-resolv.conf /mnt/etc/resolv.conf
arch-chroot /mnt