In this tutorial we build a completely open Storage Server using open source technologies.

OpenZFS will be installed from source as it doesn’t form part of the official CentOS repository. Installing from source does add additional complexity in the installation process but it provides us with much more flexibility and control over the file system.

Operating System: CentOS Linux v7.5 (Build 1804)
Download Link:

File System: OpenZFS v0.7.9
Download Link:

Operating System Installation

A graphical user interface won’t be required for this setup, all configurations will be performed using command line, the recommendation is to perform a minimal installation of CentOS, this will reduce the patching required and minimize the security exploits. A guideline for the operating system partitioning scheme is specified in the table below, please note that this is for a minimal installation only, if you plan on installing a graphical user interface, additional applications or workloads, the partition sizes may differ. Use the partitioning scheme below as a guideline.

Operating System Partitioning
Partition File System Size
/boot/efi EFI System Parition 200MB
/boot xfs 2048MB
/ xfs 32768MB
/var xfs 8192MB
swap swap 2048MB
Operating System Configuration

Perform a minimal installation of CentOS, although a graphical environment can also be installed but it’s not really required since all configurations will be perform using commands. Once the operating system has been installed, network configurations will be performed such as setting the host name and IP Addresses on the network interface cards.

Set a static hostname to the operating system

hostnamectl set-hostname "[fully qualified domain name]" --static

[Example] Setting a hostname to the operating system

hostnamectl set-hostname "" --static

Update the operating system to the latest kernel and libraries

yum update -y

Once the update has been completed, restart the server


Install additional libraries that will be required for compiling OpenZFS and server configurations

yum install -y wget gcc kernel-devel zlib-devel libuuid-devel libblkid-devel libattr-devel ntp
Time Synchronization

Ensure that the operating system is synchronized against a reliable and accurate time server.

Enable and Start the network time protocol service

systemctl enable ntpd.service --now

The default NTP configurations contain time servers which can be synchronized against, however, they can be changed to synchronize against specific sources.

Default NTP Sources:

server iburst
server iburst
server iburst
server iburst

To add a specific NTP source, add an entry in the /etc/ntp.conf file in the following format

server [IP Address or FQDN of NTP source]

[Example] Using a hostname as the NTP Source


[Example] Using an IP Address as the NTP Source

OpenZFS Installation and Configuration

We need a working directory which will be used for storing and build the OpenZFS file system, any directory can be used. In this example we create this working directory in the root file system called “software”.

mkdir -p /software/{zfs,spl}

In order to install the OpenZFS File System, we need 2 components, the Solaris Portability Layer (SPL) Source Files and the Z File System (ZFS) Source files. Prior to compiling and installing OpenZFS, the Solaris Portability Layer (SPL) must be built and installed.

Download the Solaris Portability Layer (SPL) Libraries

wget -P /software/spl/

Download the OpenZFS Libraries

wget -P /software/zfs

Extract both the Solaris Portability Layer and the OpenZFS Libraries

tar -zxvf /software/spl/spl-0.7.9.tar.gz -C /software/spl/
tar -zxvf /software/zfs/zfs-0.7.9.tar.gz -C /software/zfs/

Compile and install the Solaris Portability Layer (SPL)

cd /software/spl/spl-0.7.9
make install

Compile and install OpenZFS

cd /software/zfs/zfs-0.7.9
make install
Note: Both the Solaris Portability Layer (SPL) and OpenZFS were installed using the default configurations. Due to these being installed from source, a lot of options can be changed such as the installation directory and so on. To view all the configuration options, navigate to the source files and execute the command: ./configure –help

Enable and Start OpenZFS Services

systemctl enable zfs-import-cache.service --now
systemctl enable zfs-import-scan.service --now
systemctl enable --now
systemctl enable zfs-mount.service --now
systemctl enable zfs-share.service --now
systemctl enable zfs-zed.service --now

Prior to creating the ZFS File System and allocating drives to it, ensure that there is are no existing partitions or metadata on those drives. This is especially true if the disks were previously used.

wipefs -a -f /dev/[disk number]

[Example] Clearing a single disk

wipefs -a -f /dev/sdb

[Example] Clearing a multiple disks

wipefs -a -f /dev/sdb /dev/sdc

[Example] Clearing a range of disk from /dev/sdb to /dev/sdm, in total 12 disks

wipefs -a -f /dev/sd{b..m}

Create ZFS File System on disks

zpool create "storage" -m "/storage" /dev/sd{b..m}

List ZFS File Systems

[root@storage bomc]# zpool list
storage    87T   504K  87.0T         -     0%     0%  1.00x  ONLINE  -