2

I have upgraded zfs to kmod-0.8.2-1 for SSD trim and trim function works well for normal zfs SSD drive but does not work for SSD cache drive(sdc in the below log). How can I trim it? Thanks in advance.

root@server1:~# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
root@server1:~# zpool status -t
  pool: zp1
 state: ONLINE
  scan: scrub repaired 0B in 0 days 00:24:42 with 0 errors on Mon Jun 10 18:38:54 2019
config:

        NAME        STATE     READ WRITE CKSUM
        zp1         ONLINE       0     0     0
          sdb       ONLINE       0     0     0  (100% trimmed, completed at Mon Oct 28 23:06:03 2019)

errors: No known data errors

  pool: zp2
 state: ONLINE
  scan: scrub repaired 0B in 0 days 00:53:18 with 0 errors on Mon Jun 10 19:59:37 2019
config:

        NAME        STATE     READ WRITE CKSUM
        zp2         ONLINE       0     0     0
          sdd       ONLINE       0     0     0  (trim unsupported)
        cache
          sdc       ONLINE       0     0     0  (untrimmed)

errors: No known data errors
root@server1:~# zpool trim zp2 sdc
cannot trim 'sdc': device is in use as a cache
root@server1:~#
3

L2ARC trim has not been implemented yet at the time of writing. Brian Behlendorf, a ZFS on Linux maintainer, explains:

today the l2arc device is always overwritten, it does not get trimmed. This optimization was left as follow up work to the initial trim feature, but it is something we'd like to eventually implement.

George Amanakis, a contributor to ZFS on Linux, has been working on the feature since 30 December 2019. You can follow the progress on the GitHub pull request.

1
  • Thanks for your kind answer and George Amanakis' working ! – sohnman Jan 30 '20 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.