Skip to content

Instantly share code, notes, and snippets.

@bench
Last active October 6, 2020 12:13
Show Gist options
  • Save bench/3e8227a8961ccf5609c150452b3d8996 to your computer and use it in GitHub Desktop.
Save bench/3e8227a8961ccf5609c150452b3d8996 to your computer and use it in GitHub Desktop.
arch install with encrypted disk, ext4 partition, no LVM, one swap file, i3 desktop.
# Create a bootable arch key and boot on it
# load your keymap
loadkeys fr
# connect to internet
iwclt
> station wlan0 scan
> station wlan0 connect SSID
# list your disk and identify the one you will use in /dev
# in my case, it is /dev/nvme0n1
fdisk -l
# create your partition
cfdisk /dev/nvme0n1
# keep the UEFI partition
# create a new partition of type LinuxFileSystem
# on my side I have
# /dev/nvmep1n1 => EFI partition
# /dev/nvmep1n2 => main linux partition
# feel free to create others if needed
# encrypt your disk
cryptsetup luksFormat /dev/nvmep1n2
cryptsetup open /dev/nvmep1n2 cryptroot
mkfs.ext4 /dev/mapper/cryptroot
# mount disks
mount /dev/mapper/cryptroot /mnt
mkdir /mnt/boot && mount /dev/nvmep1n1 /mnt/boot
# install arch and other utils (linux-zen here)
pacstrap /mnt base base-devel linux-zen linux-zen-headers linux-firmware pacman-contrib zip unzip p7zip vim alsa-utils syslog-ng mtools dosfstools lsb-release ntfs-3g exfat-utils bash-completion noto-fonts zsh i3wm i3status networkmanager xorg xorg-xinit ttf-dejavu gnome-terminal pulseaudio pavucontrol firefox
openssh git xf86-video-intel xorg-server xf86-input-libinput
# write fstab
genfstab -U /mnt >> /mnt/etc/fstab
# chroot into the system
arch-chroot /mnt
# set your local, set the system clock, and generate locales
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
hwclock --systohc
echo LANG=fr_FR.UTF-8 > /etc/locale.conf
echo KEYMAP=fr > /etc/vconsole.conf
locale-gen
# set your hostname, root passwd and user
echo <your-hostname> > /etc/hostname
passwd
useradd -m -s /usr/bin/zsh <username>
passwd <username>
usermod -aG audio <username>
usermod -aG video <username>
# add your users in sudoer if needed
visudo
# install systemd boot into your EFU partition
bootctl --path=/boot install
# edit /etc/mkinitcpio.conf to add the next MODULES and HOOKS
```
MODULES="ext4"
.
.
.
HOOKS="base udev autodetect modconf block keymap encrypt filesystems keyboard fsck"
```
# configure bootloader to detect your encrypted partition
# fot that copy your UUID disk (the one your formatted at the begginning)
# in my case UUID of /dev/nvmep1n2
blkid
# write a file in /boot/loader/entries/arch.conf with next content
```
title Arch Linux
linux /vmlinuz-linux-zen
initrd /initramfs-linux.img
options cryptdevice=UUID=<YOUR-PARTITION-UUID>:cryptroot root=/dev/mapper/cryptroot rw quiet
```
# create the intiial ramdisk env, umount disks and restart
mkinitcpio -p linux-zen
exit
umount -R /mnt
reboot
# the bootloader should request your master password (!)
# you can then login with your user and configure your internet connection with nmcli
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
nmcli device wifi connect SSID password PASSWORD
cp /etc/X11/xinit/xinitrc ~/.xinitrc
# and modify the ~/.xinitrc to include exec i3 at the end
startx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment