zpool-trim(8): cannot trim '⋯': device is in use as a cache #14231
Replies: 2 comments 5 replies
-
You can try:
echo 1 >/sys/module/zfs/parameters/l2arc_trim_ahead
'zpool trim' purpose is to trim empty space in the pool. It doesn't
look like it was designed to work on L2ARC as it is just a ring buffer
with cache.
Trim ahead module parameter for L2ARC is different. AFAIK it just
instructs ZFS to keep a bit of trimmed space in front of new L2ARC
allocations.
…On Sun, Nov 27, 2022 at 10:08 PM Graham Perrin ***@***.***> wrote:
From the *autotrim* section of zpoolprops.7 — OpenZFS documentation
<https://openzfs.github.io/openzfs-docs/man/7/zpoolprops.7.html>:
… TRIM on L2ARC devices is enabled by setting *l2arc_trim_ahead > 0*. …
From helloSystem/ISO#412 (comment)
<helloSystem/ISO#412 (comment)>:
***@***.***:~ # zpool offline Transcend gpt/cache-transcend
***@***.***:~ # zpool trim Transcend gpt/cache-transcend
cannot trim 'gpt/cache-transcend': device is in use as a cache
***@***.***:~ # zpool online Transcend gpt/cache-transcend
***@***.***:~ # sysctl vfs.zfs.l2arc.trim_ahead
vfs.zfs.l2arc.trim_ahead: 0
***@***.***:~ #
Is the *cannot trim* response (to the zpool-trim(8) command) due to
autotrim off for the pool?
The response surprised me, only because I expected a different message, to
indicate that the *device* does not support TRIM; it's a very simple USB
flash drive (Kingston DataTraveler 3.0).
—
Reply to this email directly, view it on GitHub
<#14231>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXQ6HKVWFK4FX5PISD5EATWKM6JLANCNFSM6AAAAAASMO2FCQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
A Verbatim device that certainly does not support trim operations:
I removed the Kingston cache device from the pool named Transcend, then reused the Verbatim device as the cache. Result:
So, my expectation was wrong. The lack of support at device level is irrelevant. I'll mark #14231 (comment) as the answer (thanks, @IvanVolosyuk); it's only slightly wrong in that part of what was suggested is for FreeBSD. This, essentially, seems to be the answer:
|
Beta Was this translation helpful? Give feedback.
-
From the autotrim section of zpoolprops.7 — OpenZFS documentation:
From helloSystem/ISO#412 (comment):
Is the cannot trim response (to the zpool-trim(8) command) due to
autotrim
off
for the pool?The response surprised me, only because I expected a different message, to indicate that the device does not support TRIM; it's a very simple USB flash drive (Kingston DataTraveler 3.0).
Beta Was this translation helpful? Give feedback.
All reactions