I run Ubuntu 19.10 installed on ZFS through the new ZFS install option on 19.10. This is on a Thinkpad X1 Carbon 7th which is in heavy daily use. No dualboot so it's Ubuntu all the time. The laptop has a SSD, and as I understand it fstrim doesn't read and work on ZFS so I either have to run on trim for my pools or schedule trim with systemd timers or cron. I have used btrfs in the past and there I ran trim on a schedule since it slowed me down a little to enable discard (trim). But on ZFS enabling trim doesn't seem to give me a performance hit at all so I was wondering if I still should set up trim on a weekly or monthly basis?
From the ZoL git commit message adding trim support:
so
zpool set autotrim=on
and a periodiczpool trim
is the recommended approach.I'd suggest a cron job (or systemd timer if you prefer) to run
zpool trim
at the same frequency as you run scrub your pool, which is set as the second Sunday of every month by default (have a look at/etc/cron.d/zfsutils-linux
), but on different days of the month so the two aren't running simultaneously.