I use ZFS to store my data, including configuration files, for my desktop PC, so it's important for my datasets to mount automatically on boot. I couldn't for the life of me figure out how to do this in Ubuntu 19.10.
At first, when I ran zfs list
and zpool list
, there was no output; it was empty. Then, after figuring out how to import my pools, they still wouldn't mount.
The correct way to do this is to make sure three unit files are
enable
d to start on boot:zfs.target
, which is the overarching target for all of ZFSzfs-import.service
, which imports zpools at bootzfs-mount.service
, which mounts all datasets at bootThese units have dependencies set up correctly, so you can simply run:
systemctl enable zfs.target zfs-import.service zfs-mount.service
to ensure they are all turned on. After this, reboot to test; your ZFS datasets should show up.