Skip to content

Instantly share code, notes, and snippets.

@pathologicalhandwaving
Last active October 7, 2019 16:21
Show Gist options
  • Save pathologicalhandwaving/a4a01df28a8a1d6c1d9d043986ea5cee to your computer and use it in GitHub Desktop.
Save pathologicalhandwaving/a4a01df28a8a1d6c1d9d043986ea5cee to your computer and use it in GitHub Desktop.
Arch Linux Install -- Part I -- OS

Arch Linux Basic Install

Device Meta

File Integrity Signatures

MD5

1d6bdf5cbc6ca98c31f02d23e418dd96

SHA1
67cf5460beb42230a9c07fd6ebc136cbb1181948

Set Partitions

NOTE mklabel gpt erases the current partition table, i.e. your data gets wiped.

parted /dev/sda
(parted) mklabel gpt
(parted) mkpart primary fat32 1MiB 512MiB
(parted) set 1 esp on
(parted) set 1 boot on
(parted) mkpart primary ext2 512MiB 35.5GB 
(parted) mkpart primary linux-swap 35.5GB 40.5GB
(parted) mkpart primary ext4 40.5GB 100%
(parted) print
(parted) quit

Format Partitions

mkfs.vfat -F32 /dev/sda1
mkfs.ext2 /dev/sda2
mkfs.ext4 /dev/sda4
mkswap /dev/sda3
swapon /dev/sda3

NOTE You do not need to mount swap

Mount Partitions

mkdir /mnt/boot
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/sda1
mount /dev/sda2 /mnt
mount /dev/sda4 /mnt/home

NOTE Some people use /mnt/boot/efi or /mnt/efi, I just use /mnt/boot.

I’ve tried both the other ways a shit load of times and contrary to the documentation grub does not it would seem, automatically look for it in /boot/efi, it’s probably meant to but that has not been my experience. So I just use the boot directory and specify the flags when running grub-install given below.

Install Base Packages

NOTE If pacstrap returns 404 error change mirror list priority by moving a mirror to top of list

/etc/pacman.d/mirrorlist.

pacstrap /mnt base base-devel linux-headers grub-efi-x86_64 emacs git efibootmgr dialog wpa_supplicant intel-ucode 

NOTE Needed the linux-headers or linux-lts-headers for pdf-tools in Emacs.

Generate fstab

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

Enter New System

arch-chroot /mnt /bin/bash

Set Hostname

echo MYHOSTNAME > /etc/hostname

Set Locale

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

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

Set Root Password

passwd

Create User

useradd -m -g users -G wheel,storage,power -s /bin/bash MYUSERNAME
passwd MYUSERNAME

Regenerate initrd Image

mkinitcpio -p linux

Setup Grub

grub-install --bootloader-id=Arch_Linux --efi-directory=/boot/efi --recheck --target=x86_64-efi
grub-mkconfig -o /boot/grub/grub.cfg

Unmount Partitions and Reboot

exit
umount -R /mnt
reboot

If everything went well, this ends the basic installation OS phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment