So, I’m trying out TrueNAS Scale 21.04 and so far it’s great!
But i have a little question that i hope someone can help me with;
I have a striped mirror (raid10) pool and wanted to try out adding a SLOG.
I had a Intel 760p 240GB lying around, yes it’s not the ideal SLOG but this is as a proof of concept before i take the plunge and buy a 900p/905p and i dont care if i kill it fast.
I created a 32GB partition with fdisk, and added it with:
zpool add storage log /dev/nvme0n1p1
The idea with the 32GB partition was that i had in my mind that it could extend the lifetime some at least with TRIM rotating cells.
I couldnt figure out how to TRIM the whole SLOG device, only the partition…
So i added a cronjob with;
0 12 * * * zpool trim storage nvme0n1p1
Question 1: Is the above correct, that TRIM will “rotate” the cells?
Question 2: If i TRIM only a partition, will it trigger TRIM for the whole device?
Question 3: If “No” on question 2, how do i TRIM a whole device that is not a pool in ZoL?
Thanks in advance!
P.S
I got 32GB by calculating (20 x 0,125) x 5 + some more = 32 . As i have 2 x 10Gbit
D.S
We are in 2021. Manual trimming of flash devices is no longer necessary, unless you’re dealing with a really old drive or you’re actually interacting with the flash memory directly, such as is done with some eMMCs. Think 2012 and earlier. As long as you leave some space out for the SSD itself to handle trimming - not that it’s needed, it’s more of a precaution - you should be fine.
Okay yeah I’m starting to realize that. Just had something in the back of my mind saying that i saw Wendell doing this in a video, but could have been someone else and could also have been a really old vid
So you suggest adding the whole 760p as a SLOG without parting it up?
I have autotrim enabled but i dont see the device being TRIMmed in
zpool status -t
The pool consists of 10 x WDC_WD40EFRX-68WT0N0 in raid10.
Now that i read it again, I might have missunderstood the Intel page, but here is the statement;
" Environment:
For TRIM to function, both the SSD and operating system must support TRIM and be enabled in the operating system.
"
And the reason why i thought i needed manual TRIM is that i dont see the drives beeing TRIMmed in status of pools…
You and vhns are awesome, thanks for the quick help!
Yes right now its just proof of concept, but also to figure out the optimal settings for when i buy the 900p/905p.
I rather mess up now with this device than on the proper one
Automatic TRIM happens continuously in the background and operates
solely on recently freed blocks (ms_trim not ms_allocatable).
...
While the automatic TRIM process is highly effective it is more likely
than a manual TRIM to encounter tiny ranges. Ranges less than or equal to
'zfs_trim_extent_bytes_min' (32k) are considered too small to efficiently
TRIM and are skipped. This means small amounts of freed space may not
be automatically trimmed.
Here’s a question, instead of partitions would making use of “namespaces” with intelmas or maby nvme-cli (should be included in linux) be more viable for trim support? Not sure what the truenas equivalent would be.
By default, nvme drives have a single namespace (/dev/nvme0n1) provisioned with the capacity of the entire drive, but can apparently be set to to a certain size
So giving ZFS the namespace may be somewhat more like handing it a “real” drive and trim might work normally. At least, from my very rough understanding. I’ve not played with this myself yet.
edit Ah, just saw @anon86748826 post, good to know!*