ZFS TRIM-support ZFS

Hi all,

I have a raidz3 pool since some years (created on 11.0-RELEASE-p2),
currently running on 14.1-RELEASE-p4. Recently I replaced two failing
spinning disks with SSDs. Why do the two new disks still show "trim
unsupported" here? What am I missing?


Code:
# zpool status -t pool1
  pool: pool1
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
        The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: resilvered 2.69T in 3 days 08:19:52 with 0 errors on Fri Nov  1 03:01:37 2024
config:

        NAME                            STATE     READ WRITE CKSUM
        pool1                           ONLINE       0     0     0
          raidz3-0                      ONLINE       0     0     0
            gpt/pl1d1_NM12JVVV.eli      ONLINE       0     0     0  (trim unsupported)
            gpt/pl1d2_05230406A.eli     ONLINE       0     0     0  (trim unsupported)
            gpt/pl1d3_2435U7D00680.eli  ONLINE       0     0     0  (trim unsupported)
            gpt/pl1d4_NM12JVWC.eli      ONLINE       0     0     0  (trim unsupported)
            gpt/pl1d5_2435U7D00844.eli  ONLINE       0     0     0  (trim unsupported)
            gpt/pl1d6_NM12JVQH.eli      ONLINE       0     0     0  (trim unsupported)


Code:
# gpart list da4|grep label
   label: pl1d3_2435U7D00680

--> da4 is pl1d3

Code:
# camcontrol identify da4 | grep -i trim
Data Set Management (DSM/TRIM) yes

--> it supports trim

Code:
# geli list gpt/pl1d3_2435U7D00680.eli | grep -i flags
Flags: AUTORESIZE

--> it does not show NODELETE --> hence, geli will pass trim commands through


Why does zfs tell it's not supported? For the single disk zroot-pool on
a ssd it works on the same machine.
 
Hmm. Theoretically, trim works in ZFS, both for individual disk pools, and for all forms of RAID. Theoretically, ZFS determines itself whether a disk supports trim or not. For my small system at home, reality matches that theory, but I don't have a RAIDZn pool with trim-enabled disks.

As you already hinted at, the problem might be GELI not passing the trim through, and thereby confusing ZFS. Anyone who uses ZFS and RAID on top of GELI with SSDs care to chime in?

Idea: You can use zpool set to enable and disable trim. Disable it and re-enable it, and maybe that rattles something loose.
 
Thanks for your suggestion. The only property I found is autotrim which only toggles if zfs will do the trim automatically or wait until I trigger it deliberately. I switched it on and off several times, but it did nothing to the problem above.

I googled a lot yesterday evening and today and found the following thread https://forums.freebsd.org/threads/trim-support-for-usb-drives.71541/ . It seems that FreeBSD at least in 2019 did not support TRIM if a device was connected via USB. Is that still true? If yes, that would explain, why although geli tells it will not prevent TRIM, it might not work from point of view of zfs, since my drives are actually connected via USB. I did not consider that a possible problem at all until I came across the above thread. Does somebody know, what is the status on the TRIM via USB-topic?
 
Back
Top