User Tools

Site Tools


en:ressources:astuces:archlinux_luks_install

Originally from https://gist.github.com/mattiaslundberg/8620837. Copied here for my own archive.

Configure the wifi:

wifi-menu

Create partitions with fdisk

Setup the encryption of the system

cryptsetup luksFormat --type luks2 /dev/sdaX

Open the partition and make an ext4 file system

cryptsetup open /dev/sdaX cryptroot

mkfs.ext4 /dev/mapper/cryptroot

Mount the new system

mount /dev/mapper/cryptroot /mnt # /mnt is the installed system
mkdir /mnt/boot
mount /dev/sda2 /mnt/boot
mkdir /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi

Install the system also includes stuff needed for starting wifi when first booting into the newly installed system Unless vim and zsh are desired these can be removed from the command

pacstrap /mnt base base-devel grub-efi-x86_64 zsh vim git efibootmgr dialog wpa_supplicant

Setup fstab

genfstab -pU /mnt >> /mnt/etc/fstab

Make /tmp a ramdisk (add the following line to /mnt/etc/fstab)

tmpfs	/tmp	tmpfs	defaults,noatime,mode=1777	0	0

Enter the new system

arch-chroot /mnt /bin/bash

Setup system clock to local timezone

ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
hwclock --systohc --utc

Set the hostname

echo MYHOSTNAME > /etc/hostname

Update locale

echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo LANGUAGE=en_US >> /etc/locale.conf
echo LC_ALL=C >> /etc/locale.conf

Set password for root

passwd

Configure mkinitcpio with modules needed for the initrd image

  • Add 'ext4' to MODULES
  • Add 'keyboard', 'keymap' and 'encrypt' to HOOKS before filesystems
vim /etc/mkinitcpio.conf

Regenerate initrd image

mkinitcpio -p linux

Setup grub

grub-install

In /etc/default/grub edit the line GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX=“cryptdevice=/dev/sdaX:luks:allow-discards” then run:

grub-mkconfig -o /boot/grub/grub.cfg

Reboot

en/ressources/astuces/archlinux_luks_install.txt · Last modified: 2024/04/17 10:19 by 127.0.0.1