@@ -779,6 +779,19 @@ func decodeHealthBits(code int) string {
779779 return strings .Join (flags , ", " )
780780}
781781
782+ // isAutoDetectedProtocol returns true for protocols that smartctl assigns during
783+ // --scan/--scan-open. These don't need an explicit -d flag because smartctl
784+ // already knows how to talk to them. Custom protocols from device_overrides
785+ // (e.g. "sat", "jmb39x-q,0", "usbcypress") are NOT in this list and will be
786+ // passed to smartctl via -d.
787+ func isAutoDetectedProtocol (p string ) bool {
788+ switch strings .ToLower (p ) {
789+ case "scsi" , "ata" , "nvme" :
790+ return true
791+ }
792+ return false
793+ }
794+
782795// runSmartctl runs smartctl with the given args and returns (output, exitCode, error).
783796// error is non-nil only for non-ExitError failures (missing binary, permissions, etc.).
784797func runSmartctl (smartctlPath string , args []string ) ([]byte , int , error ) {
@@ -809,8 +822,8 @@ func (dc *DriveCache) fetchDriveInfo(devicePath, protocol string, skipStandby bo
809822 if dc .standbyMode != "never" && ! skipStandby {
810823 args = append (args , "-n" , dc .standbyMode )
811824 }
812- if strings . EqualFold ( protocol , "sat" ) {
813- args = append (args , "-d" , "sat" )
825+ if protocol != "" && ! isAutoDetectedProtocol ( protocol ) {
826+ args = append (args , "-d" , protocol )
814827 }
815828 args = append (args , devicePath )
816829
0 commit comments