I bought a raspberry 4b (4g mem) to use as a low-power home server and emulator console (libretro). By far I'm satisfied.
This is a memo about my settings and tunings.
I started from the build at ArchLinuxARM but used a btrfs root instead of ext4.
The original instructions used ext4 should definitely work. It's just I prefer to use a btrfs subvolume as root for a few reasons:
btrfs send/receive, and backup like btrbk)
The following snippet assumes SD card is at
/dev/sdX. You need to use actual path in commands.
fdisk or other tools you like:
sdX1, a 100MB FAT partition, and set partition type to
W95 FAT32 (LBA). This becomes
sdX2with rest of the disk, and set partition type to
Linux. This becomes parent of other subvolumes including
sdX2and create a swap partition now, because swap file is not supported in btrfs.
Refer to original instructions if you are uncertain about
# cd /media # mkfs.vfat /dev/sdX1 # mkfs.btrfs /dev/sdX2 # mkdir -pv sdcard # mount /dev/sdX2 sdcard -o ssd,discard,compress=lzo # btrfs subvolume create sdcard/root-current # This subvolume becomes / at run time. It can be snapshot-ed separately. # mkdir sdcard/root-current/boot # mount /dev/sdX1 sdcard/root-current/boot # bsdtar -xpf ArchLinuxARM-rpi-4-latest.tar.gz -C sdcard/root-current
rootflags part to mount the subvolume at
-root=/dev/mmcblk0p2 rw rootwait console=ttyAMA0,115200 ... +root=/dev/mmcblk0p2 rootflags=subvol=/root-current rw rootwait console=ttyAMA0,115200 ...
sdcard/root-current/etc/fstab, add our mount options (it boots without these lines, but new created files won't get compressed):
+/dev/mmcblk0p2 / btrfs defaults,compress=lzo,subvol=/root-current 0 0 +/dev/mmcblk0p2 /media/sdcard btrfs defaults,compress=lzo,subvol=/,noauto 0 0
/media/sdcard mount is not necessary for everyday use. It can be used to manage subvolumes / snapshots.
After successfully booting from SD card:
locale-gen(It's strange that the
locale.gendoes not come with any locale.)
After the following attempts, I'm already OK with the performance. Stopping here until I need to squeeze more out of it.
# /etc/systemd/journald.conf [Journal] -Storage=auto +Storage=volatile
This is my first journey about iSCSI but it's smoother than I thought.
The CPU is ARMv8-capable but I don't see any ARMv8 builds published. Guess I have to check the following links later: