Skip to content

Instantly share code, notes, and snippets.

@rossedman
Last active November 26, 2020 18:21
Show Gist options
  • Save rossedman/b4ca7707c2f6f2a87d4defe08474cdf3 to your computer and use it in GitHub Desktop.
Save rossedman/b4ca7707c2f6f2a87d4defe08474cdf3 to your computer and use it in GitHub Desktop.
Arch Linux Setup

Install Process

Boot from USB Arch Linux drive

Resources

Setup Partitions

This will setup the partitions for boot and root drives.

fdisk -l
fdisk /dev/sda

Run these commands in fdisk to setup a new boot partition and format to FAT12

n / p / enter / enter / +512M / t / 1

Run these commands to setup the root drive which will take up the rest of the disk

n / p / enter / enter / enter

Finally use w to write the partitions

Setup LVM

pvcreate /dev/sda2
vgcreate vg /dev/sda2
lvcreate -L 8G vg -n swap
lvcreate -L 32G vg -n root
lvcreate -l 100%FREE vg -n home
mkswap /dev/mapper/vg-swap
mkfs.ext4 /dev/mapper/vg-home
mkfs.ext4 /dev/mapper/vg-root
mount /dev/mapper/vg-root /mnt
mkdir -p /mnt/boot/efi /mnt/home
mount /dev/mapper/vg-home /mnt/home
mount /dev/sda1 /mnt/boot/efi

Setup Mirrors

This will update the mirrors and limit the mirrorlist to mirrors close to you

pacman -Syy
pacman -S reflector
reflector -c "US" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist

Install Arch Linux

This will install the base packages as well as generate the fstab file. Notice that lvm2 is included in this which is important.

pacstrap /mnt base linux-zen linux-firmware vim sudo lvm2
genfstab -U /mnt >> /mnt/etc/fstab

Configuration

Chroot into the /mnt directory

arch-chroot /mnt

Setup Timezone

timedatectl set-timezone America/Chicago

Setup Locale

Uncomment en_US.UTF-8 in /etc/locale.gen then run

locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8

Setup Hostname / Network

echo computer-name > /etc/hostname
touch /etc/hosts

Then add this to /etc/hosts

127.0.0.1	localhost
::1		localhost
127.0.1.1	myarch

Setup Users

passwd

Add user

useradd -m -g users -G wheel,games,power,optical,storage,scanner,lp,audio,video -s /bin/bash username
passwd username

Then uncomment the %wheel group using visudo

Configure Mkinitcpio

Configure mkinitcpio (vim /etc/mkinitcpio.conf) and ensure the configuration has these lines added to it or matching lines

HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard fsck)

Generate mkinitcpio

mkinitcpio -p linux-zen

Setup GRUB

pacman -S grub efibootmgr
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

Setup Xorg

pacman -S xorg xorg-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment