A Gentle Introduction to ZFS, Part 1: Compiling ZFS on Ubuntu 18.04 (aarch64)

OpenZFS Logo
Syba PCI-e Mini SAS Expander (SI-PEX40137)

Why ZFS?

  • distribute parity and spares over all drives, so that one to three drive failures can completely restore the missing data (depends on configuration),
  • create instant snapshot backups that can be rolled back just as easily,
  • be more robust to data corruption and system crashes, and
  • store zettabytes in the file system (although there are some practical limitations to this).

On the Jetson TX2 & aarch64

Arch Linux Logo
$ yay -Ss zfs-utils-git 
aur/zfs-utils-git 2:2.0.0rc1.r38.gcd80273909-1 (+5 0.00)
Userspace utilities for the Zettabyte File System.

Hardware and OS Software

  • NVIDIA Jetson TX2 (8GB) developer kit. The kit basically consists of two parts: 1) the System-on-Module (SOM), and 2) the carrier board. One way to think of this pair is that the SOM is the computer, and the carrier board is the I/O and power interface.
The Jetson TX2 Development Kit
  • Ubuntu 18.04. Verify with the following command line:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
  • Linux for Tegra (L4T). To find out which version one has, cat the Tegra release file. My version is R32.4.4.
$ cat /etc/nv_tegra_release
# R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t186ref, EABI: aarch64

Compile ZFS from Source

Install Package Dependencies

$ sudo apt install -y alien autoconf automake build-essential dkms fakeroot gawk gdebi-core libacl1-dev libaio-dev libattr1-dev libblkid-dev libdevmapper-dev libelf-dev libselinux-dev libssl-dev libtool libudev-dev nfs-kernel-server python3 python3-dev python3-cffi python3-setuptools uuid-dev zlib1g-dev
$ sudo apt install linux-headers-$(uname -r)

Get and Configure ZFS Sources

$ git clone https://github.com/openzfs/zfs
$ cd zfs
$ sh autogen.sh
$ ./configure

Compile ZFS

$ make -s -j$((`nproc`-1))
Take a Tea Break!

Install ZFS and Initialize

$ sudo make install
$ sudo ldconfig
$ sudo depmod
$ sudo modprobe zfs
$ sudo modprobe -r zfs
$ sudo make uninstall
$ sudo ldconfig
$ sudo depmod
$ sudo systemctl enable --now zfs-import-cache.service
$ sudo systemctl enable --now zfs-import-scan.service
$ sudo systemctl enable --now zfs-import.target
$ sudo systemctl enable --now zfs-mount.service
$ sudo systemctl enable --now zfs-share.service
$ sudo systemctl enable --now zfs-zed.service
$ sudo systemctl enable --now zfs.target

Test the Installation

$ zpool status
no pools available
$ zpool status
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.

Summary

  • ZFS and associated hardware was described: 1) Jetson TX2 developer kit, 2) Syba PCI-e Mini SAS Expander(SI-PEX40137), and 3) various TB hard drives.
  • ZFS v2.0.0-rc1 was compiled and initialized on L4T R32.4.4 (aarch64).

Next Article

Further Resources

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store