1. Home
  2. Linux

How to set up Arch Linux ARM on Raspberry Pi

Did you know that you can run Arch Linux on a Raspberry Pi? Yes, thanks to the Arch ARM project, you can! Best of all, it’s a full-featured, rolling version of Arch Linux and it has all of the same features as the traditional x86 version. Arch Linux ARM is not a simple distribution to set up, especially those who are new to Linux. For this reason, we’ve made this guide on how to set up Arch Linux ARM on Raspberry Pi. In it, we will go over how to partition the SD card correctly, format everything, set up the file-system and more!

Note: Arch Linux ARM must be installed from a Linux PC. These instructions WILL NOT WORK on any other operating system, especially Mac/Windows.

Partitioning the Arch ARM SD Card

Plug in the Pi SD card into the Linux computer you are using to set up Arch ARM on. Then, in the terminal, gain a root shell using the su command.

su -

Run the lsblk command to view the output of all of the block devices on the system. Locate your SD Card’s label.

Note: having trouble figuring out the SD card’s device label? Try using Gnome Disks for an easier time.

In the Cfdisk utility, highlight any partitions and delete them by selecting “Delete.” When done, move to “New,” and select it with Enter on the keyboard.  Then, write 100M next to “partition” size.

After you’ve specified the size of the partition, select “primary” and press enter to create the partition.

The first partition is set up on the SD. Now it’s time to make the second partition. In Cfdisk, highlight “free space,” then select “New” to create a new partition.

Be sure that the second partition is “primary.” Also, make the partition take up the remaining space of the SD card.

When both partitions are set up in Cfdisk, highlight “write” to save the changes. Then, exit the tool by selecting “Quit.”

Formatting the SD Card file systems

The partitions are set up on the SD card. The next step is to format the file systems so that everything boots correctly. Using the mkfs command, format the first partition with the VFAT filesystem.

Remember: the labels below are examples. You will need to change the X to match the drive labels with your own. If you’ve forgotten the drive label of each of the partitions, remember to use lsblk or Gnome Disks.

sudo mkfs.vfat -F32 /dev/sdX1

The boot partition is now using VFAT. Next, we need to turn our attention to the Root partition (aka partition 2). In the terminal, format partition to Ext4.

sudo mkfs.ext4 -F /dev/sdX2

Setting up the Arch ARM folder structure

Just like on traditional Arch Linux, Arch ARM requires a manual folder configuration to install. To do this, open up a terminal and gain root access using the su command.

su -

Now that you’ve got root access on your Linux computer use the CD command and move to the /mnt folder.

cd /mnt

Inside /mnt, create a new folder where you’ll be working to install Arch Linux ARM. We’ll call this folder arch-arm

mkdir -p /mnt/arch-arm
mkdir -p /mnt/arch-arm/boot
mkdir -p /mnt/arch-arm/root

The working folder is set up. Next, you must mount the Root partition (partition 2) to it. Mounting is done with the mount command.

Note: be sure to change /dev/sdX2 with the correct drive label of partition 2 on your SD card.

mount /dev/sdX2 /mnt/arch-arm/root

After you’ve mounted the Root partition to /mnt/arch-arm/root, mount the Boot partition to /mnt/arch-arm/boot.

mount /dev/sdX1 /mnt/arch-arm/boot

When both folders are mounted in the correct locations, open up a second terminal and move on to the next section of the tutorial.

Downloading Arch ARM

Arch Linux ARM is not your traditional Raspberry Pi operating system. You will not find any IMG files out there whatsoever. Instead, you must download a source TarGZ archive file. In this section, we will show you how to get the latest release of Arch ARM for Pi using Wget.

Pi 1 Download

cd /tmp
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz

Pi 2 Download

cd /tmp
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz

Pi 3 Download

cd /tmp

wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz

Installing Arch ARM to SD Card

The files are done downloading. Now it’s time to set up the OS on the partitioned SD Card.

Note: you will need to install BSDTar to extract the files. Go to pkgs.org and download the package for your distro.

Using bsdtar, extract the files to the correct location.

Pi 1 Extract

sudo bsdtar -xpf /tmp/ArchLinuxARM-rpi-latest.tar.gz -C /mnt/arch-arm/root/

Pi 2 Extract

sudo bsdtar -xpf /tmp/ArchLinuxARM-rpi-2-latest.tar.gz -C /mnt/arch-arm/root/

Pi 3 Extract

sudo bsdtar -xpf /tmp/ArchLinuxARM-rpi-3-latest.tar.gz -C /mnt/arch-arm/root/

Arch ARM’s system files are now on the Root partition of the SD Card. Now you must move the boot files from /mnt/arch-arm/root/boot/ to the 100 MB partition we set up earlier.

sudo mv /mnt/arch-arm/root/boot/* /mnt/arch-arm/boot

Finish up the file installation by unmounting the partitions from your computer.

sudo umount /mnt/arch-arm/root/

sudo umount /mnt/arch-arm/boot/

Post-installation procedure

The first time you boot into Arch ARM on the Pi, you’ll need to set up pacman and populate the signing keys with the following commands.

Note: the default root user for Arch ARM is alarm. The default password is also alarm. The root password is root.

pacman-key --init
pacman-key --populate archlinuxarm

Next, sync and install any updates.

sudo pacman -Syyuu

With all the updates taken care of, your Arch ARM Pi is ready to use!

Leave a comment