Classic install or sys mode on Raspberry Pi

From Alpine Linux
Revision as of 17:02, 26 September 2025 by Prabuanand (talk | contribs) (removed outdated steps as suggested in Talk:Classic_install_or_sys_mode_on_Raspberry_Pi)

This page documents the traditional or sys mode installation of Alpine Linux on a Raspberry Pi. The below instructions are based on the #12353#note_164623.

Prerequisites

  • Internet connectivity is mandatory to complete sys mode installation.

Sys mode installation on Raspberry Pi

  1. Boot from the Raspberry Pi installation media.
  2. Run setup-alpine script until step 11(i.e SSH) of the base configuration without skipping network configuration step as Internet access is mandatory to complete sys mode installation.
  3. In Disk & Install section, answer the questions as follows: (refer screengrab)
    No disks available. Try boot media /media/mmcblk0? (y/n) [n], change the default option and type y.
    Which disk(s) would you like to use? (or '?' for help or 'none') [none], type device name mmcblk0 as per displayed information.
    How would you like to use it? ('sys', 'data', 'crypt', 'lvm' or '?' for help) [?], type sys.
    WARNING: Erase the above disk(s) and continue? (y/n) [n] change the default option and type y to proceed with the installation.
  4. At the end of Installation, you can reboot to boot into the newly installed Alpine Linux and configure further.

Disk & Install screengrab

Depending on the size of your install media and pi model, the information may vary.

 Disk & Install
----------------
No disks available. Try boot media /media/mmcblk0? (y/n) [n]  y
 * WARNING: you are stopping a sysinit service
 * Caching service dependencies ...                                                                                                [ ok ]
 * Unmounting /.modloop ...                                                                                                        [ ok ]
Available disks are:
  mmcblk0	(64.1 GB  )

Which disk(s) would you like to use? (or '?' for help or 'none') [none]  mmcblk0

The following disk is selected:
  mmcblk0	(64.1 GB  )

How would you like to use it? ('sys', 'data', 'crypt', 'lvm' or '?' for help) [?]  sys
100% █████████
/usr/sbin/update-raspberrypi-bootloader: WARNING: no kernel found

WARNING: The following disk(s) will be erased:
  mmcblk0	(64.1 GB  )

WARNING: Erase the above disk(s) and continue? (y/n) [n]  y
Partition #2 contains a ext4 signature.
Creating file systems...
mkfs.fat 4.2 (2021-01-31)
Installing system on /dev/mmcblk0p2:
100% █████████
==> initramfs: creating /boot/initramfs-rpi for 6.12.8-0-rpi
/usr/sbin/update-raspberrypi-bootloader: INFO: replaced config.txt and saved config.txt.old
Configured kernel vmlinuz-rpi / initramfs-rpi

Installation is complete. Please reboot.

Convert diskless to sys mode

It is also possible to switch a diskless installation to a fully disk-based installation. This is not yet formally supported, but can be done somewhat manually. This frees all the memory otherwise needed for the root filesystem, allowing more installed packages.

Split your SD card into two partitions: the FAT32 boot partition described above (in this example it'll be mmcblk0p1) , and a second partition to hold the root filesystem (here it'll be mmcblk0p2). Boot and configure your diskless system as above, then create a root filesystem:

apk add e2fsprogs mkfs.ext4 /dev/mmcblk0p2

Now do a disk install via a mountpoint. The setup-disk script will give some errors about syslinux/extlinux, but you can ignore them. The Raspberry Pi doesn't need them to boot.

mkdir /stage mount /dev/mmcblk0p2 /stage setup-disk -o /media/mmcblk0p1/MYHOSTNAME.apkovl.tar.gz /stage # (ignore errors about syslinux/extlinux)

Add a line to /stage/etc/fstab to mount the Pi's boot partition again:

/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0

Now add a root=/dev/mmcblk0p2 parameter to the Pi's boot command line, either cmdline-rpi2.txt or cmdline-rpi.txt depending on model:

mount -o remount,rw /media/mmcblk0p1 sed -i '$ s/$/ root=\/dev\/mmcblk0p2/' /media/mmcblk0p1/cmdline-rpi2.txt

N.B. the contents of /boot will be ignored when the Pi boots. It will use the kernel, initramfs, and modloop images from the FAT32 boot partition. To update the kernel, initfs or modules, you will need to manually (generate and) copy these to the boot partition or you could use bind mount, in which case, copying the files to boot partition manually, is not needed.

echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 >> /etc/fstab

See also