Installing Arch on Pi

Posted on: 5th November 2020

The last time I tried installing Arch on the Pi, it wasn’t booting up. I would install, connect it to the router, check the ethernet activity and wait for the device to show up on the device list with no avail. I gave up and tried Alpine. The small footprint of Alpine was too appealing to pass up. Alpine installed just fine but I realized later that I need to jump some hoops to achieve persistent storage. I didn’t want to. I am fine experimenting with my laptop but I am wary of stressing out this tiny SBC. Almost installed DietPi, which I love btw and runs on another Pi for self-hosting certain applications, but decided to figure out what’s stopping Arch on the Pi. Installed Arch again, connected to the monitor, saw it boot and fail trying to mount /dev/mmcblk0p2. Now, I have an SSD connected to the Pi and mmcblk0p2 refers to the SD card. All I had to do to fix the boot was edit /etc/fstab in root and cmdline.txt in the boot to point to the correct partitions.

So, here’s how you install Arch Linux ARM on to any Pi with or without an SSD hooked in.

Step 1: Use this installation script. This script takes care of choosing your installation medium, partitioning, selecting your model of Pi, and installing the appropriate version of Arch. Follow the guide in the link till it says Wake up, Neo... The installation is done!. If installing to an SD card, skip to Step 3 else continue to Step 2.

Step 2: You are here because you have been burned by SD cards and have an SSD attached to the Pi. Excellent. Mount the first partition (boot). Edit cmdline.txt and change the partition from mmcblk0p2 to sda2. Mount the second partition (root). Change etc/fstab entry for mmcblk0p1 to sda1.

Step 3: Now power up the Pi, let it connect to the network, SSH in and run these commands first: pacman-key --init and pacman-key --populate archlinuxarm.

Step 4: Go back to the arch-pi script page in Step 1 and now continue to set up the build environment and install yay, if you want. Update the installation with pacman -Syuu.

Step 5: This should go without saying but change the default passwords of users alarm and root.

Step 6: Celebrate! 🎉️

Day 37 - Join Me in #100DaysToOffload

tags: 100daystooffload selfhosting pi arch