ZFS support in Radxa Ubuntu 18 distro

i just got a rockpi penta hat with the enclosure, loaded it up with disks but
it seems that ZFS is missing from the Ubuntu distro that radxa is distributing.
I first tried to use their Debian 9 distro so that I could use OpenMediaVault, but debian doesn’t come with ZFS. I attempted to build the dkms, but it failed.

Has anyone gotten ZFS to work with one of the official distros? How? It seems the kernel modules are missing from the official distribution.

root@rockpi:~# zpool create tank raidz /dev/sdb /dev/sdc /dev/sdd The ZFS modules are not loaded. Try running '/sbin/modprobe zfs' as root to load them. root@rockpi:~# modprobe zfs modprobe: FATAL: Module zfs not found in directory /lib/modules/4.4.154-111-rockchip-g39b306a41b2d root@rockpi:~# dkms status spl, 0.7.5: added zfs, 0.7.5: added root@rockpi:~# lsmod Module Size Used by bcmdhd 1183744 0 autofs4 40960 2 root@rockpi:~# find /lib/modules/ -name '*zfs*' root@rockpi:~# uname -a Linux rockpi 4.4.154-111-rockchip-g39b306a41b2d #1 SMP Wed Jul 8 15:03:52 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux root@rockpi:~# cat /etc/issue Ubuntu 18.04.5 LTS \n \l
I’m using a rockpi 4b with the pentahat and enclosure. I suppose I could try the Ubuntu 20 distro for the 4c or one of the community maintained distributions, but it’s quite a bit of work disassemble the enclosure to get to the EMMC every time I want to try

Should work with Armbian. If not, we will fix it.

1 Like

That is normal due to incompatible licence.

cd /usr/src/linux-headers-`uname -r`
sudo make scripts
cd
wget https://github.com/openzfs/zfs/releases/download/zfs-0.8.4/zfs-0.8.4.tar.gz
tar xvf zfs-0.8.4.tar.gz
cd zfs-0.8.4/
./autogen.sh
./configure
make deb-dkms deb-utils
for deb in *.deb; do sudo dpkg -i “$deb”; done
sudo reboot

Verify-in Ubuntu 18.04 and work normally.

2 Likes

Same question, but now for Armbian , Buster Server 5.8.y, Sept 3 2020.

I tried the exact same steps as before, but with no luck.
When trying to build zfs from source (with a fresh reinstall of the headers)
I get:
MODPOST /usr/src/zfs/module/Module.symvers
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/zstd/zzstd.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/zfs/zfs.ko] undefined!
ERROR: modpost: “_cond_resched” [/usr/src/zfs/module/zfs/zfs.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/zcommon/zcommon.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/unicode/zunicode.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/nvpair/znvpair.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/lua/zlua.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/icp/icp.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/avl/zavl.ko] undefined!
ERROR: modpost: “_cond_resched” [/usr/src/zfs/module/spl/spl.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/usr/src/zfs/module/spl/spl.ko] undefined!
make[4]: *** [scripts/Makefile.modpost:111: /usr/src/zfs/module/Module.symvers] Error 1
make[4]: *** Deleting file ‘/usr/src/zfs/module/Module.symvers’
make[3]: *** [Makefile:1669: modules] Error 2
make[3]: Leaving directory ‘/usr/src/linux-headers-5.8.6-rockchip64’
make[2]: *** [Makefile:48: modules-Linux] Error 2
make[2]: Leaving directory ‘/usr/src/zfs/module’
make[1]: *** [Makefile:881: all-recursive] Error 1
make[1]: Leaving directory ‘/usr/src/zfs’
make: *** [Makefile:742: all] Error 2

Trying to build from backports:
` apt install -f -y -t buster-backports zfs-dkms --reinstall`
I get: 
eading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  dkms
Suggested packages:
  python3-apport menu debhelper
Recommended packages:
  linux-headers-686-pae | linux-headers-amd64 | linux-headers-generic | linux-headers zfs-zed zfsutils-linux
The following NEW packages will be installed:
  dkms zfs-dkms
0 upgraded, 2 newly installed, 0 to remove and 53 not upgraded.
Need to get 0 B/1,981 kB of archives.
After this operation, 14.8 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package dkms.
(Reading database ... 72238 files and directories currently installed.)
Preparing to unpack .../archives/dkms_2.6.1-4_all.deb ...
Unpacking dkms (2.6.1-4) ...
Selecting previously unselected package zfs-dkms.
Preparing to unpack .../zfs-dkms_0.8.4-2~bpo10+1_all.deb ...
Unpacking zfs-dkms (0.8.4-2~bpo10+1) ...
Setting up dkms (2.6.1-4) ...
Setting up zfs-dkms (0.8.4-2~bpo10+1) ...
Loading new zfs-0.8.4 DKMS files...
Building for 5.8.6-rockchip64
Building initial module for 5.8.6-rockchip64

Error! Bad return status for module build on kernel: 5.8.6-rockchip64 (aarch64)
Consult /var/lib/dkms/zfs/0.8.4/build/make.log for more information.
dpkg: error processing package zfs-dkms (--configure):
 installed zfs-dkms package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
update-initramfs: Generating /boot/initrd.img-5.8.6-rockchip
update-initramfs: Converting to u-boot format
Errors were encountered while processing:
 zfs-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

/var/lib/dkms/zfs/0.8.4/build/make.log shows
… CC [M] /var/lib/dkms/zfs/0.8.4/build/module/zfs/qat_crypt.o
CC [M] /var/lib/dkms/zfs/0.8.4/build/module/zfs/vdev_raidz_math_aarch64_neon.o
CC [M] /var/lib/dkms/zfs/0.8.4/build/module/zfs/vdev_raidz_math_aarch64_neonx2.o
LD [M] /var/lib/dkms/zfs/0.8.4/build/module/zfs/zfs.o
MODPOST /var/lib/dkms/zfs/0.8.4/build/module/Module.symvers
ERROR: modpost: “_cond_resched” [/var/lib/dkms/zfs/0.8.4/build/module/zfs/zfs.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/zfs/zfs.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/zcommon/zcommon.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/unicode/zunicode.ko] undefined!
ERROR: modpost: “_cond_resched” [/var/lib/dkms/zfs/0.8.4/build/module/spl/spl.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/spl/spl.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/nvpair/znvpair.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/lua/zlua.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/icp/icp.ko] undefined!
ERROR: modpost: “__stack_chk_guard” [/var/lib/dkms/zfs/0.8.4/build/module/avl/zavl.ko] undefined!
make[4]: *** [scripts/Makefile.modpost:111: /var/lib/dkms/zfs/0.8.4/build/module/Module.symvers] Error 1
make[4]: *** Deleting file ‘/var/lib/dkms/zfs/0.8.4/build/module/Module.symvers’
make[3]: *** [Makefile:1669: modules] Error 2
make[3]: Leaving directory ‘/usr/src/linux-headers-5.8.6-rockchip64’
make[2]: *** [Makefile:30: modules] Error 2
make[2]: Leaving directory ‘/var/lib/dkms/zfs/0.8.4/build/module’
make[1]: *** [Makefile:808: all-recursive] Error 1
make[1]: Leaving directory ‘/var/lib/dkms/zfs/0.8.4/build’
make: *** [Makefile:677: all] Error 2

Due to the zfs-0.8.4 compatible with 2.6.32 - 5.6 Linux kernels.

You can try zfs-2.0.0-rc1

1 Like

I had been using OpenZFS 0.8.4 very successfully with the Armbian image from August running kernel 5.4.45 (Penta SATA hat with 5 spinning drives, routinely achieving 100 - 120 MByte/sec aggregate I/O rates with one four-drive raidz1 and a single xfs drive).

Last week I wasn’t paying close enough attention and allowed an “apt upgrade” to install the new kernel (5.8.13). This broke ZFS of course, and 0.8.4 doesn’t build. As you found, 0.8.5 doesn’t build because of the missing __stack_chk_guard kernel symbol.

I took a closer look and it’s an issue with the Armbian-built kernel. If you look at System.map in the /boot directory for both kernels, you’ll find __stack_chk_guard is missing in 5.8.13 but present in 5.4.45, despite the Kconfig file indicating full stack checking enabled.

I finally solved the 0.8.5 build by modifying module/Makefile.in to add “-fno-stack-protector” to the first ZFS_MODULE_CFLAGS line. The build then succeeds (after executing “configure” again to generate a new module/Makefile), and my zpool is back and healthy.

The new kernel did make me worry a bit about the overlay for the SATA hat (rockpi-penta.dtbo). Is the source code for this overlay available?

@zdjh22

You can use the dtc command to get the source code.

Thanks! I’ve used x86 Linux for a long long time (first install December 1994). I’m still learning new things about Linux for ARM all of the time. I love my Rock Pi’s.

ZFS for 5.8.y was released fey days back and Armbian with 5.8.y - at least Focal version - can build DKMS out of the box. Debian has some troubles …

My first install was http://www.slackware.com/announce/1.0.php :slight_smile:

ARM sbc are closer to that since we need to fiddle around and build kernels to make things work - like in those times with x86. And also those ARM boards are by definition somewhere between single task embedded and general purpose Linux.

Nice! You probably have me beat by a year (my first must have been Slackware 1.1 since it still had a Linux 0.99 kernel - whatever was available and cheap on CD from Walnut Creek at the time).

My first embedded SBC Linux project was on a Motorola MVME-167. I had to write device drivers to read out VME digitizers for a high energy physics experiment (the CDMS dark matter search). It’s fun to return to that sort of fiddling!