j-riv@localhost:~$

How to Install Arch Linux on RPi4 with USB Boot

In this tutorial I will cover a step by step Arch Linux Installation on a Raspberry Pi 4 with usb boot.

This is the way it worked for me, there must be an easier way, if so please let me know.

We will first have to install Arch on an SD card and then re-install it on an SSD (or copy it over to the SSD).

Install Arch on an SD Card

Replace sdX in the following instructions with the device name for the SSD as it appears on your computer.

fdisk /dev/sdX

At the fdisk prompt, delete old partitions and create a new one:

  • Type o. This will clear out any partitions on the drive.
  • Type p to list partitions. There should be no partitions left.
  • Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +200M for the last sector.
  • Type t, then c to set the first partition to type W95 FAT32 (LBA).
  • Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
  • Write the partition table and exit by typing w.

Create and mount the FAT Filesystem:

mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot

Create and mount the ext4 Filesystem:

mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 root

Download and extract the root filesystem (as root, not via sudo):

wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C root
sync

Move boot files to the first partition:

mv root/boot/* boot

Before unmounting the partitions, update /etc/fstab for the different SD block device compared to the Raspberry Pi 3:

sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab

Unmount the two partitions:

umount boot root

Insert the SD card into the Raspberry Pi, connect ethernet, and apply 5v power. Connect your SSD via one of the available USB 3s.

Use the serial console or SSH to the IP address given to the board by your router.

  • Login as the default user alarm with the password alarm.
  • The default root password is root.

Once you're logged in we will now re-start the installation, this time on the SSD.

Replace sdX in the following instructions with the device name for the SSD as it appears on your computer.

fdisk /dev/sdX

At the fdisk prompt, delete old partitions and create a new one:

  • Type o. This will clear out any partitions on the drive.
  • Type p to list partitions. There should be no partitions left.
  • Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +200M for the last sector.
  • Type t, then c to set the first partition to type W95 FAT32 (LBA).
  • Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
  • Write the partition table and exit by typing w.

Create and mount the FAT Filesystem:

mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot

Create and mount the ext4 Filesystem:

mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 root

Download and extract the root filesystem (as root, not via sudo):

wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C root
sync

Move boot files to the first partition:

mv root/boot/* boot

Add pcie_brcmstb into Modules in /etc/mkinitcpio.conf and root/etc/mkinitcpio.conf:

nano /etc/mkinitcpio.conf
# add pcie_brcmstb into MODULES and save
nano root/etc/mkinitcpio.conf
# add pcie_brcmstb into MODULES and save

Run:

mkinitcpio -P

Copy the 2 files it created in the host /boot (SD Card) to the boot directory you have /dev/sdX1 mounted on.