How to cache a ZFS pool, Unraid 6.10.2

Ok so first time using unraid, I’m finally getting an understanding of unraid and I’m so close to purchasing my license.

My one last issue is trying to cache my ZFS pool.

So my config is the following:
Unraid Array: 1 x 32gig flash drive
Cache Pool: 1 x 1TB SSD
ZFS pool: 3 x 16tb HDD is raidz

So from what I’ve seen, I can only cache shares that are stored on the array.

I have tried creating a symbolic link from the zpool to a share on the array. The initial zpool directory linked to the share as well as files i put into the folder after linking then get stored on the cache. However once the mover is run and the symlink folder is moved off the cache pool. Any new files copied to the zpool despite having a symlink to the cached share are not cached.

Any help on this would be appreciated.

Welcome aboard!

I don’t know much about Unraid or its GUI, but I know zfs.

I assume Unraid has some kind of CLI as it is a linux system under the hood.

When we’re talking about L2ARC (read cache), there is a simple command which is all you need to add a drive as L2ARC to your pool: zpool add *poolname* cache *disk* . Be sure that the SSD isn’t used elsewhere.

so something like zpool add tank cache /dev/sdb is all you need. zpool status tank should list the cache device from now on.


That is exactly what i was looking for thanks so much man

Keep in mind that once you reboot, the cache drive gets reinitialized and basically wiped. I assume your ZFS version is more or less up to date and supports “persistent L2ARC”, which let’s you keep your cache after power off or reboot. To enable this, you have to set the tunable (assuming debian system) /sys/module/zfs/parameters/l2arc_rebuild_enabled to “1”

I’m running zfs on ubuntu and TrueNAS myself, so I don’t know how unraid is doing things that are non-standard. But should work.

Really is a great feature and also produces much less wear on the SSD because ZFS doesn’t have to write similar data on every reboot and avoids cold cache scenario after a restart.

If you see that there is data on the SSD after reboot and/or see “rebuild successful” during boot log, it’s working.

In general, give the system some time to fill your SSD with data. ZFS optimizes the cache automatically over time, so that 1TB will eventually consists of the most important and most frequenty used data, resulting in many cache hits.

1 Like