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. Markus Birth

    By now I have 2 of those Ugreen M.2 NVMe USB 3.2 SSD enclosures. One of them is attached to my DELL monitor which…

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

  3. 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 *

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)