I have a usb nvme enclosure (SSK, JMicron, 152d:0562)
By default, I can’t use fstrim on it – but there’s a workaround described here. tl;dr: set provisioning_mode for the corresponding scsi_disk to unmap.
This used to work for me with a udev rule: ACTION=="add|change", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="0562", SUBSYSTEM=="scsi_disk", ATTR{provisioning_mode}="unmap"
For whatever reason, this is not working anymore. After reading some udev docs, I have a suspicion that udisks is messing this up for me – but it might be a red herring.. Figured it’s easier to just ask here.
Note: used to work on Fedora 30-something series; now on 41 and it’s not working
That ticket is talking about smartctl functionality. While I’m not happy that it’s not supported, my question is about why my udev rule doesn’t apply.
I forgot to add that I’m able to manually write unmap to the attr: echo unmap > /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host6/target6:0:0/6:0:0:0/scsi_disk/6:0:0:0/provisioning_mode – and that makes fstrim work.
This is more or less what I want – except I want this attr to apply automatically when I plug in the device. That’s why I was using udev rule for this..