Questions regarding the SCSI UNMAP(a.k.a. TRIM) command translation support of the upcoming full-sized SD card reader expansion card

I’ve also contacted FW support for their official response to the following question:


Hello, I would like to ask:

  • Whether the upcoming full-sized SD card reader expansion card will support translation of the SCSI UNMAP command so that the operating system can notify the SD Card’s memory controller unused blocks for them to be garbage collected? This is required to have a sustained, optimal write performance on some workloads.

  • If the expansion card supports such operations, will it be available under the GNU/Linux operating system without any workarounds?(e.g. the ‘lbpme’ (logical block provisioning management enable) bit is set in the READ CAPACITY (16) SCSI command’s response)

This WILL affect my willingness to buy this product so I’d like to request it to be answered either on the product’s specification page or in the FAQ.

Thank you.

This is the first I’m hearing about SD cards supporting TRIM, so thank you for that.

As far as whether it will be supported without workarounds in Linux, currently the only thing that is trimmed by default iirc is internal drives. I’ve had this in my udev rules (/etc/udev/rules.d/05-scsi-disk-unmap.rules, likely from the Arch Wiki) for a long time now to enable trim on external drives, which I imagine you’ll probably need even if supported:

ACTION=="add", SUBSYSTEM=="scsi_disk", TEST=="provisioning_mode", ATTR{provisioning_mode}="unmap"

This is rather a workaround for storage drives that aren’t fully compliant with the SCSI specification. Refer sd: disable logical block provisioning if ‘lbpme’ is not set - Patchwork for the background reasoning such workaround is needed.

I see, well it’s never caused any corruption or problems for me so :man_shrugging:

1 Like

I forgot to reply to this one, so here it is. :slight_smile:

SD Cards do support TRIM-like operations under the SD/MMC ERASE/DISCARD command. If you have a laptop that has a built-in native MMC interface SD card reader(excluding laptops that still use one with the USB interface) you can do TRIM-like operations in the same fashion as with the (internal) SSD drives.

2 Likes

Got their response(quite ironically, a day before the release of the product):

We are unable to answer this question at the moment because the new full-sized SD card reader expansion card has not been released yet. Currently, our expansion card reader is not certified for SCSI UNMAP. For more details, please refer to the discussion here​.

I’ll interpret this as a no then.