
ZFS for Linux - bcbs
http://www.linuxjournal.com/content/zfs-linux
======
l1ambda
I keep hearing that the GPL and CDDL are incompatible. But repeating something
doesn't make it true. And I have read both licenses, and have come to the
conclusion that they're unlikely to be incompatible in the first place.
Unfortunately, every time this line of argument come up, it tends to get
buried in discussion.

The basis of the incompatibility claim seems to be from 3 arguments:

1) Statements from the FSF website, but those have no legal bearing against
the actual text of the licenses

2) Claims that the CDDL was engineered to be incompatible with the GPL, again,
it's an interesting hypothesis but has little bearing against the actual text
of the licenses

3) Derivative Work argument from the GPL. This seems to be the only one that
could hold water; however, I doubt that a court would find ZFS to be
derivative work of the Linux kernel.

Furthermore, even if you argue that the "derviative work" clause makes them
incompatible, there’s no way actually to prosecute such a violation. Copyright
law is something called a tort in law, which means you have to show that
someone violated the rules AND also caused quantifiable harm. What would our
theory of harm be? ([https://blog.hansenpartnership.com/are-gplv2-and-cddl-
incomp...](https://blog.hansenpartnership.com/are-gplv2-and-cddl-
incompatible/))

~~~
temprature
Actual lawyers have also read both licenses and came to the conclusion that
they are incompatible: [https://sfconservancy.org/blog/2016/feb/25/zfs-and-
linux/](https://sfconservancy.org/blog/2016/feb/25/zfs-and-linux/)

The main debate over the incompatibility isn't about GPL vs CDDL; even
Canonical isn't arguing that the licenses aren't incompatible. It's
specifically about the Linux kernel vs ZFS; ie. does linking the ZFS module
with the Linux kernel make the ZFS module a derivative work of the Linux
kernel.

If yes, it has to be able to have the GPLv2 applied to it, which it can't. If
no, then the incompatibility is irrelevant, and the kernel and ZFS can be
distributed together and under their own separate licences. This is where
opinions (by legal experts, not people on the internet) differ, the FSF and
SFC's lawyers say this makes ZFS a derivative work and you can't distribute
them together, Canonical's lawyers say it doesn't and therefore you can.

~~~
LeoPanthera
I'm surprised there isn't a one-click way for the user to build their own
kernel with ZFS inside it.

As long as I don't distribute the resulting binary there should be no legal
implications.

~~~
jradd
DigitalOcean[1] has a one–click option to compile FreeBSD kernel with ZFS
configured (for what its worth).

edit: including my referral link here will probably result in negative karma,
but i'm desperate for points!

[1]: [https://m.do.co/c/8c882a721944](https://m.do.co/c/8c882a721944)

~~~
jsiepkes
FreeBSD isnt GPL licensed but BSD and therfor has no licensing issues.

------
phen0l
The author seems very confused about the provenance of ZFS. The ZFS that is in
ZFS-for-Linux is OpenZFS, the open-source version, not Oracle's. OpenZFS is
what's in FreeBSD and illumos and ZFS-on-Linux and so on and so on, and it is
most definitely not under any form of Oracle control.

~~~
exikyut
So, just to be clear, the hand-wavy idea I got at some point that there were
multiple major implementations is actually wrong?

As an aside, _are_ there any independent implementations?

~~~
cmurf
There's Oracle Solaris ZFS. Since Solaris has been killed off, this original
variant of ZFS is finished unless relicensed.

OpenZFS is a fork, and is the upstream for Illumos, FreeBSD, Linux and macOS
and all share the same on-disk format. The exact heirarchy, I think it's
Illumos and FreeBSD as essentially co-equal upstreams, then ZoL (ZFS on
Linux), and macOS is downstream of ZoL. I wouldn't call them different
implementations.

zfs-fuse I _think_ is based on the original. [https://github.com/gordan-
bobic/zfs-fuse](https://github.com/gordan-bobic/zfs-fuse)

------
StillBored
The lack of RAIDz expansion is a real deal killer now that its possible to
expand normal linux RAID/LVM/filesystems.

RAID/filesystem expansion is probably the #1 thing that in the past was a huge
PITA. These days its possible to reshape a linux array with a single add/grow
option to mdadm after installing a new disk.

~~~
jlg23
Some are working on it: [https://www.freebsdfoundation.org/blog/openzfs-raid-
z-online...](https://www.freebsdfoundation.org/blog/openzfs-raid-z-online-
expansion-project-announcement/)

------
cmurf
Couple of small gripes: a. Using fdisk to undo partition is not the correct
way to unpartition a drive. You should tear down the layers of a drive's
storage in the reverse order they were created, by using wipefs to remove the
signature for that layer, so wipefs each partition and then wipefs the drive
to remove the partition map itself (there are two signatures on GPT
partitioned drives). The suggested method leaves all of the signatures intact,
fs and partition map, and can cause later confusion.

b. Near as I can tell, upstream GRUB supports ZFS. The article cites a 2011
freebsd thread. [http://git.savannah.gnu.org/cgit/grub.git/tree/grub-
core/fs/...](http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/fs/zfs)

------
buu700
Has there ever been a serious community effort to relicense ZFS? Intuitively,
that feels like it would have been a much more worthwhile effort from the
start than trying to recreate it from scratch in the form of btrfs.

Is that a reasonable idea? What would it take for someone to go about it
today? I would expect that it would be possible if every copyright holder (I'd
guess mainly developers and their current/past employers, next of kin,
estates, etc.) were asked to sign a document collectively consenting to having
ZFS's license changed.

Or is there a reason that some current copyright holders might not want that?
I get why Sun would've refused since it was a competitive advantage for
Solaris, but what's stopping it from happening now?

This whole situation just seems really silly as I'm not sure what anyone has
to gain from it.

~~~
chungy
Oracle holds the copyright on much of OpenZFS. They'll have to agree to
relicensing it first.

With Solaris dead I'd generally agree that it's a little pointless to keep it
incompatible. They might as well just place it under something like BSD or
Apache 2, that should keep the FreeBSD and Mac OS X ports happy as well as
opening up the possibility of inclusion in the Linux kernel. With Oracle
Solaris dead, I think there's even a case for Oracle's bottom-line: they could
start including ZFS with Oracle Enterprise Linux and boast about all the
advantages of using it there.

~~~
jlgaddis
> _"... they could start including ZFS with Oracle Enterprise Linux and boast
> about all the advantages of using it there."_

As the copyright holder, can't they do that anyway?

By not relicensing it, they keep others -- Canonical, Red Hat, etc. -- from
being able to do the same thing.

------
oneplane
The legal issues are annoying, but ZFS on Linux has been running quite well
for years now. Not sure what the 'news' part is here.

~~~
greenhouse_gas
The problem is that it isn't upstream, so having it as a rootfs is somewhat
dangerous - you need a custom initramfs).

~~~
rleigh
Works automatically on Ubuntu. I'm writing this on a Linux system with ZFS on
root which has worked perfectly for nearly two years now.

------
mitchtbaum
See also: TFS: A file system built for performance, space efficiency, and
scalability

[https://github.com/redox-os/tfs](https://github.com/redox-os/tfs)

[https://news.ycombinator.com/item?id=14386331](https://news.ycombinator.com/item?id=14386331)

------
joshbaptiste
I'm hoping BcacheFS will be the next COW FS to take over this space in Linux.

------
nickik
Has anybody managed to run native encryption root and boot system with Linux
yet? That would be really cool.

~~~
pritambaral
I tested that out for an embedded product. It works, and while some things
could be better, the biggest hurdle is that since it's not stable yet it can't
be shipped. A stable release could be supported for years, but native
encryption being unstable means issues like this[0] would be showstoppers.

0:
[https://github.com/zfsonlinux/zfs/issues/6845](https://github.com/zfsonlinux/zfs/issues/6845)

------
andbberger
I had a lot of 'fun' trying to get a ZFS root on ubuntu a couple months ago.

Not my brightest idea.

Ended up having a small XFS root partition and putting everything else on ZFS.
Works great, but I don't look forward to the day when my root filesystem
fails.

~~~
secabeen
Yep. I have a number of ZFS machines, and I always put root on ext4 (or ext4
on md), and just use ZFS for user data partitions.

~~~
swinglock
ZFS root works fine on NixOS.

[https://nixos.wiki/wiki/NixOS_on_ZFS](https://nixos.wiki/wiki/NixOS_on_ZFS)

------
jiqiren
"Definite legal ambiguity remains with ZFS"

This seems to be the biggest problem with ZFS. Even Apple ditched ZFS on
macOS.

ZFS is slowing down and impacting the real alternative: btrfs. IMHO Red Hat
should be ashamed for abandoning btrfs. ‍️

~~~
mbreese
I'm not sure I blame Red Hat all too much in this.

Both ZFS and btrfs are owned/driven by Oracle. When Oracle bought Sun (and
ZFS), it seemed like the pace of btrfs slowed significantly. I'm not sure what
Oracle really wants to do in this situation, but they are clearly in the
driver's seat.

(This is also alluded to in the article)

~~~
2trill2spill
> Both ZFS and btrfs are owned/driven by Oracle.

While ZFS is owned by Oracle they certainly don't drive development. Oracle
has their closed source version of ZFS used in the now dead Solaris. Then
their is OpenZFS which is where the majority of research and development takes
place and where Illumos, FreeBSD, MacOS and Linux developers upstream their
work.

~~~
ansible
And, from one of the linked articles, SuSE is the biggest contributor to
btrfs.

We've been running btrfs in production for our small shop for a couple years.
We've had one incident, but not too many problems, really.

Though, next time, I might not be using btrfs RAID-1, and instead use the
regular MD. I'd still want the on-disk checksums for data, and the snapshots,
which are awesome.

~~~
mbreese
But when Oracle bought Sun, I'm fairly certain Oracle was _the_ driver.
(Didn't they employ the initial developer?)

SuSE just doesn't have the same level of resources that Oracle can bring to
bear. At the time, btrfs was a crucial feature for the next version of Linux
_because_ of ZFS. When Oracle bought Sun, that competitive pressure was gone.

------
devereaux
Optimizing on the filesystem is interesting, but the underlying hardware
should not be neglected -- and benchmarks should be done before anything else!

I recently needed a large and fast SQL database. I decided to start by doing
some simple tests with dd and some more advanced ones with fio.

On a very decent AMD EPYC 7401P 24-Core with 128G of ram and 6 NVMe drives, I
found that performance started declining once I added the 6th drive.

Based on my benchmarks, the most I can get out of this machine is about 4GB/s
in read/write performance. This makes me suspect it is the speed limit from
the CPU to the PCH.

So instead of this 1 server, I will deploy a cluster of smaller servers each
equipped with 2 NVME and hope the network drivers do a decent job (just
checked the dmesg: eth2: (PCIe:5.0Gb/s:Width x4)

~~~
praseodym
The AMD Epyc 7401P you’re using has 128 PCIe 3.0 lanes, which can provide way
more bandwidth than the 4Gbps figure you’re getting (8 Gbps per lane, so 1024
Gbps on paper). The AMD Epyc platform has been benchmarked at 57 GBps (bytes,
not bits) of random storage bandwidth: [http://www.legitreviews.com/one-amd-
epyc-processor-reaches-5...](http://www.legitreviews.com/one-amd-epyc-
processor-reaches-57-gbs-of-random-storage-bandwidth_195653)

There’s simply no way a PCIe x4 NIC is going to be able to compete with the
bandwidth available within that server.

~~~
devereaux
I just can't get such results at the moment, so I am trying some creative
solutions to get over the limit I'm hitting.

Would you have some suggestions to diagnose the issue better?

------
greenhouse_gas
.

~~~
chungy
There's some ZFS whitepapers that explain the data structures in a code-free
way ;)

Not to mention the GRUB driver. It's GPLv3 but I wouldn't be surprised if the
GRUB project is willing to relicense it for a Linux kernel port.

