Just got the new Pi. I will install Alpine Linux on it. Alpine Linux is a really tiny distribution of Linux without a user interface that runs entirely from memory. That means: when it boots, the OS will load into the RAM and run from there the entire time. Because it's so small, this is not a problem, it only takes around 150MB of space there. The Pi I bought has 4GB of memory.
This two major advantages. First of all, it will be much faster than running from an SD card, as is common with Raspberry Pi's. Additionally, SD cards can only be written to so many times before they break, so as the main partition for an operating system they are actually not ideal. By loading the system once into memory on boot, the read/write cycles will be reduced to a minimum. We plan to connect Tharim's old NAS or something similar to the server, which can then act as the main hard drive for everything else. That's for later.
I am following the descriptions from the Alpine Linux wiki: https://wiki.alpinelinux.org/wiki/Raspberry_Pi. I downloaded the aarch64 RBP version from their website, and will create a bootable SD card from this next. I was originally trying to work on a MacBook next to this, so I tried to use Etcher to create a bootable SD card: https://www.balena.io/etcher/
But this didn't work. I formatted the SD card to FAT and ran Etcher, but the Raspberry Pi is not recognising this. So I switched to my Linux system and reformatted the disk using Gnome Disks, Ubuntu's GUI disk app. I also downloaded the right version of Alpine Linux again, and put it on a USB stick, to be able to access it from Alpine Linux. I actually think I could have just mounted the main hard drive from within Alpine, but this seemed easier.
The thing is that (for me) it's a bit of a complicated process to create this bootable SD card and I don't understand half of the documentation. Supposedly it's simpler if you already have a version of Alpine Linux installed. WARNING: This next part describes something that didn't work.
When working with Ada last time, we created a bootable USB stick that runs Alpine Linux using an app called Ventoy. The plan is now to boot my linux machine from that USB stick, and create a bootable SD card from there. For some reason the USB stick itself doesn't work on the Raspberry Pi directly.
First I had to set up this version of Alpine Linux though. There is a command, setup-bootable, which is supposed to do everything for you directly, but I needed to install a library for this first, called syslinux, which makes the SD card bootable after copying the OS. This didn't work without going through the installation process first.
The install can be a bit clunky. One thing I found important is to start the system without the SD card, and only insert it later, otherwise the system seems to run some kind of process on it and I cannot unmount it. It also can be helpful to already
There is a quick version of the setup command, using the q flag. This saves us quite some time, especially since you always have to start over if something doesn't work out which happens a lot. In order for this to work we need to first set up an internet connection, and then start the process. Lastly we have to install the syslinux library.
$ setup-interfaces
$ setup-alpine -q
$ apk add syslinux
This is the moment where you insert the SD card.
In order to make a bootable SD card, we need two arguments: the source and the target. The target being the SD card, the source being the version of Alpine we just downloaded. In order to do this, we also probably have to find and mount the USB stick with the version of Alpine Linux on it. We will use fdisk to identify both our SD card and the USB stick with the downloaded Alpine version on it, note both devices down and then mount the source USB.
$ fdisk -l
# find your devices in the list, then replace sdXY with your device
$ mkdir /media/stick
# for me it was sdb3
$ mount /dev/sdXY /media/stick
I already unzipped the tar file we downloaded before. If you haven't do that now, if you did, just use the unzipped folder as your source, and the SD card as target. For me this was:
$ setup-bootable -v /mnt/stick/alpine/ /dev/sdc1
BUT, this didn't work. I will try again tomorrow.