Thoughts on ZFS on Linux

Hi all,
So I am wanting to experiment with ZFS via Arch VM (mainly due to docs) and was wondering if anyone had tried using it?
I understand dkms will be needed and some tweaks to pacman.conf will be required.

Have you had good experience with it or has it simply failed?

Thanks

I've been running Ubuntu on a laptop and a desktop/server (both 8-10 yrs old) for a few months now and they both operate on native zfs for everything. No problems other than the somewhat laborious initial setup and associated learning curve.

I'm quite surprised at the performance, honestly, given what people say about its system requirements.

Laptop is C2D and server is C2Q with 3.3GB and 8GB RAM respectively. I say do it.

But what about with kernel updates, reason being is they require dkms and could be wrecked at boot as ZFS cannot be native in Linux due to CDDL.
Also what performance have you noticed?

That is an excellent question; however, I haven't gone through enough updates to be able to answer that. I do know that I read Ubuntu 16.04+ specifically supports ZFS natively, so no zfsoL to install root on it.

Other than that, I can't say. No idea if what I heard about native support applies in this case or if it works differently.

I would expect Ubuntu is either using dkms when specific options are selected and additionally some flags in apt (Providing it works in a similar fashion in the configs to Arch)

My Debian server uses ZoL and it's been great. Deployed July 2015 or so. I've had power losses that corrupted my boot partition. My boot drive failed and went berserk several months ago. I've reinstalled Debian, with and without gracefully exporting the pool first. I've upgraded it from a mirror (Raid1) to a pair of mirrored vdevs (Raid10). I've had it take snapshots every night for months, it still only takes a second or two to snapshot the entire pool. I'm using Toshiba 3TB SATA consumer drives, no enterprise stuffs. In spite of all this, I've never had a single error from the zpool, any file corruption, or any nonsense.

Bloody thing just works. I did tweak the RAM allocation so it uses 8GB max out of my 16GB, but that's the only experience that wasn't "it just works" for me. Based on the output of some console commands, my 50% full ~5TB usable pool only NEEDs like 400MB to mount. The rest is just caching, so if you only have a few GB to spare that should be fine. Even without ram caching, it's pretty speedy considering all the redundancy and robustness it's dealing with in the background. RAM caching is glorious, I had a 4GB flash drive die and I only wanted on config file from it. I dd'd the flash drive to the pool, and was able to grep the entire 4GB image in a few seconds to find my file because the image was cached in RAM.

I haven't tried booting from ZoL, data recovery, or replacing disks. Those are very important when considering a long-term storage solution, but if you're just playing around you might as well make a mirror, load it up, and start yanking drives and see what happens. I keep a cold spare drive in my server, it's also a good idea to have a cold backup that you update periodically. Based on Wendell's coverage of ZFS on TekSyndicate and it's various daughter channels, I think ZFS is the way to go for most applications.

Following the directions on the ZoL website, ZoL updates itself and the kernel with apt-get without any additional intervention.

I started to use ZFS on Arch 2 months ago. The only concern I have really come across is DKMS installing the modules in the wrong order. If zfs is installed before spl then zfs will fail to install correctly. If that happens you can run dkms autoinstall or run the same command that the update process used (eg dkms install -m zfs -k 4.8.8-1-ARCH). This has happened to me twice over 4 different systems. One of those two was running the LTS kernel. I should also note that one of the four systems, not one of the two with an update issue with DKMS, is a root on ZFS system done with Antergos and its install option for ZFS. All four systems have been solid aside from the incorrect order with DKMS installation of the modules.

Wait excuse my noob question but im confused by people differentiating between native and zfs on linux. Isnt zol kind of native?

Not 100% sure, but I think they are the same thing. I think initially there was only "ZFS on FUSE" to bypass a licensing issue with gpl and later they made a port called "Native ZFS on Linux" and distributed via packages abbreviated zol or zfs on linux. Unbutu 16.04+ also supports native zfs, meaning you don't need to third party packages to get zfs.

So to give some information on the Ubuntu situation.

ZFS was ported to Linux by the Lawrence Livermore National Laboratory becasue they wanted to use it on their supercomputers. The code was ported from opensolaris, and typically relied on compilation to get it installed on Linux.

For Ubuntu an excellent PPA has been existing for years. It provided zfs as source and used dkms to compile it when kernel upgrades and the likes were done. Kernel upgrades do not break dkms: the upgrade process will recompile the drivers provided using dkms. This is the exact reason for dkms, to provide for a waterproof system.

Starting with Ubuntu 15.10, Canonical made the choice to include pre-compiled zfs modules in Ubuntu. The source of these modules is exactly the same as the earlier PPA. In fact, the same people supporting that PPA were or are involved in supporting it in Ubuntu. Furthermore, Ubuntu did improvements wrt. to grub and other packages that now allows for 100% native zfs systems (having both / and /boot on zfs). The installer however does not allow these kind of installations (yet?) but you can find excellent guides on converting your existing installations to zfs.

The kernel/module/license discussion I will avoid here :-) As a summary Canonical claims that since the zfs module is not included into the kernel but coexists with it, it does not breach the license. Others disagree.

If you are on LTS it is important to know that you have to install HWE kernels to get newer versions of zfs. If not you might be stuck with the zfs version at installation time, and zfs is still moving forward very fast. See https://wiki.ubuntu.com/Kernel/RollingLTSEnablementStack

Whetever you decide to do one tip: keep an Ubuntu LiveUSB at hand, as it will give you zfs functionality to troubleshoot without hassling with installations and compiling in the Live USB session.

2 Likes