Using boot drive space for write cache?

Sorry if this has been covered somewhere. I’m new to this.
I’ve seen setups that use a disk, usually an SSD, as a cache. The idea I think is to write to a faster drive before data is moved to the pool.

My DIY setup is like this: 512GB nvme boot drive and 4 x 1TB HDD’s for the pool raidz1. Can I use some space on the nvme boot drive for this?

admin@truenas[~]$ df -BM
Filesystem 1M-blocks Used Available Use% Mounted on
udev 31825M 0M 31825M 0% /dev
tmpfs 6399M 8M 6391M 1% /run
boot-pool/ROOT/24.04.0 451321M 165M 451156M 1% /
boot-pool/ROOT/24.04.0/audit 451157M 1M 451156M 1% /audit
boot-pool/ROOT/24.04.0/conf 451157M 1M 451156M 1% /conf
boot-pool/ROOT/24.04.0/data 451157M 1M 451156M 1% /data
boot-pool/ROOT/24.04.0/etc 451162M 6M 451156M 1% /etc
boot-pool/ROOT/24.04.0/home 451156M 1M 451156M 1% /home
boot-pool/ROOT/24.04.0/mnt 451428M 272M 451156M 1% /mnt
boot-pool/ROOT/24.04.0/opt 451230M 75M 451156M 1% /opt
boot-pool/ROOT/24.04.0/root 451157M 1M 451156M 1% /root
boot-pool/ROOT/24.04.0/usr 453323M 2167M 451156M 1% /usr
boot-pool/ROOT/24.04.0/var 451188M 32M 451156M 1% /var
boot-pool/ROOT/24.04.0/var/ca-certificates 451156M 1M 451156M 1% /var/local/ca-certificates
boot-pool/ROOT/24.04.0/var/log 451182M 26M 451156M 1% /var/log
tmpfs 31991M 1M 31991M 1% /dev/shm
tmpfs 100M 0M 100M 0% /run/lock
efivarfs 1M 1M 1M 31% /sys/firmware/efi/efivars
tmpfs 31991M 0M 31991M 0% /tmp
boot-pool/grub 451165M 9M 451156M 1% /boot/grub
Main 2429872M 1M 2429872M 1% /mnt/Main
Main/XPSnas 2436260M 6388M 2429872M 1% /mnt/Main/XPSnas
Main/.system 2431127M 1255M 2429872M 1% /var/db/system
Main/.system/cores 1024M 1M 1024M 1% /var/db/system/cores
Main/.system/samba4 2429873M 1M 2429872M 1% /var/db/system/samba4
Main/.system/configs-ae32c386e13840b2bf9c0083275e7941 2429874M 2M 2429872M 1% /var/db/system/configs-ae32c386e13840b2bf9c0083275e7941
Main/.system/netdata-ae32c386e13840b2bf9c0083275e7941 2430165M 293M 2429872M 1% /var/db/system/netdata-ae32c386e13840b2bf9c0083275e7941
Main/VMstore 2429872M 1M 2429872M 1% /mnt/Main/VMstore
Main/ISO 2442817M 12945M 2429872M 1% /mnt/Main/ISO
tmpfs 6399M 0M 6399M 0% /run/user/950
admin@truenas[~]$

Sorry to say but your question has been answered multiple times, here’s one example, and another and here.

Long story short: There’s no such ability as it breaks the underlying contract that ZFS provides.

Best you can do is have a separate pool that you manually manage as the “fast” storage and do some scripting to move it into the “slow” pool, but that’s convoluted and fraught with pitfalls.

1 Like

You cannot add any faster write cache to truenas. Truenas caches the writes in memory, no SSD will be faster than this.

In special circumstances (sync writes) a SLOG can be beneficial.

And even then, you need a dedicated low latency device (Intel optane e.g.) for that.

1 Like