Anleitung in einfacher Sprache.
- die Rechner-Firmware ist EFI
- EFI Secure Boot ist deaktiviert
- die EFI-Systempartition ist unverschlüsselt
- bootctl oder GRUB ist der Bootloader
- Kernel und initramfs sind auch auf der EFI-Systempartition gespeichert
/
und/home
sind mit dm-crypt/LUKS2 verschlüsselt- als Dateisystem kommt ext4 zum Einsatz
- das Betriebssystem ist Arch-Linux
- ISO-Datei des neuesten Arch Linux herunterladen
- ISO-Datei booten
- Konsole des Benutzers
root
wird angezeigt
loadkeys de-latin1
passwd
ip a sh
Hinweis: Das geschieht, um Befehle einfach in das Terminal kopieren zu können.
ssh root@<ip-addr>
lsblk -p
HD='/dev/sda' # Beispiel
sgdisk -o $HD
sgdisk -n 0:0:+512M -t 0:ef00 -c 0:'EFI system partition' $HD
sgdisk -n 0:0:0 -t 0:8300 -c 0:'Linux filesystem' $HD
sgdisk -p $HD
>>>
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB EF00 EFI system partition
2 1050624 41943006 19.5 GiB 8300 Linux filesystem
<<<
lsblk -p
EFI='/dev/sda1' # Beispiel
LUKS='/dev/sda2' # Beispiel
cryptsetup luksFormat $LUKS
cryptsetup luksDump $LUKS
cryptsetup luksOpen $LUKS lvm
https://wiki.archlinux.de/images/Partitionsschema_bei_uefi_mit_verschluesselung.png
pvcreate /dev/mapper/lvm
vgcreate main /dev/mapper/lvm
lvcreate -l 50%FREE -n root main
lvcreate -l 100%FREE -n home main
lvdisplay, lvscan, lvs, vgscan, vgs, pvscan, pvs
mkfs.ext4 -L root /dev/mapper/main-root
mkfs.ext4 -L home /dev/mapper/main-home
mkfs.fat -F32 $EFI
mount /dev/mapper/main-root /mnt
mkdir /mnt/home
mount /dev/mapper/main-home /mnt/home
mkdir /mnt/boot
mount $EFI /mnt/boot
reflector -c Germany -p http -p https --sort rate -n 5 > /etc/pacman.d/mirrorlist
pacstrap /mnt base base-devel linux linux-firmware \
dosfstools gptfdisk lvm2 efibootmgr \
dhcpcd dhclient networkmanager \
nano man-db
genfstab -Lp /mnt > /mnt/etc/fstab
arch-chroot /mnt
echo arch > /etc/hostname
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
locale-gen
echo 'KEYMAP=de-latin1' > /etc/vconsole.conf
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
# Konfiguration sichern
cp /etc/mkinitcpio.conf{,~}
# Konfiguration ändern
sed -i 's/^MODULES=.*$/MODULES=(ext4)/' /etc/mkinitcpio.conf
sed -i 's/^HOOKS=.*$/HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems fsck shutdown)/' /etc/mkinitcpio.conf
mkinitcpio -p linux
passwd
Vier Punkte.
bootctl install
cat << EOT > /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=${LUKS}:main root=/dev/mapper/main-root rw init=/usr/lib/systemd/systemd
EOT
cat << EOT > /boot/loader/entries/arch-fallback.conf
title Arch Linux Fallback
linux /vmlinuz-linux
initrd /initramfs-linux-fallback.img
options cryptdevice=${LUKS}:main root=/dev/mapper/main-root rw init=/usr/lib/systemd/systemd
EOT
cat << EOT > /boot/loader/loader.conf
timeout 1
default arch.conf
EOT
Drei Punkte.
pacman -S grub
# /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:main init=/usr/lib/systemd/systemd"
grub-install --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
reboot
- https://wiki.archlinux.de/title/Installation_mit_UEFI_und_Verschl%C3%BCsselung
- https://kofler.info/arch-linux-installieren/
- https://bbs.archlinux.org/viewtopic.php?id=268460
- https://wiki.archlinux.org/title/GRUB#LUKS2
- https://cryptsetup-team.pages.debian.net/cryptsetup/encrypted-boot.html#avoiding-the-extra-password-prompt
- https://wiki.archlinux.org/title/Dm-crypt/Device_encryption
- https://nwildner.com/posts/2020-07-04-secure-your-boot-process/
- https://linux-club.de/forum/viewtopic.php?f=4&t=118035