public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* How to handle StarTech adapter
@ 2026-04-03 18:52 Johan Gill
  2026-04-14  3:27 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Gill @ 2026-04-03 18:52 UTC (permalink / raw)
  To: linux-scsi

Hello, I was directed here from linux-usb, so here goes:

I got a USB-SATA adapter from StarTech 
(https://www.startech.com/en-se/hdd/usb312sat3cb). It is more stable 
than my previous adapter (which was some JMicron-based thing) and is 
running on full speed AFAICS.

lsusb says "Bus 002 Device 002: ID 14b0:0207 StarTech.com Ltd. 
SKC6002048G" with my Kingston KC600 connected.


However, there is one problem: I cannot run fstrim without custom udev 
rules, although the adapter is documented as supporting TRIM. With a 
custom udev rule to allow it I have run fstrim twice this far, and 
smartctl with -t short reports no errors.

The cause turned out to be that lbpme is not set, so the other VPD 
information is not considered.

[johan@Corner linux]$ sudo sg_readcap -16 /dev/sda
Read Capacity results:
    Protection: prot_en=0, p_type=0, p_i_exponent=0
    Logical block provisioning: lbpme=0, lbprz=0
    Last LBA=4000797359 (0xee7752af), Number of logical blocks=4000797360
    Logical block length=512 bytes
    Logical blocks per physical block exponent=3 [so physical block 
length=4096 bytes]
    Lowest aligned LBA=0
Hence:
    Device size: 2048408248320 bytes, 1953514.3 MiB, 2048.41 GB, 2.05 TB

[johan@Corner linux]$ sudo sg_vpd -p lbpv /dev/sda
Logical block provisioning VPD page (SBC)
   LBPU=1
   LBPWS=0
   LBPWS10=0
   LBPRZ=0x0
   ANC_SUP=0
   DP=0
   Minimum percentage: 0 [not reported]
   Provisioning type: not known or fully provisioned
   Threshold percentage: 0 [percentages not supported]

Would this be sufficient to have a quirk for this case? Let me know if 
you need anything else from me.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to handle StarTech adapter
  2026-04-03 18:52 How to handle StarTech adapter Johan Gill
@ 2026-04-14  3:27 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2026-04-14  3:27 UTC (permalink / raw)
  To: Johan Gill; +Cc: linux-scsi


Hi Johan!

> The cause turned out to be that lbpme is not set, so the other VPD
> information is not considered.
>
> Would this be sufficient to have a quirk for this case? Let me know if
> you need anything else from me.

USB bridge adapters are notoriously buggy. Your model may produce the
expected results with the drive you have attached. But can you guarantee
that it won't corrupt data for somebody else? There are definitely USB
bridges out there that will happily trim areas outside of the requested
block ranges.

Consequently, we have to err on the side of caution. If a device is not
reporting that a given feature is enabled, we defer the decision to the
user.

-- 
Martin K. Petersen

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-14  3:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 18:52 How to handle StarTech adapter Johan Gill
2026-04-14  3:27 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox