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).
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.
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).
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.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs