Complete Guide: Step 7 - Setup L2ARC (ZCache) and ZIL (Log)
Next we need to add ZCache and Logs to your pools. Simplistically, these becomes your read/write buffer to your zpool and will improve the performance (and may prevent data loss from a sudden power cut). The virtual disks you create should reside on the NVMe storage. I’m using a 16G drive for each pool, of which 2G will be used for logs, and the remaining 16GB for cache.
First, go to the NAS UI, under Storage -> Disks, identify the drives for caching. These drives should be easily identifiable because they have no serial numbers. In my exmaple it will be da4. Change the following commandlines accordingly to match.
SSH to your NAS, or you can get a browser shell if you log in to the NAS WebApp (>_ Shell).
The disk will have no partition information, so the first thing to do is to run this:
gpart create -s gpt da4
Next we create the ZIL partition. I’m using 2G in my setup, you can choose a smaller value if you like.
gpart add -a 4k -b 128 -t freebsd-zfs -s 2G da4
Next create a partition and use all remaining space. This will be your ZCache.
gpart add -a 4k -b 128 -t freebsd-zfs da4
Now find the UUIDs
gpart list da4
Look for the fields rawuuid. Now add them to your pool. My pool is called ‘data’, replace the name with your zpool name:
zpool add data cache gptid/[rawuuid_of_cache]
zpool add data log gptid/[rawuuid_of_zil]
Once complete, run this command to verify everything is correct:
You can monitor your zpool IO with this command:
zpool iostat -v
Deprecated: mb_strrpos(): Passing the encoding as third parameter is deprecated. Use an explicit zero offset in /var/www/snakeoil/inc/_ext/_url_rel2abs.php on line 157