Skip to content

Instantly share code, notes, and snippets.

@njnygaard
Forked from h3nchman/arch-linux-install
Last active March 11, 2021 19:09
Show Gist options
  • Save njnygaard/aa28c8c846abcc8f4319e4effd6a7af3 to your computer and use it in GitHub Desktop.
Save njnygaard/aa28c8c846abcc8f4319e4effd6a7af3 to your computer and use it in GitHub Desktop.
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Create partitions
cgdisk /dev/sdX
1 250M EFI partition # Hex code EF00
2 8G swap partition # Hex code 8200
3 100% size partiton # Hex code 8300
mkfs.vfat -F32 /dev/sdX1
mkswap /dev/sdX2
mkfs.ext4 /dev/sdX3
# Mount the new system
mount /dev/sdb3 /mnt
swapon /dev/sdb2
mkdir /mnt/boot
mount /dev/sdb1 /mnt/boot
# 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
# If running Archbang Openrc run sudo fast-install
pacstrap /mnt base base-devel grub-efi-x86_64 zsh vim git efibootmgr dialog wpa_supplicant linux linux-firmware mkinitcpio lvm2 f2fs-tools util-linux
# 'install' 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
# Change relatime on all non-boot partitions to noatime (reduces wear if using an SSD)
# Enter the new system
arch-chroot /mnt /bin/bash
# Setup system clock
ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime
hwclock --systohc --utc
# Set the hostname
echo tiny > /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
# Add real user remove -s flag if you don't whish to use zsh
useradd -m -g users -G wheel -s /bin/zsh MYUSERNAME
passwd MYUSERNAME
# Regenerate initrd image
mkinitcpio -p linux
# Setup systemd-boot
bootctl --path=/boot install
# Exit new system and go into the cd shell
exit
# Unmount all partitions
umount -R /mnt
swapoff -a
# Reboot into the new system, don't forget to remove the cd/usb
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment