Hi all, in this video i will show how to full install Arch Linux with BTRFS filesystem.

  1. The boot mode will be EFI.
  2. I’m assuming you already have the usb stick with the Arch Linux ISO.
  3. My internet is wired, so if you have wireless network, please go to the website that is in the description of this video and see the link to properly configure your network.
  4. Kde Plasma will be Desktop Environment in this case.

I hope you enjoy!

Links

  1. Download the latest Arch Linux ISO
  2. Btrfs Mount Options
  3. Connect to the Internet - Arch Linux Wiki
  4. Kde - Arch Linux Wiki
  5. snapper-gui
  6. Yay

1. Pre-Install

1.1 Set Keymap (Optional)

Default keymap is US which will fit most keyboards. However if you have a different keymap you can set it using this command.

If you are not sure which keymap you have, you can list all keymaps with:

$ localectl list-keymaps 
$ loadkeys [keymap]

1.2 Set Time

$ timedatectl set-ntp true

1.3 Reflector

This command is optional. However, it considerably increases the speed for downloading packages on the internet during installation.

You need change to your country and to a country closer to your.

I am live in Brazil, so first i choose Brazil and after i put Colombia because closer.

To a list with countries type: reflector list-countries

$ reflector --country Brazil,Colombia -f 12 -l 10 -n 12 \
--save /etc/pacman.d/mirrorlist --verbose
$ pacman -Syy

1.3 Partitioning the Disk

I will create 3 partitions.

The scheme.

Folow the video…

$ fdisk /dev/[device]

1.4 Formatting

use mkfs.btrfs, mkfs.fat and mkswap.

$ mkfs.fat -F32 /dev/sda1
$ mkswap /dev/sda2
$ mkfs.btrs /dev/sda3

1.5 Creating Subvolumes and Mounting

First i mount /dev/sda3 and create subvolumes. After umount and mount this partition with every subvolumes created.

$ mount /dev/sda3 /mnt
$
$ btrfs su cr /mnt/@
$ btrfs su cr /mnt/@home
$ btrfs su cr /mnt/@var
$ btrfs su cr /mnt/@tmp
$ btrfs su cr /mnt/@snapshots
$
$ umount /mnt
$ mount -o noatime,compress=lzo,space_cache=v2,\
subvol=@ /dev/sda3 /mnt
$ mkdir -p /mnt/{boot/efi,home,var, tmp,.snapshots}

Home

$ mount -o noatime,compress=lzo,space_cache=v2,\
subvol=@home /dev/sda3 /mnt/home

var

$ mount -o subvol=@var /dev/sda3 /mnt/var

tmp

$ mount -o noatime,compress=lzo,space_cache=v2,\
subvol=@home /dev/sda3 /mnt/home

Snapshots

$ mount -o noatime,compress=lzo,space_cache=v2,\
subvol=@snapshots /dev/sda3 /mnt/.snapshots

EFI

$ mount /dev/sda1 /mnt/boot/efi

Swap

$ swapon /dev/sda2
$ lsblk

2. Install

Take a look at the site in the description you need to add a package in this command. It will depend on the brand of your processor (AMD or Intel)

  • For Intel Processor add intel-ucode package;
  • For AMD Processor add amd-ucode package;

Press enter twice…

$ pacstrap /mnt base base-devel linux \
linux-firmware vim btrfs-progs \
networkmanager network-manager-applet \
grub grub-btrfs efibootmgr linux-headers \
reflector rsync mtools net-tools os-prober dosfstools \
git snapper xdg-user-dirs

Press enter twice here..

3. Config the System

3.1 Generate fstab

$ genfstab -U /mnt >> /mnt/etc/fstab 
$ cat /mnt/etc/fstab

3.2 Chroot

$  arch-chroot /mnt 

3.3 Timezone

You can list all timezones with:

$ timedatectl list-timezones

Replace region and city with your own timezone.

$ ln -sf /usr/share/zoneinfo/Region/City /etc/localtime  
$ hwclock --systohc

3.4 Localization

Edit /etc/locale.gen and uncomment your locale. After, generate the locales by running:

$ locale-gen

Create the /etc/locale.conf and set the LANG variable:

LANG=en_US.UTF-8   

If you changed your keymap in first step, you need to add it here also: Create /etc/vconsole.conf with your keyboard layout:

KEYMAP=[keymap]

3.5 Network Config

Create /etc/hostname with the name your host:

nameFromYourHost   

Create /etc/hosts:

127.0.0.1   localhost
::1         localhost
127.0.0.1   nameFromYourHost.localdomain nameFromYourHost   

Enable Network Manager

$ systemctl enable NetworkManager  

3.6 Add btrfs module to mkinitcpio

$ vim /etc/mkinitcpio.conf
$ mkinitcpio -p linux

And add btrfs on Modules list. remove fsck on line . If you dont remove your efi partition you be corrupted because btrfs.

3.7 Install GRUB

$ grub-install --target=x86_64-efi \
--efi-directory=/boot/efi \
--bootloader-id=GRUB

$ grub-mkconfig -o \
/boot/grub/grub.cfg  

3.8 Set the root Password

$ passwd  

3.9 Exit, Umount and Reboot

$ exit
$ umount -a
$ reboot  

4. Post-Install

4.1 Create a New User

$ useradd -m -G wheel yourUsername
$ passwd yourUsername  
$ export EDITOR=vim

Edit /etc/sudoers run “visudo” and uncomment the following line:

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL   
$ exit

4.2 Install xorg

$ sudo pacman -S xorg  

##4.2 Install the Display Manager

$ sudo pacman -S sddm
$ sudo systemctl enable sddm

4.3 Install Kde Plasma

I only press enter to confirm every dialogs. Be patient!

$ sudo pacman -S plasma kde-applications firefox

4.4 Reboot

$ reboot  

5. Snapper

You need remove this directory because snapper will create again.

$ su
$ umount .snapshots
$ rm -rf /.snapshots
$ snapper -c root create-config /
$ btrfs subvolume delete /.snapshots
$ mkdir /.snapshots
$ mount -a
$ chmod 750 /.snapshots/
$ chmod a+rx /.snapshots
$ chown :duckchannel /.snapshots
$ vim /etc/snapper/configs/root

And put your username in:

ALLOW_USERS="[yourusername]"

Change the folowing lines to:

TIMELINE_LIMIT_HOURLY="5"
TIMELINE_LIMIT_DAYLY="7"
TIMELINE_LIMIT_WEEKLY="0"
TIMELINE_LIMIT_MONTHLY="0"
TIMELINE_LIMIT-YEARLY="0"

See the site in description to get this git URL address.

$ systemctl enable --now snapper-timeline.timer
$ systemctl enable --now snapper-cleanup.timer
$ exit
$ 
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si
$ yay -Syu
$ yay -S snap-pac-grub snapper-gui
$ reboot

Make Grub-Btrfs Show Snapshots

$ sudo systemctl enable --now grub-btrfs.path

Create one new Snapshot with snapper-gui

6. Finish