Skip to content

Instantly share code, notes, and snippets.



Created Sep 19, 2015
What would you like to do?
Arch Linux installation on Asus F201E
# Arch Linux installation procedure on an Asus F201E
# UEFI boot + SSD + LVM + LUKS + TRIM + discards
# Randomize (or zero) drive contents
dd if=/dev/urandom of=/dev/sda
# Create GPT and partitions
# Use gdisk to ensure proper partition alignment
gdisk /dev/sda
# 400MB boot partition on /dev/sda1 type ef00
# Remaining root partition on /dev/sda2 type 8300
# Setup encryption
cryptsetup --cipher aes-xts-plain64 --key-size 512 --hash sha512 \
--iter-time 5000 --use-random --verify-passphrase luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 cryptdisk
# Create LVM partitions
pvcreate /dev/mapper/cryptdisk
vgcreate vgroup /dev/mapper/cryptdisk
lvcreate --size 40G --name lvroot vgroup
lvcreate --extents +100%FREE --name lvhome vgroup
# Create filesystems
mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/mapper/vgroup-lvroot
mkfs.ext4 /dev/mapper/vgroup-lvhome
# Mount filesystems
mount /dev/mapper/vgroup-lvroot /mnt
mkdir -p /mnt/{boot,home}
mount /dev/sda1 /mnt/boot
mount /dev/mapper/vgroup-lvhome /mnt/home
# Install base system
pacstrap -i /mnt base base-devel
genfstab -U -p /mnt >> /mnt/etc/fstab
# edit the fstab and add the `discard` option to all partitions
# Chroot
arch-chroot /mnt
# Some general stuff
echo computer_name > /etc/hostname
ln -sf /usr/share/zoneinfo/zone/subzone /etc/localtime
# uncomment locales in /etc/locale.gen
echo LANG=your_locale > /etc/locale.conf
vi /etc/mkinitcpio.conf
# add `ext4 dm_mod dm_crypt aes_x86_64 i915` modules
# add the `encrypt` `lvm2` (before `filesystems`) and `shutdown` hooks
mkinitcpio -p linux
vi /etc/lvm/lvm.conf
# set `issue_discards = 1`
# systemd-boot
bootctl --path=/boot install
vi /boot/loader/entries/arch.conf
# use options root=/dev/mapper/vgroup-lvroot cryptdevice=/dev/sda2:vgroup:allow-discards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment