Learn! Since it’s the first time I’m installing Arch Linux in a physical machine, I want to learn as much as I can, and write them down as much as possible
This is not a tutorial (although I wrote it as a tutorial for me). This is just a report from my first time installing Arch in a physical computer.
You can use it as a kickstart for your own Arch install, or just see how I take notes.
Make sure to double check the information since they might not be completely up-to-date or outlined in a more simplistic way compared to the reality (always check the Arch Wiki).
Anyways, if you have any doubt or suggestions, make sure you reach me.
Since I was using wired connection, I didn’t need to setup anything, but, if it’s not your case (something’s not right or you’re using wireless connection, check this).
To test if you’re connected to the internet, ping any website:
I strongly recommend you to disconnect other disks except for the one you’ll be Installing Arch so you don’t erase anything you didn’t want to
If there’s any error, first check the docs to see if any of the notes can help
Identify the disk you’ll be partitioning
fdisk -l
I’ll be using /dev/sda/ but you should change it according to your case
Use the fdisk specifying the disk
fdisk /dev/sda
If the device does not contain a recognized partition table, fdiskwill automatically create a DOS (MBR) disklabel. Although it changes automatically to gpt once you create a GPT partition, you can already start the disk with GPT using the -t flag:
Set the hostname (name of your machine) by creating the /etc/hostname and adding the name of your hostname inside it.
Now, in order to prevent software unsafely resolving localhost over the network because they migh still read /etc/hosts, add the following entries to /etc/hosts:
You can use grub or systemd. I’ll use grub because it enables more customization and there are some packages that allows restoring snapshots from the grub interface as well.
Now you need to obtain the UUID of the partition the system was installed:
blkid
Use the UUID of the partition itself (in my case it’s /dev/sda2, or if you’re using NVME it should be something like /dev/nvme0n1p2)
Edit /etc/default/grub and at the line beginning with GRUB_CMDLINE_LINUX_DEFAULT, insert at the end with a space after quiet. Replace the content of [UUID] with the correspondent UUID of your system partition:
When the snapshot configuration is created with snapper, it will also create a subvolume and a folder called /.snapshots, even thouth the snapshots subvolume was alreay created and mounted on /.snapshots
To fix this:
Unmount snapshots subvolume
sudo umount /.snapshots
Delete the /.snapshots folder
sudo rm -r /.snapshots
Create snapper config
sudo snapper -c root create-config /
Check that snapper created the subvolume
sudo btrfs subvolume list /
Delete the newly created subvolume and folder
sudo btrfs subvolume delete /.snapshots
Create the /.snapshots folder again
sudo mkdir /.snapshots
Remount it to snapshots subvolume
sudo mount -a
Now give the right read, write and execute permissions to the snapshots:
sudo chmod 750 /.snapshots
Add your user to ALLOW_USERS="yourusername" in the snapper config at /etc/snapper/configs/root. You can also change the frequency and the history listed on the snapper wiki page:
An AUR helper automates the usage of the Arch User Repository (which is one of the great pros about using Arch really).
Even when I used Arch on WSL, I really liked yay, because it’s really fun to type :)
But you can also choose another one (like paru which is written in Rust), or if you’re really going in Arch Linux way, get familiar with the manual build process
In order to take a snapshot after every single install with pacman so you can revert if an upgrade breaks something, we can use snap-pac-grub.
But, because of the way the partitions were configured, the /boot is not being snapshotted, so in order to copy the files of /boot on every Linux kernel upgrade, rsync will be installed.
yay -S snap-pac-grub rsync
There’s also the possibility to enable booting the snapshots from grub. For that, in /etc/mkinitcpio.conf add grub-btrfs-overlayfs to the end of HOOKS. And don’t forget to regenerate your initramfs:
Of course, from here there are endless possibilities for the system to be configured and since I don’t have a preference yet, I’ll leave it up to your creativity.
But, if you’re really curious about what I do from here, you can check my dotfiles.
That’s it! Hope you enjoyed it. Please contact me if you have any suggestions, recommendations, tips, questions or if you just want to have philosophical conversations!
During the installation with pacstrap, I received some errors about someone’s signature key is unknown trust or invalid or corrupted package (PGP signature).
I had to refresh the keys for it to work properly (this might take some time)