Skip to content

Instantly share code, notes, and snippets.

@luigiMinardi
Created August 3, 2023 13:58
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 luigiMinardi/13a71de0c518b1e5ba34542d7b3c09a1 to your computer and use it in GitHub Desktop.
Save luigiMinardi/13a71de0c518b1e5ba34542d7b3c09a1 to your computer and use it in GitHub Desktop.
HOWTO - Booting arch

How to boot arch with btrfs and i3wm

ISO

First download arch iso and make sure to have a spare pendrive to format as a bootable one. If you like distro hopping a lot Ventoy may be a good option instead of using other ways to put just the arch iso in the pendrive. Even more if you have a larger pendrive than the at most 4gb needed for any linux distro.

After changing the boot order to the pendrive first and booting into it choose Arch Linux Install Medium to start.

Ping

Now check your internet with ping gnu.org. If you have wifi read the man.

Time

Set your time right with timedatectl set-ntp true.

Partitioning

lsblk to check which device you'll install arch.

cfdisk /dev/nvme0n1 (replace nvme0n1 to whatever your case) to open the disk partitioning tool.

create a boot partition, I like to have spare space if I want to custom it a little so I go with 512M, but 128M is more than enought for grub.

Set the boot partition as type > BIOS boot, create another partition with all the rest of the space, the type will be Linux Filesystem, this will be the partition for your system.

Write, yes, quit.

MKFS

mkfs.fat -F32 /dev/nvme0n1p1 for the first partition (the boot one)

mkfs.btrfs /dev/nvme0n1p2 for the system one.

Timeshift

I use timeshift so I wont create any btrfs subvolume since this will be managed by timeshift.

Mount the system

Mount the main system mount /dev/nvme0n1p2 /mnt Create the boot folder mkdir /mnt/boot And the efi folder mkdir /mnt/boot/efi Mount the boot partition mount /dev/nvme0n1p1 /mnt/boot for efi change the last to /mnt/boot/efi

lsblk to check if you mounted right.

Pacstrap

pacstrap /mnt base base-devel linux linux-firmware vim intel-ucode btrfs-progs

Those are the basic packages that you'll need for your system. If you are on amd change intel for amd-ucode

Generate fstab with your drivers

Generate your fstab that will contain your drivers genfstab -U /mnt >> /mnt/etc/fstab

Enter your system - chroot

Enter your system to install some other necessary things arch-chroot /mnt /bin/bash

install packages

Install the packages pacman -S networkmanager grub grub-btrfs efibootmgr os-prober

networkmanager to have internet access grub as your bootloader grub-btrfs for show your snapshots on grub efibootmgr needed to do a propper grub-install os-prober needed if you'll use VM's later

Enable network

Enable the network systemctl enable NetworkManager

Configure grub

Configure grub on your entire drive grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB

Generate grub mkconfig

Generate your configuration file grub-mkconfig -o /boot/grub/grub.cfg If the response don't show "found linux image..." and "found initrd image..." you need to re-run the pacstrap command. To do so, exit the current environment and run the pacstrap command again, then arch-chroot again.

Create root password

create a password for your root user with passwd

Select your language

Select the language you want with vim /etc/locale.gen and uncommenting the language you want (e.g en_US UTF-8 and en_US ISO)

Generate the locale locale-gen

Create the config of your locale vim /etc/locale.conf and write LANG=en-US.UTF-8 or whatever language that you want.

Create your hostname

Create your hostname with vim /etc/hostname and typing the name that you want. It's what appears on bash when you're writting after the @ so user@hostname

Select your timezone

Set your timezone with ln -sf /usr/share/zoneinfo/ then tab to your region and city so for example if you're in UK you can do /usr/share/zoneinfo/Europe/London then /etc/localtime The complete command is ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

Leave the shell

exit and umount -R /mnt to leave the root shell and remove the mounting points

Reboot

reboot and good luck.

If for some reason after rebooting Arch doesn't show on grub, return to your arch-chroot environment Then reinstall linux and grub with pacman, rerun the grub-install command, reconfigure grub, run mkinitcpio -P, recofigure grub again.

Create your users

useradd -mg wheel username

this creates a user with username, his home directory and adds it to the group wheel.

the -g is to add to groups and -m to create its home directory.

create the user password with passwd username

give your user sudo access:

vim /etc/sudoers do /wheel to find the wheel config on the file. Uncomment the line saying "%wheel ALL=(ALL) ALL" or something simmilar.

log into your user by typing exit and enter your username and password.

Extra

Useful pacman config:

sudo vim /etc/pacman.conf Under # Misc options uncomment Color to add colors, VerbosePkgLists to add more info when updating package, ParallelDownloads = 5 (or more, you set the number), to download packages in paralel, CheckSpace, if you don't have much space and want to check if you have enough before installing a pkg, add ILoveCandy to have pacman as your progress bar. Under # REPOSITORIES uncomment [multilib] and the Include = /etc/pacman.d/mirrorlist right below it.

Other useful sources

Arch installation guide nishantnadkarni arch install with btrfs

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