Skip to main content
After cm5-setup.sh completes, you have a bootable disk image ready to flash to your CM5 storage device.
Double-check the target device path before flashing. Writing to the wrong device will destroy data. Use lsblk to identify the correct device.

Identify the target device

lsblk -o NAME,SIZE,MODEL,TRAN
Look for your target device (SD card reader, USB-to-eMMC adapter, or NVMe enclosure).

Flash with dd

sudo dd if=rpi5-arch.img of=/dev/sdX bs=4M status=progress conv=fsync
Replace /dev/sdX with your actual device. The conv=fsync flag flushes kernel buffers to ensure the write completes before the command returns.

Flash with bmaptool (faster)

bmaptool uses a block map to skip writing empty blocks, significantly reducing flash time for sparse images:
sudo bmaptool copy rpi5-arch.img /dev/sdX
Install bmaptool if needed:
# Arch Linux
sudo pacman -S bmap-tools

# Debian/Ubuntu
sudo apt install bmap-tools

Verify the flash

After flashing, verify the partition table is intact:
sudo parted /dev/sdX print
You should see the GPT table with two partitions:
  • Partition 1: FAT32, ~256 MiB, ESP flag set
  • Partition 2: Btrfs, remainder of disk

Set the root password before first boot

The image has no root password set. Re-enter the chroot to configure it before inserting the CM5:
# Mount the subvolumes
BTRFS_OPTS="compress=zstd,space_cache=v2,noatime"
MOUNT_ROOT="/mnt/rpi5-root"

sudo mount -o "${BTRFS_OPTS},subvol=@"     /dev/sdX2  "$MOUNT_ROOT"
sudo mount -o "${BTRFS_OPTS},subvol=@boot" /dev/sdX2  "${MOUNT_ROOT}/boot"
sudo mount                                  /dev/sdX1  "${MOUNT_ROOT}/boot/efi"

# Bind virtual filesystems
for mp in proc sys dev dev/pts run; do
    sudo mount --bind "/${mp}" "${MOUNT_ROOT}/${mp}"
done

# Enter the chroot
sudo arch-chroot "$MOUNT_ROOT"
Inside the chroot:
# Set root password
passwd

# Optionally create a user
useradd -m -G wheel myuser
passwd myuser

# Exit when done
exit
Unmount cleanly:
for mp in proc sys dev/pts dev run; do sudo umount -l "${MOUNT_ROOT}/${mp}"; done
sudo umount -l "${MOUNT_ROOT}/boot/efi"
sudo umount -l "${MOUNT_ROOT}/boot"
sudo umount -l "$MOUNT_ROOT"

First boot

Insert the storage into your CM5, connect the Exaviz Cruiser’s UART debug header to a serial adapter, and power on. See Quickstart for first-boot expectations.
Keep console=ttyAMA0,115200 in the GRUB kernel cmdline during initial bring-up. The UART console is essential for debugging boot issues on headless systems.

Build docs developers (and LLMs) love