Does SD Expansion Card support discard?

I’m contemplating buying the new SD Card expansion module, but I’d like to know whether it supports erasing SD cards. The SD Card protocol specifies an erase command, and Linux does support invoking it on supporting hardware. The only device I have found where I can run blkdiscard to erase an SD card is my Raspberry Pi. It appears that most SD card adapters attach to USB and adopt the USB Mass Storage protocol, which does not provide any way to deliver an erase command to an inserted card. The SD Card slot in the Raspberry Pi is attached directly to GPIO pins on the CPU, so Linux can send any command it wants to the card without the interference of an abstraction layer. Mind you, I really am speaking of erasing, as distinct from overwriting with null bytes; the erase command in the SD protocol is analogous to the TRIM command in the ATA protocol. Note that fstrim works great on my Raspberry Pi and really erases vacant blocks on the SD card (much faster than overwriting them with null bytes would be). I would like to be able to use fstrim/blkdiscard on my FW Laptop too, thus my question. Thanks.

Since the Framework expansion cards are also connected using USB (and presumably Mass Storage, because what else would they use?), I think you have the answer there.

It isn’t quite so cut and dried. IIRC, the Framework SD Card expansion module supports UAS (USB-Attached SCSI) in addition to the standard USB Mass Storage Class. So maybe what I’m really asking is: does UAS add support for discard/trim/erase (and, if so, does the module implement it correctly)?

Edit: I might be misremembering. Maybe it’s only the storage expansion cards that support UAS, not the SD card expansion module.

2 Likes

Here’s my thread that asked the same question: Questions regarding the SCSI UNMAP(a.k.a. TRIM) command translation support of the upcoming full-sized SD card reader expansion card

I also contacted one of the Framework engineers during some in-person events regarding this issue and received an answer that the third-party SD card controller they’re using currently doesn’t support that feature.

1 Like

Thank you for the info. I bought one of the new modules anyway. I haven’t tried it out yet, but it’s disappointing to know that it won’t support truly erasing SD cards. I’ll have to keep using my old Raspberry Pi for that, I suppose.

It’s ironic that perhaps the most distinguishing feature of SD Cards setting them apart from MMC, the feature in fact that lends the word “Secure” to “Secure Digital,” namely the ability to securely erase a card, is almost never implemented in card interface adapters.

1 Like