Arch Install
Objective
This file contains my notes for installing Arch Linux.
Installation
Make bootable ISO
I download the Arch iso and put it on a external hard drive with Ventoy setup
- go to arch page
- dl iso lul
WiFi
-
Look for you network adaper
1# displpay network adapter info 2ip link -
Use
iwctlto connect to your wireless access point1# config network with iwctl 2iwctl 3station $DEVICE scan 4station $DEVICE get-networks 5station $DEVICE connect $SSID
Create Partitons
- Partitions needed
| Partition | Mount Point | Size | |
|---|---|---|---|
| required | boot | /mnt/boot | 512MB |
| required | root | /mnt | 8GB+ |
| optional | home | /mnt/home | 1G+ |
-
I used
fdiskto complete this part.1# open disk up in fdisk 2fdisk /dev/sdX 3fdisk /dev/nvmeX 4fdisk $DEVICE -
fdiskoptions reference1# options 2o - blank out partition table 3g - setup gpt scheme 4n - new partition 5t - change type 6w - write to partition table -
If you want to use LVM, you will need to create the partitions
Encryption
After you are done partitioning your disks, you can encrypt your devices. Encrypt before pv/vg/lv creation and filesystem creation
1import os
2
3data = 1 + 1
4
5print(data)
-
Use
cryptsetupto encrypt devices1# encrypt partition 2cryptsetup luksFormat -v -s 512 -h SHA512 $DEVICE 3cryptsetup luksFormat /dev/sdX1 4 5# unlock encrypted partition 6cryptsetup open --type luks /dev/sdX1 lv_home
LVM
- Setup LVM on partitions after encryption
Create Filesystems
-
Root Filesystem (/)
1# create ext4 filesystem 2mkfs.ext4 $DEVICE 3mkfs.ext4 /dev/sdX 4 5# create btrfs filesystem 6mkfs.btrfs -L archlinux $DEVICE -
boot partition (/boot)
1# create vfat partition 2mkfs.vfat -F32 $DEVICE 3mkfs.vfat -F32 /dev/sdX1 -
Optional: home partition (/home)
btrfs
- Create btrfs
- Create btrfs root subvolume volume
- Create btrfs home subvolume
1# create btrfs filesystem
2mkfs.btrfs -L archlinux $DEVICE
3
4# mount btrfs filesystem
5
6# create subvolumes
7cd /mnt
8btrfs subvolume create @
9btrfs subvolume create @home
Note
- seems that you need to mount btrfs fillsystem at the device level first. anytime you decide to go back and create another subvolume (ie. swap) you will need to
- unmount the device before mounting the subolvumes
Mount filesystems
- Mount root filesystem to /mnt
- Mount the EFI System Partition (esp)
- mkdir /mnt/boot
- mount esp to /mnt/boot
- Mount home partition
1sudo mount -o noatime,compress=zstd:1,space_cache=v2,discard=async,subvol=@swap /dev/mapper/luks /
2sudo mount -o noatime,compress=zstd:1,space_cache=v2,discard=async,subvol=@swap /dev/mapper/luks /home
Generate fstab
- Sanity check
1# generate fstab
2genfstab -U -p /mnt >> /mnt/etc/fstab
Setup Mirrors
- Edit /etc/pacman.d/mirrorlist
- Top 6 mirrors will be used to intall system
Pacstrap
- Its a good idea to install some important software at this time.
1# pacstrap and install packages
2pacstrap /mnt base base-devel linux linux-headers linux-firmware vim \
3 networkmanager grub efibootmgr mtools osprober dosfstools git \
4 make python sudo fakeroot man-db man-pages dialog netctl \
5 lvm2
Chroot
1arch-chroot /mnt
mkinitcpio
- edit /etc/mkinitcpio
1HOOKS=(. . . block encrypt lvm2 filesystems btrfs . . .) run
- run mkinitcpio
1mkinitcpio -p linux
Set locale
1# edit config file
2vim /etc/locale.gen
3
4# generate local
5locale-gen
Set timezone
1# link your localtime
2ln -s /usr/share/zoneinfo/*/* /etc/localtime
3
4# sync system to hardware clock
5hwclock --systohc --utc
Networking
- Enable NetworkManager.service
- Start service
- nmtui to set up wifi or manage connections
Update
Create users and groups and set passwords
- Set root password
- Add your User
1useradd -m -g users -G wheel \<user>
- change password
- visudo and edit the sudoer file to let users in the group wheel be able to execute with root priveleges
- Add your user to group wheel
Bootloader
systemd loader
grub
-
Encryption
- /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT=“loglevl=3 cryptdevice=<dev>:<vg>:allow-discards queit”
-
enable corectrl to get full control of amdgpu
GRUB_CMDLINE_LINUX_DEFAULT="<other_params>… amdgpu.ppfeaturemask=0xffffffff"
-
Install groub to esp
1grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
-
mkdir /boot/grub/locale
-
Generate configuration
1grub-mkconfig -o /boot/grub/grub.cfg
Optional: Create Swap File
btrfs swap
1# create swap subvolume
2mount $MAPPER /mnt
3btrfs subvolume create /mnt/@swap
4umount /mnt
5
6# create swapfile
7btrfs filesystem mkswapfile --size 4g --uuid clear /swap/swapfile
8
9# turn on swap
10swapon /swap/swapfile
11
12# fstab
13/swap/swapfile none swap defaults 0 0
Graphical Enviroment
- Install xorg
- Install DE or Display Manager + Window Manager
- Configure