ZFS: setting up a mirror with ZIL and L2ARC optimizations


David Fava

David Fava


RxJS scheduler 16th January, 2019

How to remove unused Docker images. 24th September, 2018


ZFS: setting up a mirror with ZIL and L2ARC optimizations

Posted on .

I have always been a big fan of ZFS and had the opportunity to set up a Solaris network backup server with data deduplication. It was the time when I was running my small VPS business and needed to be able to make live snapshots of our clients VPS disks. ZFS and its data deduplication feature saved the day!

Anyway, back to present. New PC at home with Kubuntu and I need a lot of fast storage to keep up with Parity heavy IO requirements.

I am going to set-up a ZFS mirror with dedicated L2ARC and SLOG devices.


Install zfs:

First, I am going to get the IDs of the drives to add to the zpool:

Now, I am going to create a mirror pool named data with those two 3TB Toshiba HHDs:

A short explanation about the above command:

ashift=12 For Advanced Format Disks with 4KB sector size, an ashift of 12 is recommended for best performance.
-m will mount our zpool at /home/whitenoise/data/

Finally, I gong to add a caching SSD disk for the L2ARC and ZIL. The ZIL disk is definitely oversized for what I need but this is what I have available now:

and check the zpool status:

Everything seems to be OK.

The zfs daemon is capable of loading a zpool and mounting it at boot. In order to do this we need to setup a cache file, then enable the zfs daemon.

We can also active compression and atime with:

Compression has a low CPU footprint so you should have it active.


Now, I am going to tune the L2ARC device by adding the following to /etc/modprobe.d/zfs.conf

To get a full list of configurable options:




David Fava

David Fava

There are no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

View Comments (0) ...