ZFS support in CL

According to the FAQ, ZFS support has been a no-go in the past on Clear Linux due to ZFS historical licensing issues. I was wondering if perhaps there’d been any progress on with this line of thinking?

It does seem odd in some ways these days. For example Canonical has competent lawyers and deems it not a risk to being sued over ZFS in Ubuntu (20.04 increase ZFS support).

Is it because CL is an Intel project that it’s an issue and the sponsoring company is more risk averse?

Just to add a bit of personal musings. Would be really nice to have ZFS snapshot feature to roll back breaking changes when tinkering. (I believe Ubuntu is now doing this for APT).

Second feature is remote disk streaming. N+1 redundancy making live backups a snap. Various other approaches are out there, though doing it at disk level has certain advantages too.

Lastly the data-at-rest integrity checking is very nice, esp when paired with ECC mem.

The last two especially useful in DR and Enterprise scenario.

Of course BTRFS also offers a somewhat overlapping set of features, though some people are more comfortable and familiar with a certain stack. VIM or Emacs. How about either? or both? :slight_smile:

Anyway, I know it’s a long shot and probably a metric ton of work involved, so yah don’t think it’s going to happen anytime soon. Nice to day dream.

Canonical is not a US-based company. Therefore, anything their lawyers say has very little meaning outside of the UK.

1 Like

That’s a fair point. US is generally a more litiguous environment, so there’s that too.

There is not an issue with compiling and using ZFS on Linux, so I think it’s not accurate to characterize it as a no-go.

There is an issue with distributing binaries for ZFS and Linux together (note that distributing source is not a problem, it’s binaries, which is presumably what everyone is asking for.)

As of the 0.8.4 tag, the zfs-0.8-release is building against kernel 5.6 (and claims to have kernel 5.7 support, but I have not yet tested it), which means it is now a little bit easier to roll your own ZFS. This is WAY EASIER for non-root datasets, but it can be done on root with a little more elbow grease.

But if getting it working on non-root is too much work, you’ll not have a good time getting it working on root.

To build the ZFS kernel module:

git clone https://github.com/openzfs/zfs.git
cd zfs
git checkout zfs-0.8-release

If it builds without error, then you have a good chance of making it work for a non-root dataset on kernels 5.6 and 5.7.

As the Linux Kernel pulls away from ZFS, you can run into issues, so you definitely do not want to install the latest kernel until you’ve verified on the ZoL github that the new kernel version is supported.

Somewhat luckily, once you go ZFS on root, clr-boot-manager will no longer be able to install new kernels for you automatically (it does not understand where your root partition is anymore) In light of that, you don’t have to worry about things changing underneath you. However, you do now have to install your own kernels when you want to upgrade. Ensure you’re comfortable setting up systemd-boot if you want to go ZFS on root.

I’m working on some documentation to help, but I haven’t finished un-breaking everything yet. :smiley:

Good luck.


Really glad someone is working on a tutorial for this.

It’s rough, and a work in progress. Once it’s cooked a little better, I’ll send a pull request to the documentation project. I need a couple more days before I’ll be ready to issue a PR. Until then, the more eyes the better:

It is definitely possible to run ZFS, even on root, now that the ZoL project has applied the important patches for kernels 5.6 and 5.7. The biggest difficulty is setting it up so it continues to take advantage of the best thing about Clear – fast, new kernels as they become available.

cc: @ahkok @cmilne


Pull request sent for a first pass ZFS tutorial – would love to get some eyes on it. Feedback welcome.

The tutorial itself: https://github.com/clearlinux/clear-linux-documentation/pull/1172/files#diff-d57104806281470b9ebcbce6aaa2a554


Great work @peteonrails ! I’ll make sure that it gets discussed in our documentation meeting tomorrow.

-> @mvincerra


1 Like

It’s on the agenda. I’ve already responded to @peteonrails in GH. Thanks.


@mvincerra Thanks to both of you for your time and consideration.

1 Like

The PR for this was just merged – watch for the tutorial on the docs site soon.

Thanks @mvincerra @puneetse and others who worked on the doc.

ZFS on the root partition is considerably harder than this tutorial – now that the first tutorial has run the gauntlet, I’ll start working on the follow up that explains how to run a ZFS root.


I really appreciate this :+1: Truly.

1 Like



Hello snapshots and replication! Zol can get tricky but you’ve put together a helpful guide. The systemd stuff on CL is what will really set this one apart. What would be really nice if we could work out a way to track the tags.

1 Like

Agreed – the kernel modules are the easy part, which is well covered by other tutorials. Getting zed and auto-import working are the harder parts. Thanks for the feedback! After frustration with corruption under BTRFS on CL (and every other linux, for that matter, it’s not Clear’s fault), I found ZFS to be much more pleasant and stable.


Thanks for your work on this @peteonrails!


thanks to you @peteonrails I now have my goto workstation abstracted away from the hardware, no longer a pet and it’s neatly tucked away in a vm backed by zfs on the same machine. :smile: I cloned the drive into a zvol. Now I can reboot the the workstation without interrupting tasks or ever taking the underlying hardware offline. Also I can snapshot and fork tasks into a new vm while periodically sending snapshots offsite!


Very nice! Looking to do something similar on my dev server