Arch linux install guide (Installing bootloader and luks on usb key).


USB KEY = /dev/sdc SSD = /dev/sda

Partition usb memory and create filesystem

# GPT it
parted --script --align optimal /dev/sdc mklabel gpt
# Create boot-partition
parted --script /dev/sdc mkpart ESP fat32 1M 513M
# Set boot-flag
parted /dev/sdc set 1 boot on

mkfs.vfat -F32 /dev/sdc1

Setup encryption on SSD

# Greate header "Disk"
truncate -s 2M header.img

#Whipe the disk, select a password
cryptsetup luksFormat /dev/sda --header header.img

#Mount disk
cryptsetup open --header header.img --type luks /dev/sda enc

## Setup lvm and partitions on SSD
pvcreate /dev/mapper/enc
vgcreate MyStorage /dev/mapper/enc

lvcreate -L 8G MyStorage -n swapvol
lvcreate -l +100%FREE MyStorage -n rootvol

mkfs.btrfs /dev/mapper/MyStorage-rootvol
mkswap /dev/mapper/MyStorage-swapvol

Mount partitions

mount /dev/mapper/MyStorage-rootvol /mnt
mkdir /mnt/boot
mount /dev/sdc1 /mnt/boot

Install base-system with i3 and some packages needed.

pacstrap /mnt bash btrfs-progs bzip2 coreutils device-mapper diffutils dmenu feh file filesystem findutils gawk gcc-libs gettext glibc grep gzip i3status i3-wm inetutils iproute2 iputils less licenses linux logrotate man-db man-pages nano pacman pciutils perl procps-ng psmisc rxvt-unicode sed shadow s-nail sudo sysfsutils systemd-sysvcompat tar texinfo ttf-dejavu urxvt-perls usbutils util-linux vim which xf86-input-synaptics xf86-video-vesa xfsprogs xorg-font-util xorg-server xorg-server-utils xorg-xinit xterm zsh slim

Configure your host

arch-chroot /mnt /bin/bash

Follow the guide on : Beginners guide

Note: You probably want to setup the locale from the livesystem

Add user

useradd -m -G adm,disk,audio,network,video YOURUSERNAME


Edit /etc/sudoers, and add or comment out

%adm ALL=(ALL) ALL

Install bootloader


bootctl install

Edit /boot/loader/entries/arch.conf


title          Arch Linux
linux          /vmlinuz-linux
initrd         /initramfs-linux.img
options        root=UUID=[YOUR PARTITIONS UUID] rw


bootctl update