Encrypted Arch Linux root partition install

Setup your partitions

Setup Luks

  1. Create encryption to root partition
  2. cryptsetup -y -v luksFormat /dev/sdxY
    

    Dont't forget about confirm by CAPITAL LETTERS

  3. Open encrypted partition
  4. cryptsetup open /dev/sdxY cryptroot
    
  5. Create file system to root partition
  6. mkfs.ext4 /dev/mapper/cryptroot
    

Mount your partitions

  1. Mount root partition
  2. mount /dev/mapper/cryptroot /mnt
    
  3. Mount boot partition into /mnt/boot or /mnt/boot/efi i recommand first one
  4. mount /dev/sdxZ /mnt/boot
    

Install packages

pacstrap /mnt base base-devel linux-lts linux-firmware vis 

Setting up arch

Edit HOOKS and add encrypt, can be placed after udev.

vim /etc/mkinitcpio.conf

mkinitcpio lts

$ mkinitcpio -p linux-lts

Generate fstab

$ genfstab -U /mnt >> /mnt/etc/fstab

EFISTUB setup

efibootmgr --disk /dev/sda --part 1 --create --label "Arch" --loader /vmlinuz-linux-lts --unicode 'cryptdevice=/dev/sda3:cryptroot root=/dev/mapper/cryptroot rw initrd=\initramfs-linux-lts.img'

Systemd-boot setup

Add entry to boot loader (systemd), Install boot loader bootctl and Configure boot loader

  1. Edit /boot/loader/loader.conf and add value
  2. 
    timeout 3
    
    default arch
    
  3. Create boot entry in /boot/loader/entries/entry
  4. 
    title Arch
    
    linux /vmlinuz-linux-lts
    
    initrd /initramfs-linux-lts.img
    
    options rw cryptdevice=UUID-XXXXXX-xxxx:cryptroot root=/dev/mapper/cryptroot 
    

Additional knowledge to hibernation

Edit kernel parameters and add resume to hooks and place after udev and encrypt