Forked from mjkstra/arch_linux_installation_guide.md
Last active
July 13, 2025 11:21
-
-
Save amorellg/6a33b37b40273896c45b8a28cae511c1 to your computer and use it in GitHub Desktop.
Revisions
-
amorellg revised this gist
Jul 13, 2025 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -386,7 +386,7 @@ swapon UUID=$(lsblk -o UUID /dev/nvme0n1p3 | grep -v UUID) # "openssh" to use ssh and manage keys # "man" for manual pages # "sudo" to run commands as other users pacstrap -K /mnt base base-devel linux linux-firmware git btrfs-progs grub efibootmgr grub-btrfs vim networkmanager pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber reflector zsh zsh-completions zsh-autosuggestions openssh man man-db man-pages texinfo fastfetch sudo snapper snap-pac btop ``` <br> @@ -581,6 +581,17 @@ nmcli device wifi connect <SSID> password <password> <br> ## Configure makepkg multithread support ```Zsh # Open the makepkf configuration file sudo vim /etc/makepkg.conf # Change the MAKEFLAGS to MAKEFLAGS="-j$(nproc)" ``` <br> ## Configuring AUR and Snapper Integration with GRUB and Pacman Since we will need AUR helpers eventually to install other AUR packages, including snap-pac-grub, which provides pacman hooks to include snapshots in the GRUB menu, we will enable a pacman wrapper that supports the AUR -- paru and yay. Yay has a CLI, but if you later want to have an aur helper with a GUI you can install [`pamac`](https://gitlab.manjaro.org/applications/pamac) \( a Manjaro software, so use at your own risk \), **however** note that front\-ends like `pamac` and also any store \( KDE discovery, Ubuntu store etc. \) are not officially supported and should be avoided, because of the high risk of performing [partial upgrades](https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported). This is also why later when installing KDE, I will exclude the KDE discovery store from the list of packages. -
amorellg revised this gist
Jul 13, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -597,7 +597,7 @@ mkdir AUR cd AUR # Install yay git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -sic # If you want to install paru cd ../AUR @@ -636,7 +636,7 @@ sudo systemctl enable fstrim.timer # Enable Periodic Execution of btrfs scrub ```Zsh systemd-escape --template [email protected] --path /dev/nvme0n1p2 btrfs-scrub@dev-nvme0n1p2 # Enable the timer using the unit file name as determined above: sudo systemctl enable [email protected] -
amorellg revised this gist
Jul 13, 2025 . 1 changed file with 23 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -505,19 +505,24 @@ mount -a # Adjust permissions of /.snapshots chmod 750 /.snapshots ``` <br> ## Grub configuration Now I'll [deploy grub](https://wiki.archlinux.org/title/GRUB#Installation) ```Zsh # Install the GRUB firmware bootloader on the ESP. grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=ARCH-B --modules="normal test efi_gop efi_uga search echo linux all_video gfxmenu gfxterm_background gfxterm_menu gfxterm loadenv configfile gzio part_gpt btrfs" ``` <br> Generate the grub configuration ( it will include the microcode installed with pacstrap earlier ) ```Zsh grub-mkconfig -o /boot/grub/grub.cfg ``` <br> ## Root and users @@ -544,24 +549,6 @@ EDITOR=vim visudo <br> ## Unmount everything and reboot ```Zsh @@ -585,6 +572,10 @@ timedatectl set-ntp true # Enable NetworkManager and configure wifi sudo systemctl enable --now NetworkManager.service # To configure the WiFi password you can use nmtui # Or nmcli device wifi connect <SSID> password <password> ``` @@ -605,6 +596,12 @@ mkdir AUR # Change to the new directory. cd AUR # Install yay git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si # If you want to install paru cd ../AUR # Clone the repository. git clone https://aur.archlinux.org/paru.git @@ -614,14 +611,15 @@ cd paru # Use makepkg to build the package and install it. makepkg -sic ``` # Enable Snapshots in GRUB Menu ```Zsh # Install snap-pac-grub with yay -S snap-pac-grub # Or paru -Sa snap-pac-grub ``` -
amorellg revised this gist
Jul 5, 2025 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -793,7 +793,7 @@ Installation looks almost identical to the AMD one, but every time a package con ```Zsh # Create a new manual snapshot of the system at a state before making changes for the test. sudo snapper -v -c root create -t single -d "<description>" # Verify the snapshot was created. sudo snapper list @@ -802,8 +802,8 @@ sudo snapper list After making changes to the system: ```Zsh # Rollback to the desired snapshot sudo snapper -c root -v rollback -d "<description>" <number> # Update GRUB grub-mkconfig -o /boot/grub/grub.cfg -
amorellg revised this gist
Jul 5, 2025 . 1 changed file with 29 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -789,6 +789,35 @@ Installation looks almost identical to the AMD one, but every time a package con <br> # Rollback methods ```Zsh # Create a new manual snapshot of the system at a state before making changes for the test. sudo snapper -v -c root create -t single -d "description" # Verify the snapshot was created. sudo snapper list ``` After making changes to the system: ```Zsh # Rollback from the active snapshot sudo snapper -c root -v rollback -d "description" <number> # Update GRUB grub-mkconfig -o /boot/grub/grub.cfg # Reboot and select rollback snapshot in GRUB. # Update GRUB again grub-mkconfig -o /boot/grub/grub.cfg # Reboot into the new default ``` <br> # Setting up a graphical environment I'll provide 2 options: -
amorellg revised this gist
Jul 4, 2025 . 1 changed file with 8 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -592,9 +592,11 @@ nmcli device wifi connect <SSID> password <password> ## Configuring AUR and Snapper Integration with GRUB and Pacman Since we will need AUR helpers eventually to install other AUR packages, including snap-pac-grub, which provides pacman hooks to include snapshots in the GRUB menu, we will enable a pacman wrapper that supports the AUR -- paru and yay. Yay has a CLI, but if you later want to have an aur helper with a GUI you can install [`pamac`](https://gitlab.manjaro.org/applications/pamac) \( a Manjaro software, so use at your own risk \), **however** note that front\-ends like `pamac` and also any store \( KDE discovery, Ubuntu store etc. \) are not officially supported and should be avoided, because of the high risk of performing [partial upgrades](https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported). This is also why later when installing KDE, I will exclude the KDE discovery store from the list of packages. To learn more about yay read [here](https://github.com/Jguer/yay#yay) > Note: you can't execute makepkg as root, so you need to log in your main account. For me it's mjkstra ```Zsh # Create a directory for AUR packages. @@ -611,6 +613,10 @@ cd paru # Use makepkg to build the package and install it. makepkg -sic # Install yay cd ../AUR sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si ``` # Enable Snapshots in GRUB Menu @@ -704,26 +710,6 @@ systemctl enable vboxservice.service <br> ## Finalization ```Zsh -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 18 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -663,6 +663,24 @@ TIMELINE_LIMIT_MONTHLY="10" to TIMELINE_LIMIT_MONTHLY="3" TIMELINE_LIMIT_YEARLY="10" to TIMELINE_LIMIT_YEARLY="0" # Enable timeline snapshots timer. sudo systemctl enable snapper-timeline.timer # Start the timeline snapshots timer. sudo systemctl start snapper-timeline.timer # Enable the timeline cleanup algorithm based on the "TIMELINE_LIMIT_XXXX" settings in the configuration. sudo systemctl enable snapper-cleanup.timer # Start the timeline cleanup timer. sudo systemctl start snapper-cleanup.timer ``` # Delete Subvolumes Created by systemd for VMs and Containers ```Zsh sudo btrfs subvolume delete /.snapshots/1/snapshot/var/lib/portables sudo btrfs subvolume delete /.snapshots/1/snapshot/var/lib/machines ``` <br> -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 69 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -583,25 +583,86 @@ reboot timedatectl set-ntp true # Enable NetworkManager and configure wifi sudo systemctl enable --now NetworkManager.service nmcli device wifi connect <SSID> password <password> ``` <br> ## Configuring AUR and Snapper Integration with GRUB and Pacman # Enable AUR Helper Since we will need AUR helpers eventually to install other AUR packages, including snap-pac-grub, which provides pacman hooks to include snapshots in the GRUB menu, we will enable a pacman wrapper that supports the AUR -- paru. ```Zsh # Create a directory for AUR packages. mkdir AUR # Change to the new directory. cd AUR # Clone the repository. git clone https://aur.archlinux.org/paru.git # Change to the created directory. cd paru # Use makepkg to build the package and install it. makepkg -sic ``` # Enable Snapshots in GRUB Menu ```Zsh # Install snap-pac-grub with paru -Sa snap-pac-grub ``` <br> ## Final Configuration # Enable Periodic Execution of TRIM ```Zsh sudo systemctl enable fstrim.timer ``` # Enable Periodic Execution of btrfs scrub ```Zsh systemd-escape --template [email protected] --path /dev/nvme0n1p2 [email protected] # Enable the timer using the unit file name as determined above: sudo systemctl enable [email protected] # Start the timer. sudo systemctl start [email protected] ``` <br> ## Edit Snapper Configuration ```Zsh # vim /etc/snapper/configs/root # Change NUMBER_LIMIT="50" to NUMBER_LIMIT="10-35" NUMBER_LIMIT_IMPORTANT="50" to NUMBER_LIMIT_IMPORTANT="15-25" TIMELINE_LIMIT_HOURLY="10" to TIMELINE_LIMIT_HOURLY="5" TIMELINE_LIMIT_DAILY="10" to TIMELINE_LIMIT_DAILY="5" TIMELINE_LIMIT_WEEKLY="0" to TIMELINE_LIMIT_WEEKLY="2" TIMELINE_LIMIT_MONTHLY="10" to TIMELINE_LIMIT_MONTHLY="3" TIMELINE_LIMIT_YEARLY="10" to TIMELINE_LIMIT_YEARLY="0" ``` <br> -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 26 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -490,7 +490,32 @@ umount /.snapshots # Remove the directory that was the mountpoint of the @/.snapshots subvolume. Removing the directory does not delete the subvolume since it was unmounted in the last command. rm -r /.snapshots # Issue the Snapper command to initialize a configuration named root for a subvolume mounted at /. snapper --no-dbus -c root create-config / # Delete the subvolume automatically created by snapper. btrfs subvolume delete /.snapshots # Remake the directory for mounting our snapshots subvolume. mkdir /.snapshots # Remount our snapshots subvolume with mount -a which remounts all filesystems specified in /etc/fstab mount -a # Adjust permissions of /.snapshots chmod 750 /.snapshots ``` <br> ## Install Bootloader ```Zsh # Install the GRUB firmware bootloader on the ESP. grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=ARCH-B --modules="normal test efi_gop efi_uga search echo linux all_video gfxmenu gfxterm_background gfxterm_menu gfxterm loadenv configfile gzio part_gpt btrfs" # Update the GRUB configuration. grub-mkconfig -o /boot/grub/grub.cfg ``` <br> -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -201,7 +201,7 @@ mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) /mnt btrfs subvolume create /mnt/@ # Create the subvolume for /home. btrfs subvolume create /mnt/@/home # Create a subvolume for snapshots named /.snapshots with the path /@/.snapshots. btrfs subvolume create /mnt/@/.snapshots @@ -284,7 +284,7 @@ mkdir /mnt/.snapshots # Make a mount point for the @/boot/grub subvolume. mkdir -p /mnt/boot/grub # Make a mount point for the @/home subvolume. mkdir /mnt/home # Make a mount point for the @/opt subvolume. @@ -321,7 +321,7 @@ mkdir /mnt/efi mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/.snapshots,compress=zstd /mnt/.snapshots # Mount the @home subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/home,compress=zstd /mnt/home # Mount the @/boot/grub subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/boot/grub,compress=zstd /mnt/boot/grub -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -185,9 +185,6 @@ lsblk -o UUID /dev/nvme0n1p1 | grep -v UUID # Get the UUID of swap partition. lsblk -o UUID /dev/nvme0n1p3 | grep -v UUID ``` <br> -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 0 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -363,18 +363,6 @@ mount UUID=$(lsblk -o UUID /dev/nvme0n1p1 | grep -v UUID) /mnt/efi swapon UUID=$(lsblk -o UUID /dev/nvme0n1p3 | grep -v UUID) ``` <br> ## Packages installation -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -496,6 +496,20 @@ vim /etc/hosts <br> ## Initialize Snapper ```Zsh # Umount the @/.snapshots subvolume from /.snapshots. umount /.snapshots # Remove the directory that was the mountpoint of the @/.snapshots subvolume. Removing the directory does not delete the subvolume since it was unmounted in the last command. rm -r /.snapshots # ``` <br> ## Root and users ```Zsh -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -486,7 +486,7 @@ Write the following ip, hostname pairs inside /etc/hosts, replacing `Arch` with ``` 127.0.0.1 localhost ::1 localhost 127.0.1.1 Arch.localdomain Arch ``` ```Zsh -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 1 addition and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -377,26 +377,6 @@ umount /mnt <br> ## Packages installation ```Zsh @@ -408,7 +388,6 @@ mount /dev/nvme0n1p1 /mnt/efi # "grub" the bootloader # "efibootmgr" needed to install grub # "grub-btrfs" adds btrfs support for the grub bootloader and enables the user to directly boot from snapshots # "timeshift" a GUI app to easily create,plan and restore snapshots using BTRFS capabilities # "amd-ucode" microcode updates for the cpu. If you have an intel one use "intel-ucode" # "vim" my goto editor, if unfamiliar use nano @@ -422,7 +401,7 @@ mount /dev/nvme0n1p1 /mnt/efi # "openssh" to use ssh and manage keys # "man" for manual pages # "sudo" to run commands as other users pacstrap -K /mnt base base-devel linux linux-firmware git btrfs-progs grub efibootmgr grub-btrfs vim networkmanager pipewire pipewire-alsa pipewire-pulse pipewire-jack wireplumber reflector zsh zsh-completions zsh-autosuggestions openssh man man-db man-pages texinfo fastfetch sudo snapper snap-pac ``` <br> -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 9 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -203,6 +203,9 @@ mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) /mnt # Make the @ subvolume. btrfs subvolume create /mnt/@ # Create the subvolume for /home. btrfs subvolume create /mnt/@home # Create a subvolume for snapshots named /.snapshots with the path /@/.snapshots. btrfs subvolume create /mnt/@/.snapshots @@ -284,6 +287,9 @@ mkdir /mnt/.snapshots # Make a mount point for the @/boot/grub subvolume. mkdir -p /mnt/boot/grub # Make a mount point for the @home subvolume. mkdir /mnt/home # Make a mount point for the @/opt subvolume. mkdir /mnt/opt @@ -314,12 +320,12 @@ mkdir /mnt/var/tmp # Make a mountpoint for the ESP (EFI System Partition). mkdir /mnt/efi # We now mount the subvolumes to the mount points. Mount the @/.snapshots subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/.snapshots,compress=zstd /mnt/.snapshots # Mount the @home subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@home,compress=zstd /mnt/home # Mount the @/boot/grub subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/boot/grub,compress=zstd /mnt/boot/grub @@ -355,10 +361,6 @@ mount UUID=$(lsblk -o UUID /dev/nvme0n1p1 | grep -v UUID) /mnt/efi # Activate the swap partition. swapon UUID=$(lsblk -o UUID /dev/nvme0n1p3 | grep -v UUID) ``` I will lay down the subvolumes on a **flat** layout, which is overall superior in my opinion and less constrained than a **nested** one. What's the difference ? If you're interested [this section of the old sysadmin guide](https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Layout) explains it. -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -314,7 +314,7 @@ mkdir /mnt/var/tmp # Make a mountpoint for the ESP (EFI System Partition). mkdir /mnt/efi # Make a folder for /home. mkdir /mnt/home # We now mount the subvolumes to the mount points. Mount the @/.snapshots subvolume. -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 25 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -333,7 +333,32 @@ mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/root,compr mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/srv,compress=zstd /mnt/srv # Mount the @/tmp subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/tmp,compress=zstd /mnt/tmp # Mount the @/usr/local subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/usr/local,compress=zstd /mnt/usr/local # Mount the @/var/cache subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/var/cache,nodatacow /mnt/var/cache # Mount the @/var/log subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/var/log,nodatacow /mnt/var/log # Mount the @/var/spool subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/var/spool,nodatacow /mnt/var/spool # Mount the @/var/tmp subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/var/tmp,nodatacow /mnt/var/tmp # Mount the ESP partition. mount UUID=$(lsblk -o UUID /dev/nvme0n1p1 | grep -v UUID) /mnt/efi # Activate the swap partition. swapon UUID=$(lsblk -o UUID /dev/nvme0n1p3 | grep -v UUID) # Create the subvolume for /home and mount it. btrfs subvolume create /mnt/@home mount -o compress=zstd,subvol=@home /dev/nvme0n1p2 /mnt/home ``` I will lay down the subvolumes on a **flat** layout, which is overall superior in my opinion and less constrained than a **nested** one. What's the difference ? If you're interested [this section of the old sysadmin guide](https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Layout) explains it. -
amorellg revised this gist
Jul 3, 2025 . 1 changed file with 152 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -175,7 +175,16 @@ For the file system I've chosen [**BTRFS**](https://wiki.archlinux.org/title/Btr mkfs.fat -F 32 /dev/nvme0n1p1 # Find the root partition. For me it's /dev/nvme0n1p2 and format it. I will use BTRFS. mkfs.btrfs -L ARCH -f -n 32k /dev/nvme0n1p2 # Format the swap partition mkswap /dev/nvme0n1p3 # Get the UUID of the ESP of the computer. lsblk -o UUID /dev/nvme0n1p1 | grep -v UUID # Get the UUID of swap partition. lsblk -o UUID /dev/nvme0n1p3 | grep -v UUID # Mount the root fs to make it accessible mount /dev/nvme0n1p2 /mnt @@ -185,6 +194,148 @@ mount /dev/nvme0n1p2 /mnt ## Disk mounting The creation of the subvolumes is based on [https://www.ordinatechnic.com/distribution-specific-guides/Arch/an-arch-linux-installation-on-a-btrfs-filesystem-with-snapper-for-system-snapshots-and-rollbacks](https://www.ordinatechnic.com/distribution-specific-guides/Arch/an-arch-linux-installation-on-a-btrfs-filesystem-with-snapper-for-system-snapshots-and-rollbacks). ```Zsh # Mount the newly created Btrfs filesystem. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) /mnt # Make the @ subvolume. btrfs subvolume create /mnt/@ # Create a subvolume for snapshots named /.snapshots with the path /@/.snapshots. btrfs subvolume create /mnt/@/.snapshots # Create a subvolume for the initial snapshot which will be the target of the installation. mkdir /mnt/@/.snapshots/1 btrfs subvolume create /mnt/@/.snapshots/1/snapshot # Create a subvolume for the filesystem hierarchy in and under /boot/grub/. mkdir /mnt/@/boot btrfs subvolume create /mnt/@/boot/grub # Create the /@/opt subvolume for the filesystem hierarchy under /opt. btrfs subvolume create /mnt/@/opt # Create the /@/root subvolume for the filesystem hierarchy under /root. btrfs subvolume create /mnt/@/root # Create the /@/srv subvolume for the filesystem hierarchy under /srv. btrfs subvolume create /mnt/@/srv # Create the /@/tmp subvolume for the filesystem hierarchy under /tmp. btrfs subvolume create /mnt/@/tmp # Create a subvolume for filesystem hierarchy in and under /usr/local. mkdir /mnt/@/usr btrfs subvolume create /mnt/@/usr/local # Create the /@/var/cache subvolume for filesystem hierarchy in and under /var/cache. mkdir /mnt/@/var btrfs subvolume create /mnt/@/var/cache # Create the /@/var/log subvolume for filesystem hierarchy in and under /var/log. btrfs subvolume create /mnt/@/var/log # Create the /@/var/spool subvolume for filesystem hierarchy in and under /var/spool btrfs subvolume create /mnt/@/var/spool # Create the /@/var/tmp subvolume for filesystem hierarchy in and under /var/tmp. btrfs subvolume create /mnt/@/var/tmp ``` Snapper stores metadata for each snapshot in the snapshot's directory /@/.snapshots/# where "#" represents the snapshot number in an .xml file. For our initial snapshot this will be /@/.snapshots/1 One of the metadata items is the snapshot creation time, in the format YYYY-MM-DD HH:MM:SS. ```Zsh # The current date and time string in the appropriate format can be obtained with the command: date +"%Y-%m-%d %H:%M:%S" # Create the metadata required by Snapperfor the initial installation snapshot. vim /mnt/@/.snapshots/1/info.xml # Add the following, replacing 2021-09-23 21:56:17 with your current time and date string. <?xml version="1.0"?> <snapshot> <type>single</type> <num>1</num> <date>2021-09-23 21:56:17</date> <description>First Root Filesystem Created at Installation</description> </snapshot> # Make the initial snapshot subvolume, /@/mnt/.snapshots/1/snapshot, the default subvolume. btrfs subvolume set-default $(btrfs subvolume list /mnt | grep "@/.snapshots/1/snapshot" | grep -oP '(?<=ID )[0-9]+') /mnt # Disable copy-on-write for the /@/var subvolumes this will require the nodatacow mount option, which will disable compression for these subvolumes. chattr +C /mnt/@/var/cache chattr +C /mnt/@/var/log chattr +C /mnt/@/var/spool chattr +C /mnt/@/var/tmp # Unmount the Btrfs filesystem. umount /mnt # Mount the Btrfs filesystem again. Unlike the previous time, when we mount it this time, since we have set the default subvolume, the subvolume attached to /mnt will be the subvolume @/.snapshots/1/snapshot with a subvolume ID of 258 and not the main subvolume with a subvolume ID of 5. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o compress=zstd /mnt # We need to make mountpoints for the subvolumes to be mounted at hierarchy locations under / for our installation process and for when this subvolume (subvolid=258) is mounted at / in our installed system. # Make a mount point for the @/.snapshots subvolume. mkdir /mnt/.snapshots # Make a mount point for the @/boot/grub subvolume. mkdir -p /mnt/boot/grub # Make a mount point for the @/opt subvolume. mkdir /mnt/opt # Make a mount point for the @/root subvolume. mkdir /mnt/root # Make a mount point for the @/srv subvolume. mkdir /mnt/srv # Make a mount point for the @/tmp subvolume. mkdir /mnt/tmp # Make a mount point for the @/usr/local subvolume. mkdir -p /mnt/usr/local # Make a mount point for the @/var/cache subvolume. mkdir -p /mnt/var/cache # Make a mount point for the @/var/log subvolume. mkdir /mnt/var/log # Make a mount point for the @/var/spool subvolume. mkdir /mnt/var/spool # Make a mount point for the @/var/tmp subvolume. mkdir /mnt/var/tmp # Make a mountpoint for the ESP (EFI System Partition). mkdir /mnt/efi # Make a mount point for the /home partition. mkdir /mnt/home # We now mount the subvolumes to the mount points. Mount the @/.snapshots subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/.snapshots,compress=zstd /mnt/.snapshots # Mount the @/boot/grub subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/boot/grub,compress=zstd /mnt/boot/grub # Mount the @/opt subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/opt,compress=zstd /mnt/opt # Mount the @/root subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/root,compress=zstd /mnt/root # Mount the @/srv subvolume. mount UUID=$(lsblk -o UUID /dev/nvme0n1p2 | grep -v UUID) -o subvol=@/srv,compress=zstd /mnt/srv # Mount the @/tmp subvolume. ``` I will lay down the subvolumes on a **flat** layout, which is overall superior in my opinion and less constrained than a **nested** one. What's the difference ? If you're interested [this section of the old sysadmin guide](https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Layout) explains it. ```Zsh -
amorellg revised this gist
Jun 29, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -520,7 +520,7 @@ sudo pacman -S lib32-mesa lib32-vulkan-radeon lib32-libva-mesa-driver lib32-mesa In summary if you have an Nvidia card you have 3 options: 1. [**NVIDIA** proprietary driver](https://wiki.archlinux.org/title/NVIDIA) 2. [open source guide](https://github.com/amorellg/arch-nvidia-drivers-installation-guide) 3. [**Nouveau** open source driver](https://wiki.archlinux.org/title/Nouveau) ```Zsh -
amorellg revised this gist
Jun 29, 2025 . 1 changed file with 15 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -498,7 +498,7 @@ For this guide I'll install the [**AMDGPU** driver](https://wiki.archlinux.org/t # libva-mesa-driver: VA-API h/w video decoding support. # mesa-vdpau: VDPAU h/w accelerated video decoding support. sudo pacman -S mesa vulkan-radeon libva-mesa-driver libva-utils mesa-vdpau ``` ### 32 Bit support @@ -517,12 +517,23 @@ sudo pacman -S lib32-mesa lib32-vulkan-radeon lib32-libva-mesa-driver lib32-mesa ## Nvidia In summary if you have an Nvidia card you have 3 options: 1. [**NVIDIA** proprietary driver](https://wiki.archlinux.org/title/NVIDIA) 2. [open source guide](https://github.com/korvahannu/arch-nvidia-drivers-installation-guide) 3. [**Nouveau** open source driver](https://wiki.archlinux.org/title/Nouveau) ```Zsh sudo pacman -S nvidia-open nvidia-utils lib32-nvidia-utils sudo vim /etc/default/grub ``` `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1 nvidia-drm.fbdev=1"` ```Zsh sudo grub-mkconfig -o /boot/grub/grub.cfg ``` <br> -
amorellg revised this gist
Jun 19, 2025 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -400,6 +400,12 @@ reboot # Enable and start the time synchronization service timedatectl set-ntp true # Enable NetworkManager and configure wifi sudo systemctl enable NetworkManager.service sudo systemctl start NetworkManager.service nmcli device wifi connect <SSID> password <password> ``` <br> -
amorellg revised this gist
Jun 15, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -602,7 +602,7 @@ Now don't reboot your system yet. If you want a display manager, which is genera # swaylock: the lockscreen # waybar: a status bar for wayland wm's pacman -S --needed dolphin dunst grim hyprland kitty polkit-kde-agent qt5-wayland qt6-wayland slurp wofi xdg-desktop-portal-hyprland swaylock waybar # wlogout: a logout/shutdown menu yay -S wlogout -
amorellg revised this gist
Jun 15, 2025 . 1 changed file with 13 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -588,12 +588,21 @@ Now don't reboot your system yet. If you want a display manager, which is genera ```Zsh # Install hyprland from tagged releases and other utils: # dolphin: # dunst: # grim: # hyprland: # kitty: # polkit-kde-agent: # qt5-wayland: # qt6-wayland: # slurp: # wofi: the wayland version of rofi, an application launcher, extremely configurable # xdg-desktop-portal-hyprland: # swaylock: the lockscreen # waybar: a status bar for wayland wm's pacman -S --needed waybar dolphin dunst grim hyprland kitty polkit-kde-agent qt5-wayland qt6-wayland slurp wofi xdg-desktop-portal-hyprland swaylock waybar # wlogout: a logout/shutdown menu yay -S wlogout -
mjkstra revised this gist
Oct 3, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ - [Windows compatibility layers](#windows-compatibility-layers) - [Generic optimizations](#generic-optimizations) - [Overclocking and monitoring](#overclocking-and-monitoring) - [Additional notes](#additional-notes) - [Things to add](#things-to-add) # Introduction @@ -692,7 +692,7 @@ To overclock your system, i suggest installing [**corectrl**](https://gitlab.com <br> # Additional notes - On KDE disabling mouse acceleration is simple, just go to the settings via the GUI and on the mouse section enable the flat acceleration profile. If not using KDE then read [here](https://wiki.archlinux.org/title/Mouse_acceleration) @@ -703,7 +703,7 @@ To overclock your system, i suggest installing [**corectrl**](https://gitlab.com - There is no such thing as the best kernel, all kernels make tradeoffs \( eg: latency for throughtput \) and this it why it's generally advised to stick with the generic one. - If you are mainly a gamer you MAY consider the **TKG** or **CachyOS** kernel. These kernels contain many optimizations and are highly customizable, however the TKG kernel has to be compiled \( mainly it's time consuming, not hard \), while CachyOS kernel comes already packaged and optimized for specific hardware configurations, and can be simply installed with pacman upon adding their repos to `pacman.conf`. Some users have reported to experience a smoother experience with lower latency, however I couldn't find consistent information about this and it seems that is all backed by a personal sensation and not a result obtained through objective measurements \( Also this is difficult because in Linux there can be countless configuration variables and it also depends by the graphic card being used \). - Some recommended reads: - [How to build your KDE environment](https://community.kde.org/Distributions/Packaging_Recommendations) - [Gaming on Wayland](https://zamundaaa.github.io/wayland/2021/12/14/about-gaming-on-wayland.html) \( old article but still relevant \) - [Improving Linux Gaming Performance](https://linux-gaming.kwindu.eu/index.php?title=Improving_performance) -
mjkstra revised this gist
Oct 3, 2024 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -703,7 +703,12 @@ To overclock your system, i suggest installing [**corectrl**](https://gitlab.com - There is no such thing as the best kernel, all kernels make tradeoffs \( eg: latency for throughtput \) and this it why it's generally advised to stick with the generic one. - If you are mainly a gamer you MAY consider the **TKG** or **CachyOS** kernel. These kernels contain many optimizations and are highly customizable, however the TKG kernel has to be compiled \( mainly it's time consuming, not hard \), while CachyOS kernel comes already packaged and optimized for specific hardware configurations, and can be simply installed with pacman upon adding their repos to `pacman.conf`. Some users have reported to experience a smoother experience with lower latency, however I couldn't find consistent information about this and it seems that is all backed by a personal sensation and not a result obtained through objective measurements \( Also this is difficult because in Linux there can be countless configuration variables and it also depends by the graphic card being used \). - Now some recommended reads: - [How to build your KDE environment](https://community.kde.org/Distributions/Packaging_Recommendations) - [Gaming on Wayland](https://zamundaaa.github.io/wayland/2021/12/14/about-gaming-on-wayland.html) \( old article but still relevant \) - [Improving Linux Gaming Performance](https://linux-gaming.kwindu.eu/index.php?title=Improving_performance) - [Arch linux system maintenance](https://wiki.archlinux.org/title/System_maintenance) - [Arch linux general recommendations](https://wiki.archlinux.org/title/General_recommendations) <br> # Things to add -
mjkstra revised this gist
Oct 3, 2024 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -124,6 +124,13 @@ I will make 2 partitions: # If you have an hdd is something like sdax fdisk -l # Now you can either go and partition your disk with fdisk and follow the steps below, # or if you want to do things yourself and make it easier, use cfdisk ( an fdisk TUI wrapper ) which is # much more user friendly. A reddit user suggested me this and it's indeed very intuitive to use. # If you choose cfdisk you will have to invoke it the same way as I did with fdisk below, but # you don't need to follow my commands blindly as with fdisk below, just navigate the UI with the arrows # and press enter to get inside menus, remember to write changes before quitting. # Invoke fdisk to partition fdisk /dev/nvme0n1 -
mjkstra revised this gist
Oct 3, 2024 . 1 changed file with 30 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -535,8 +535,36 @@ On top of that I'll add a **display manager**, which you can omit if you don't l **KDE Plasma** is a very popular DE which comes bundled in many distributions. It supports both the older **Xorg** and the newer **Wayland** protocols. It's **user friendly**, **light** and it's also used on the Steam Deck, which makes it great for **gaming**. I'll provide the steps for a minimal installation and add some basic packages. ```Zsh # plasma-desktop: the barebones plasma environment. # plasma-pa: the KDE audio applet. # plasma-nm: the KDE network applet. # plasma-systemmonitor: the KDE task manager. # plasma-firewall: the KDE firewall. # plasma-browser-integration: cool stuff, it lets you manage things from your browser like media currently played via the plasma environment. Make sure to install the related extension on firefox ( you will be prompted automatically upon boot ). # kscreen: the KDE display configurator. # kwalletmanager: manage secure vaults ( needed to store the passwords of local applications in an encrypted format ). This also installs kwallet as a dependency, so I don't need to specify it. # kwallet-pam: automatically unlocks secure vault upon login ( without this, each time the wallet gets queried it asks for your password to unlock it ). # bluedevil: the KDE bluetooth manager. # powerdevil: the KDE power manager. # power-profiles-daemon: adds 3 power profiles selectable from powerdevil ( power saving, balanced, performance ). Make sure that its service is enabled and running ( it should be ). # kdeplasma-addons: some useful addons. # xdg-desktop-portal-kde: better integrates the plasma desktop in various windows like file pickers. # xwaylandvideobridge: exposes Wayland windows to XWayland-using screen sharing apps ( useful when screen sharing on discord, but also in other instances ). # kde-gtk-config: the native settings integration to manage GTK theming. # breeze-gtk: the breeze GTK theme. # cups, print-manager: the CUPS print service and the KDE front-end. # konsole: the KDE terminal. # dolphin: the KDE file manager. # ffmpegthumbs: video thumbnailer for dolphin. # firefox: the web browser. # kate: the KDE text editor. # okular: the KDE pdf viewer. # gwenview: the KDE image viewer. # ark: the KDE archive manager. # pinta: a paint.net clone written in GTK. # spectacle: the KDE screenshot tool. # dragon: a simple KDE media player. A more advanced alternative based on libmpv is Haruna. sudo pacman -S plasma-desktop plasma-pa plasma-nm plasma-systemmonitor plasma-firewall plasma-browser-integration kscreen kwalletmanager kwallet-pam bluedevil powerdevil power-profiles-daemon kdeplasma-addons xdg-desktop-portal-kde xwaylandvideobridge kde-gtk-config breeze-gtk cups print-manager konsole dolphin ffmpegthumbs firefox kate okular gwenview ark pinta spectacle dragon ``` Now don't reboot your system yet. If you want a display manager, which is generally recommended, head to the [related section](#adding-a-display-manager) in this guide and proceed from there otherwise you'll have to [manually configure](https://wiki.archlinux.org/title/KDE#From_the_console) and launch the graphical environment each time \(which I would advise to avoid\). -
mjkstra revised this gist
Sep 27, 2024 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -344,7 +344,13 @@ passwd useradd -mG wheel mjkstra passwd mjkstra # The command below is a one line command that will open the /etc/sudoers file with your favourite editor. # You can choose a different editor than vim by changing the EDITOR variable # Once opened, you have to look for a line which says something like "Uncomment to let members of group wheel execute any action" # and uncomment exactly the line BELOW it, by removing the #. This will grant superuser priviledges to your user. # Why are we issuing this command instead of a simple vim /etc/sudoers ? # Because visudo does more than opening the editor, for example it locks the file from being edited simultaneously and # runs syntax checks to avoid committing an unreadable file. EDITOR=vim visudo ``` -
mjkstra revised this gist
Sep 5, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ The goal of this guide is to help new users set up a modern and minimal installa - I **won't** prepare the system for **secure boot** because the procedure of custom key enrollment in the BIOS is dangerous and [can lead to a bricked system](https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot#Creating_and_enrolling_keys). If you are wondering why not using the default OEM keys in the BIOS, it's because they will make secure boot useless by being most likely [not enough secure](https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot#Implementing_Secure_Boot). - I **won't** encrypt the system because I don't need it and because encryption always adds a little bit of overhead in the boot phase leading to a **slower to varying degrees** start\-up, depending on your configuration. However it may be important for you so if you really wanna go this way I recommend reading [the wiki page in this regards](https://wiki.archlinux.org/title/Dm-crypt) and **must** perform the documented steps **IMMEDIATELY AFTER** [disk partitioning](#disk-partitioning). Also note that you must set the type of partition to a LUKS partition instead of a standard Linux partition when partitioning with `fdisk`. - I'll **skip** the Arch ISO installation media preparation.
NewerOlder