Hero Image

pi64-zfs

ZFS on a Raspberry Pi 3B with Pi64 (ARM64/AARCH64 instead of ARMHF)

Time required broken down by the most important factors (using a Samsung EVO 32GB SD-card):

  • Fetching the kernel headers: Depends very heavily on your download- and SD-card speed.
  • Fetching and building SPL: +/- 3 minutes, 45 seconds.
  • Installing SPL-packages: +/- 35 seconds.
  • Fetching, patching and building ZFS: 1 hour and minutes.

Download and install Pi64 on your SD-card. Now, log in to the Pi and take some first steps. The default username is pi and the default password is raspberry:

passwd # Pick a healthy, better password!
apt update

You might want to install some useful utilities first (these are not requirements):

apt install -y screen vim htop lsof strace

As for the actual process (this can take over an hour, you should run it in a screen!)...

Install the dependencies:

pi64-update # IMPORTANT OR YOU WON'T HAVE THE KERNEL HEADERS TO BUILD THE MODULE!
mkdir zfs
cd zfs
apt install -y \
    build-essential \
    fakeroot \
    devscripts \
    autogen \
    libelf-dev \
    debian-keyring \
    dkms \
    libattr1-dev \
    libblkid-dev \
    libselinux1-dev \
    uuid-dev \
    zlib1g-dev

Next, build and install SPL:

dget -x http://http.debian.net/debian/pool/main/s/spl-linux/spl-linux_0.7.6-1.dsc
cd spl-linux-0.7.6
debuild
cd -
dpkg -i spl_0.7.6-1_arm64.deb \
    spl-dkms_0.7.6-1_all.deb

And, lastly, build ZFS and its libraries:

dget -x http://http.debian.net/debian/pool/contrib/z/zfs-linux/zfs-linux_0.7.6-1.dsc
curl "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=826994;filename=sysvinit_patch_3_826994.diff;msg=82" > zfs_arc_max_off_by_1.patch
cd zfs-linux-0.7.6
patch -p1 < ../zfs_arc_max_off_by_1.patch
dpkg-source --commit
debuild
cd -
dpkg -i libnvpair1linux_0.7.6-1_arm64.deb \
    libuutil1linux_0.7.6-1_arm64.deb \
    libzfs2linux_0.7.6-1_arm64.deb \
    libzpool2linux_0.7.6-1_arm64.deb \
    zfsutils-linux_0.7.6-1_arm64.deb \
    zfs-dkms_0.7.6-1_all.deb \
    zfs-zed_0.7.6-1_arm64.deb