Skip to content

Instantly share code, notes, and snippets.

@dylanmtaylor
Created May 27, 2019 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanmtaylor/e7879a6f740953867e42c7e7c4ff1ea1 to your computer and use it in GitHub Desktop.
Save dylanmtaylor/e7879a6f740953867e42c7e7c4ff1ea1 to your computer and use it in GitHub Desktop.
Based on https://gist.githubusercontent.com/heppu/6e58b7a174803bc4c43da99642b6094b/raw/96b7ab0ea6356ac783fe4c90d1cb7073bdbb107f/ARCH_INSTALL.MD
# Create bootable USB
Download iso and use Etcher
# Boot from USB and set prepare system
```bash
timedatectl set-ntp true
```
# Connect to wifi if on a laptop
```bash
wifi-menu
```
# Partition the disk
We will create 2 partitions, one for boot partition and one for LUKS encrypted partition
```bash
fdisk /dev/sda
```
```
* g
* n
* 1
* enter
* +1G
* t
* 1
* n
* 2
* enter
* enter
* t
* 31
* w
```
# Format, encrypt and mount partitions
I will create only swap and root partitions, but here you can create home, var and other partitions if you wish.
```bash
mkfs.vfat -F32 /dev/nvme0n1p1
cryptsetup -v luksFormat /dev/nvme0n1p2
cryptsetup luksOpen /dev/nvme0n1p2 luks
pvcreate /dev/mapper/luks
vgcreate vg0 /dev/mapper/luks
lvcreate -l +100%FREE vg0 -n root
mkfs.ext4 /dev/mapper/vg0-root
mount /dev/mapper/vg0-root /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
```
# Install base system
```bash
pacstrap /mnt base base-devel
```
# Generate fstab
```bash
genfstab -pU /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/vg0-root
UUID=44bc2285-0443-44d6-8208-e914638ee1b1 / ext4 rw,noatime,data=ordered 0 1
# /dev/sda1
UUID=AEF3-11A1 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
# /dev/mapper/vg0-swap
UUID=708a05f7-633c-4f0f-a16b-3abce7def965 none swap defaults 0 0
```
Change relatime on all non-boot partitions to noatime.
# chroot into new system and prepare it
```bash
arch-chroot /mnt
hwclock --systohc
echo <your-hostname> > /etc/hostname
pacman -S dialog wpa_supplicant
passwd
useradd -m -G wheel <username>
passwd <username>
```
# Set locales
```bash
Uncomment en_US in /etc/locale.gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
locale-gen
```
# mkinitcpio
```bash
bootctl --path=/boot install
```
Edit /etc/mkinitcpio.conf
```
MODULES="ext4"
.
.
.
HOOKS="base udev autodetect modconf block keymap encrypt lvm2 filesystems keyboard fsck"
```
```bash
```
# Configure bootloader
Create /boot/loader/entries/arch.conf
```
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=/dev/nvme1n0p2:lvm:allow-discards root=/dev/mapper/vg0-root rw quiet
```
Edit /boot/loader/loader.conf
```
timeout 3
default arch
editor 0
```
# Finish installation and boot to new system
```bash
mkinitcpio -p linux
exit
umount -R /mnt
reboot
```
# Edit mirrorlist to USA only
# Enable multilib repo
# Install yay
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
# Restore package list
yay -S - < arch-packages-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment