Cache drive's and trim support


Ericjr

Recommended Posts

I've been reading some conflicting posts that say the dynamix trim plugin is required and others saying that unraid natively supports trim now. Should I be running the dynamix plugin for my SSD cache or is unraid taking care of it? If unraid has support for it natively is there anything I need to do to enable trim support or is it done automatically?

Link to comment
2 hours ago, Ericjr said:

f unraid has support for it natively is there anything I need to do to enable trim support or is it done automatically?

With v6.8 you need to run trim manually, with v6.9 no need to trim any btrfs pool since it uses the new discard=async mount option, still need to do it for any xfs filesystem.

  • Like 3
  • Thanks 1
  • Upvote 1
Link to comment
  • 1 month later...
  • 2 weeks later...
  • 3 months later...

I'm not convinced that trim is working the way it should be.  I have two nvme devices each in their own named btrfs cache pool, and performance over time on these devices plummets down until i'm seeing less than 20MB/s write speeds when copying files.  If i manually force a trim, i then see (as an example) 85GB trimmed, and the drive then speeds back up again.  The system log is showing the drive as having been trimmed with the dynamix plugin, but it just doesn't look like it's working to me.  Perhaps i need to completely remove the dynamix plugin if its not needed? On unRAID 6.9.2 by the way

Edited by sdamaged
Link to comment
  • 1 month later...
On 3/19/2021 at 9:30 PM, sonic6 said:

What i have to do, for using "discard=async"?

 

On 3/20/2021 at 8:42 AM, JorgeB said:

Nothing other than upgrading to v6.9.x.

 

Where can i verify this on the system? Can't find the option for this. Btw, using 6.10 now. Is the dynamics trim plugin just not needed, or can it cause problems if it installed on the newer Unraid versions? Maybe because of the own trim operation is colliding with the ones from the plugin? 

Link to comment
  • 4 months later...
On 1/23/2021 at 9:40 AM, JorgeB said:

With v6.8 you need to run trim manually, with v6.9 no need to trim any btrfs pool since it uses the new discard=async mount option, still need to do it for any xfs filesystem.

Does that also apply to btrfs encrypted? I read somewhere that trim is not supported with encryption.

Link to comment
  • 2 months later...
On 3/20/2021 at 3:42 AM, JorgeB said:

Nothing other than upgrading to v6.9.x.

Maybe a stupid question, but does this hold if your drive does not support TRIM? I have a couple SSD's mounted to an HBA and I get a "not supported" message when I run the fstrim -v command. 

Link to comment
  • 2 weeks later...
On 1/23/2021 at 8:40 AM, JorgeB said:

With v6.8 you need to run trim manually, with v6.9 no need to trim any btrfs pool since it uses the new discard=async mount option, still need to do it for any xfs filesystem.

 

Is there any harm in keeping the trim function even when the cache is a btrfs pool? Or should I just remove trim and be done with it? I just don't want to be getting warnings about not having it from Fix Common Problems (I know this isn't the Fix Common Problems thread).

Link to comment
  • 9 months later...

fstrim -v /mnt/cache
/mnt/cache: 444 GiB (476746616832 bytes) trimmed

 

that's on a 500GB SSD with 6.9.2 running.  we've had performance issues on the system recently, and when I copied the VMs off the drive, it was barely moving data.  then I ran the command above.

something tells me it's not TRIMming the drive like its supposed to.

Link to comment
  • 4 weeks later...

Using unraid 6.11.5

Single nvme drive in cache, btrfs. No scrub/anything special.

 

We were talking in discord recently about this, and I notice that my cache (created 6.9.x after the 1 MiB alignment) doesnt include the discard option like it mentions it should:

 

# mount | grep /mnt/cache
/dev/nvme0n1p1 on /mnt/cache type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=5,subvol=/)
/mnt/cache/docker.img on /var/lib/docker type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=5,subvol=/)
/mnt/cache/docker.img on /var/lib/docker/btrfs type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=5,subvol=/)
/mnt/cache/system/libvirt/libvirt.img on /etc/libvirt type btrfs (rw,noatime,ssd,space_cache=v2,subvolid=5,subvol=/)

 

Is there a known bug/issue where it doesnt add the discard option if its a pool named 'cache' or only single drive with some other criteria?

Edited by zoggy
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.