Realtek RTL9210 and TRIM

By | 19 Feb 2025

I’ve recently started buying M.2 drives instead of traditional 2.5” SSDs. For USB enclosures I went with a UGREEN M.2 NVMe USB3.2 Gen2 enclosure that comes with all the bells and whistles. They have a Realtek RTL9210 chip which does support the “discard” or TRIM operation to mark unused space on the SSD. However, some Linux variants don’t properly detect this capability. To help with that, you can add a udev rule in /etc/udev/rules.d/ as explained in this forum post:

# Turn on "unmap" mode to allow "fstrim" et al. on USB-C/NVMe adaptors
# 0bda:9210 Realtek Semiconductor Corp. RTL9210 M.2 NVME Adapter
ACTION=="add|change", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="9210", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"Code language: PHP (php)

To activate this without a reboot, run sudo udevadm trigger. After that, fstrim should start to work with this drive.

4 thoughts on “Realtek RTL9210 and TRIM”

  1. Pingback: RTL9210 NVMe Enclosure Firmware Update – blog.mbirth.uk

  2. tom

    Does this work on other chipsets that should support it but don’t expose it? E.g JSM?

    Reply ↓
    1. Markus Birth Post author

      You should be able to set the `unmap` flag with any USB adapter – just adapt the vendor and product ids to your device. Not sure whether it’ll actually do a TRIM, though.

      Reply ↓

Mentions

Reposts

Leave a Reply

Your email address will not be published. Required fields are marked *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.