📜 ⬆️ ⬇️

zfsonlinux - easy and simple

zfsonlinux

Linux users have for some time been able to use ZFS without resorting to FUSE, i.e. in the core.

The many restrictions that FUSE imposes (primarily performance constraints; google can ask about the rest) do not allow using ZFS via FUSE in most of the emerging tasks.
')
Among other things, ZFS code cannot be included in the source tree of the Linux kernel, as many already know, due to the incompatibility of the CDDL license with the GPL, and this greatly affected the penetration of ZFS into Linux systems.

But more recently, the development of the zfsonlinux project, whose developers ported ZFS code from Solaris in the form of kernel modules for Linux, has reached a development point where you can use ZFS in Linux without much effort and with a sufficient level of stability.

How exactly to use zfsonlinux (using the example of rhel / centos / scientific linux 6) can be found in the article below.


Few words about ...


There is no doubt that you need to be aware that the zfsonlinux project is still in the pre-release stage, when any unpleasant and unexpected surprises are possible, so the range of tasks in my case allows for the loss of data stored on ZFS.

Judging by my experience and on the mailing lists (people write there that they use ZFS and everything works without problems) zfsonlinux does not fall and does not break everything, but it works like this and started to use it.

For acquaintance with the project zfsonlinux (or as it is also called on the mailing lists - zol) it is recommended to study the materials of the site zfsonlinux.org and materials on ZFS, which are abundant in google.

After reviewing the project site, the following can be concluded:
- zfsonlinux is seriously aimed at use together with the Luster file system;
- LLNL is mentioned in the materials of the site;
- whois of the zfsonlinux.org domain also refers to this national US laboratory ;
- serious people are engaged in the project for serious purposes (some kind of shantrap :-)).

At the time of this writing, the tarballs for the zfsonlinux project are version 0.6.0-rc11 and they were published on September 17, 2012.

To use ZFS, you will need the zfs-modules-dkms-0.6.0-rc11.noarch and spl-modules-dkms-0.6.0-rc11.noarch packages , which contain the source codes of the ZFS and SPL modules (Solaris Porting Layer). These modules will be automatically assembled and installed using the DKMS system.

You will also need the zfs-0.6.0-rc11.src.rpm packages for the x86_64 architecture, and spl-0.6.0-rc11.src.rpm packages , which contain userspace utilities for working with ZFS (zfs, zpool) and other components, necessary in user space (udev rules, for example). Unfortunately, the project developers do not provide binary builds of these packages, so if necessary, you should arm yourself with rpmbuild / mock and build the packages yourself (which I did - see below).

Fast and easy


To quickly deploy a server with ZFS for my needs, I made a yum repository that contains all the necessary packages.

So, to get a server with ZFS in distributions of RHEL / CentOS / Scientific Linux (we are talking only about version 6 (!)), You need to do the following.

Install the repository and import my public GPG-key with which the packages are signed:
# cd /etc/yum.repos.d/ # wget http://yum.aclub.net/pub/linux/centos/6/umask-zfsonlinux/umask-zfsonlinux.repo # rpm --import http://yum.aclub.net/pub/linux/centos/5/umask/RPM-GPG-KEY-umask 


Go to the EPEL project page and get a link to the latest version of epel-release package from there, then install this package:
 # rpm -i http://mirror.astpage.ru/epel/6/i386/epel-release-6-7.noarch.rpm 


Install the DKMS and the necessary packages for building kernel modules:
 # yum install dkms gcc make kernel-devel 


Finally, install the zfs and spl packages, which in dependencies require installation of the zfs-modules-dkms and spl-modules-dkms packages (the installation will take 5-10 minutes (of course, depends on the server's capacity), because during the installation the modules will be compiled ):
 # yum install zfs spl 


Enable the zfs service, which loads the modules and mounts all the ZFS partitions (by default, this service is in the automatic launch state, but if something changes, this step will not be skipped):
 # chkconfig zfs on 


At this step, the system is ready to use ZFS, but just in case I always try to perform a reboot (you can get by, but you don’t want to remember why the server did not boot up or why the kernel panics) after such changes.

Now you can create the first pool:
 # zpool create tank mirror /dev/sdc /dev/sdd 


The pool will be automatically mounted in the / tank directory.

ZFS is ready to use!

ZFS vs. BTRFS


In fact, BTRFS fits in with my tasks “wholly” (such as :-)):
- there is a compression;
- support for raid1 (subsequently the raidz functions from ZFS were required);
- presence in el6 (technology preview).

But:
- BTRFS is unstable and is still not recognized as stable in the mainline kernel (my experiments about el6 eliminated the possibility of using this file system for my tasks about a year ago - mostly just bugs and glitches);
- there is still no deduplication in BTRFS;
- in BTRFS there is no support for anything but mirror, stripe, stripe + mirror;
- ZFS is considered stable for a long time in Solaris;
- ZFS looks more mature (subjectively, perhaps), even though zfsonlinux is a port with its potential problems and nuances.

Instead of conclusion


The developers of zfsonlinux to the question of how they can be helped often answer “just start using zfsonlinux”, so I hope that this article will allow someone to do it without difficulty.

Source: https://habr.com/ru/post/152853/


All Articles