The professional filesystem ZFS

In Practice

Because of the licensing issues, the integration of ZFS in the Linux universe is currently proceeding very hesitantly. Existing solutions are only suitable for use in larger environments, and most desktop distros still don't support ZFS.

Canonical stirred up much dust with its announcement to integrate ZFS in Ubuntu 16.04 LTS. On closer investigation, this "integration" turns out to be far from finished; even power users are likely to fail when faced with the practical implementation.

The Ubuntu Installer Ubiquity lacks an option for using ZFS when setting up the mass storage. Users, instead, need to switch to the command line and set up the entire system manually. Completing the configuration requires good knowledge of the nomenclature and workings of ZFS. Users of Ubuntu and its official derivatives will find a guide to installing with virtualized containers on the Internet [7].

The Arch derivative Antergos has distinguished itself as a pioneer of ZFS integration on the Linux desktop. Without much media fanfare, the Antergos developers have integrated ZFS on the basis of OpenZFS and also modified the Cnchi installer.

Although Cnchi does not allow users to harness the full capabilities of ZFS, it does provide an easy option for using the operating system with ZFS out of the box. You can then define further configuration options, if required, at the command line. During the installation of Antergos from within the Live system, you first define whether you want to use ZFS with your own home volume (Figure 1).

Figure 1: ZFS is already fully integrated with the new Cnchi Installer on Antergos.

In a further step, the installer then prompts you for the basic filesystem parameters (Figure 2). You can specify the block size and define the ZFS operating mode, from a selection list in Pool type. Various RAID levels are available, so you can also enable mirroring or striping in systems with multiple physical storage media.

Figure 2: Users set up basic options, such as the RAID level or block size, in the Antergos Installer.

Please note that Cnchi is context sensitive: Faulty or incompatible settings prevent users from moving to the next step, which is done, in each case, by clicking on the right arrow at top right in the install window. It is thus impossible to define a RAID level as the pool type for computers with only one physical storage medium: In this case, the corresponding option must stay set to None.

Antergos also sets up a swap partition without further intervention. The installer automatically configures the GRUB boot manager on legacy BIOS and on EFI systems, thus removing the need for manual adjustments. The routine also creates a 512MB boot partition formatted with ext4.

During the first reboot after installation, you need to avoid calling the alternative kernel variants, which Antergos offers in the GRUB boot manager in addition to the default kernel: These options do not include ZFS support and therefore cause an immediate crash.

Details

After the initial setup, you then configure the ZFS parameters at the command line if necessary. For example, you can specify features such as data compression and quota definitions.

Just two commands – zfs and zpool – let you configure and manage your ZFS filesystem. The zfs command configures the filesystem and zpool manages the disks. To enable data compression for a storage pool, type the following command at the root prompt:

# zfs set compression=on pool_name

If you created multiple storage pools, you can find the one you need, including its current status data, with the zpool list command. After a system reboot, query the compression rate by typing the command:

# zfs get compressratio pool_name

The command shows the data in clear text in a neatly arranged list. Compression rates that can be achieved for previously compressed data, such as images or video and audio files, are low. The compression feature works much better with plain text files (Figure 3).

Figure 3: ZFS supports compression and deduplication.

Deduplication

ZFS also supports efficient mechanisms for data deduplication. This technique is used to avoid the redundant storage of data, which also saves space. You can enable data deduplication using the command:

# zfs set dedup=on pool_name

To determine the duplication rate in the further course of working with the filesystem, use the following command:

# zpool get dedupratio pool_name

Clearly noticeable deduplication rates are usually only obtained with memory sizes of more than 4GB and several pools. Larger installations, in which multiple virtualized operating systems work in containers, are better suited for deduplication than desktop PCs with just one pool.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • ZFS on Linux

    License issues prevent the integration of ZFS with the Linux kernel, but Linux users can try the highly praised filesystem in userspace.

  • Red Hat to Drop Support for Btrfs

    The company is building their own storage solution called Stratis.

  • Managing Linux Filesystems

    Even with all the talk of Big Data and the storage revolution, a steady and reliable block-based filesystem is still a central feature of most Linux systems.

  • Btrfs

    The Btrfs filesystem offers advanced features such as RAID, subvolumes, snapshots, checksums, and transparent compression, but do desktop users really need all that power?

  • Snapshot Tools

    Experts agree that you should keep a copy of your data, but restoring from incremental backups takes time and sometimes doesn't work as expected. Alternatively, you can capture your data in a snapshot. Read on for a review of some leading Linux snapshot tools.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News