ZFS Autostart on Debian 10

Background

A pastebin service could save a lot of disk space with file compression. Mojopaste doesn’t natively support file compression, so FS-level file compression is easier to set up.

VDO, ZFS and Btrfs all support transparent file compression. I picked ZFS because it’s the most mature one among them.

Problems

  1. Installing zfs-dkms on Debian didn’t succeed at first. I had to manually run /sbin/modprobe zfs to continue the installation.
  2. The zfs module does not automatically load after reboot, and zfs services fails to start.

Solution

Searching for similar issues on GitHub, I found this comment and realized that I must create a ZFS pool first to automatically start ZFS-related services on boot.

$ sudo systemctl status zfs-import-cache.service
● zfs-import-cache.service - Import ZFS pools by cache file
   Loaded: loaded (/lib/systemd/system/zfs-import-cache.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Wed 2019-10-30 16:52:25 UTC; 6min ago
           └─ ConditionPathExists=/etc/zfs/zpool.cache was not met
     Docs: man:zpool(8)

Oct 30 16:52:25 macports systemd[1]: Condition check resulted in Import ZFS pools by cache file being skipped.