skysurfer.media

install and backup


install

# prepare the microsd card

cfdisk /dev/sdX  ## get drive letter from fdisk -l

# make 2 partitions for /boot and /root
# Partition 1 Type Fat32 - 512M
# Partition 2 Type Linux - remaining space

mkdir /mnt/root  ## if needed
mkfs.vfat /dev/sdX1  ## /boot
mkfs.ext4 /dev/sdX2  ## /root

# mount the microsdcard

mount -t ext4 /dev/sdx2 /mnt/root
mkdir /mnt/root/boot
mount -t vfat /dev/sdx1 /mnt/root/boot

# copy the files

tar xzf <image>.tar.gz ~/  ## if needed
cp -a ~/<image>/* /mnt/root/  ## ignore errors

# make grub boot /root - see notes*

cd /mnt/root/boot
chmod a+x mkscr
blkid /dev/sdX  ## copy the UUID of Partition 2
nano boot.txt   ## fix boot line to use your UUID
./mkscr         ## run mkscr when done

cd ~/
umount /mnt/root/boot
umount /mnt/root

# the microsd card is now ready for use

backup

# to create a tar.gz backup of the filesystem,
# start as root while booted into the RPI and
# make and preliminary changes - including:

rm /var/log/journal/<long-number>/* ## no idea why
iwctl known-networks forget "<hotspot>" ## optional
pacman -Scc ## to clear the package cache for space
echo '' > /home/alarm/.bash_history
echo '' > /root/.bash_history
shutdown now

# then mount the microsd card the same
# as it was installed on /mnt/root
# and copy the filesystem to ~/

mount -t ext4 /dev/sdX2 /mnt/root
mount -t vfat /dev/sdX1 /mnt/root/boot
mkdir ~/<new-image>
cp -a /mnt/root/* ~/<new-image>/

# create tar.gz  ## if needed

tar czf <new-image>.tar.gz <new-image>

umount /mnt/root/boot
umount /mnt/root

notes

The archlinuxarm.org directions use bsdtar – this is the same as the tar command.

If partitions are automatically mounted, they will need to be unmounted before mounting as root or /boot will be read-only. Even still, vfat doesn’t handle permissions so there will be errors on copying files that can be ignored as long as the folder is read-write and mkscr is executable.

The install image from archlinuxarm.org is supposed to auto boot, but on my device it doesn’t. One way to fix this is to edit /etc/fstab – but I edit grub directly so the rootfs can be replaced without altering the files even if the partiton changes. This may be useful later for a multi-boot image – I left a note about this change in the boot.txt file. If this change is not made, you’ll boot to a blank screen.

Deviating from the official instructions, I can see no good reason to use a swap partition on fixed media – if it’s needed at a later point, a swap file is the way to go.

The 20251220-streamer-base image is the starting point for everything else.
It could certainly be improved, but it’s fully functional.