Skip to content

Instantly share code, notes, and snippets.

@incoggnito incoggnito/archinstall.md
Last active Oct 20, 2019

Embed
What would you like to do?
Arch Linux Installation NVME + dm_crypt + systemd bootloader

Arch Linux 5.3.1 installation

19.Oct. 2019

no dual boot and

hardware:

  • Board: AsRock Z170
  • CPU: Intel i6700k
  • SSD: Samsung NVME 970 EVO
  • GPU: NVIDIA RTX 2060

Prepare

check iso

Check the iso and the pgp fingerprint.

md5sum archlinux-2019.10.01-x86_64.iso
pacman-key -v archlinux-version-x86_64.iso.sig 

create Live USB-Stick

dd bs=4M if=~/dwn/archlinux-2019.10.01-x86_64.iso of=/dev/sdb status=progress oflag=sync

boot in uefi mode and change keyboard layout

loadkeys de-latin1

Check things ...

inet conection?

ping -c3 archlinux.org

efi?

ls /sys/firmware/efi

prepare ssh

passwd
ip addr
systemctl start sshd.service

connect via remote

ssh-keygen -R ipadress #only after second con
ssh root@ipadress

partition table

overwrite

dd status=progress if=/dev/zero of=/dev/nvmen1

partiton layout

gdisk /dev/nvme0n1

n > enter > enter > +512M > ef00
n > enter > enter > enter > enter
w

Luks encryption

modprobe dm-crypt
cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/nvme0n1p2
cryptsetup luksOpen /dev/nvme0n1p2 lvm

LVM

pvcreate /dev/mapper/lvm
vgcreate main /dev/mapper/lvm
lvcreate -L 30GB -n root main
lvcreate -l 100%FREE -n home main

format

mkfs.fat -F 32 -n UEFI /dev/nvme0n1p1
mkfs.ext4 -L root /dev/mapper/main-root
mkfs.ext4 -L home /dev/mapper/main-home

mount

mount /dev/mapper/main-root /mnt

mkdir /mnt/home
mount /dev/mapper/main-home /mnt/home

mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot

base system

cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist 
pacstrap /mnt base base-devel linux linux-headers linux-firmware intel-ucode bash-completion neovim man-db man-pages lvm2 e2fsprogs networkmanager

create fstab

overwrite fstab settings on home and root to noatime

genfstab -Lp /mnt > /mnt/etc/fstab

system settings

arch-chroot /mnt/
echo arch > /etc/hostname

nvim /etc/locale.gen
locale-gen

echo KEYMAP=de-latin1 > /etc/vconsole.conf
echo FONT=lat9w-16 >> /etc/vconsole.conf
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime

initframs

nvim /etc/mkinitcpio.conf
...
MODULES=(ext4)
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck)

mkinitcpio -p linux 

systemd bootloader

main configuration incl. ucode

pacman -S efibootmgr dosfstools gptfdisk
bootctl install
nvim /boot/loader/entries/arch.conf

...
title    Arch Linux
linux    /vmlinuz-linux
initrd   /intel-ucode.img
initrd   /initramfs-linux.img
options  cryptdevice=/dev/nvme0n1p2:main root=/dev/mapper/main-root rw lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8

create fallback to lts kernel

pacman -S linux-lts linux-lts-headers
nvim /boot/loader/entries/arch-fallback.conf
...
title    Arch Linux Fallback
linux    /vmlinuz-linux-lts
initrd   /intel-ucode.img
initrd   /initramfs-linux-lts.img
options  cryptdevice=/dev/nvme0n1p2:main root=/dev/mapper/main-root rw lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8

set start options

nvim /boot/loader/loader.conf

timeout 1
default arch

reboot

exit
umount /mnt/{boot,home,}
reboot

reconnect network

systemctl enable NetworkManger.service

install nvidia

pacman -S nvidia nvidia-utils nvidia-settings

....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.