ZFS Trim Not Enabled

Started by BrandyWine, September 24, 2025, 08:52:19 AM

Previous topic - Next topic
September 24, 2025, 08:52:19 AM Last Edit: September 24, 2025, 03:19:20 PM by BrandyWine
Well, from some reading it does seems a periodic trim of ZFS is good for SSD's, and in opnsense the trim is not enabled at all.
"https://duckduckgo.com/?q=does zfs trim help ssd"

Activate it in cron section of web gui, add cron job, select the "ZFS Trim" item, use parameter "zroot", i cron it on days 1,8,15,23 hrs 3 mins 0 (cron it away from other jobs, etc)

Only works if your ssd supports TRIM, so either try and use camcontrol identify /dev/[your ssd device name], or search google(dont use google) for "does [add your ssd name model] support Trim function".

Use pciconf -lv to get your ssd info.

ZFS scrub might also be good to do every 30days.

Cheers.

Mini-pc N150 i226v x520, FREEDOM

You can also enable the autotrim property in zfs itself:

zpool set autotrim=on zroot
Of course scheduling with cron has the benefit of being able to plan when it happens, away from other i/o-intensive jobs, although I have never seen it take more than a few minutes at the very most.
In theory there is no difference between theory and practice. In practice there is.

I guess either or.
I just figured my mini N150 would prefer a schedule vs more "auto" stuff constantly running.
Mini-pc N150 i226v x520, FREEDOM