>>> I have a USB drive that mostly works, but with I/O errors logged in
>> Please be more specific.
>> Platform? Kernel version?
>> Which I/O errors are logged?
> OS = CentOS 5.2
> Kernel = 2.6.18-274.3.1.el5xen x86_64
> IO error logged:
> sd 1:0:0:0: Device not ready:<6>: Current: sense key: Not Ready
> Add. Sense: Logical unit not ready, initializing command required
> end_request: I/O error, dev sdc, sector 740704351
> I/O error in filesystem ("dm-9") meta-data dev dm-9 block
> 0x2c263ea0 ("xfs_trans_read_buf") error 5 buf count 8192
> xfs_imap_to_bp: xfs_trans_read_buf()returned an error 5 on dm-9.
> Returning error.
>>> "smartctl --all /dev/sdc -d sat,12" works, but does not report any
>>> errors - no current-pending sectors, no relocated sectors.
>> '--all' is equivalent to '-H -i -c -A -l error -l selftest -l
>> selective'. Which of those single options produce kernel messages?
>> The SMART STATUS (-H) command via SAT uses SCSI sense data to return
>> ATA output register values. Some older SAT layers do not properly
>> interpret this sense data and log a bogus error message.
> Running smartctl works ok, no errors.
> The errors are logged in general use of the drive.
>> Please provide USB Id for this device. Then we could add it to drive
>> database and '-d sat,12' would no longer be needed.
>> Does '-d sat' work?
> Tested (version 5.39) - "-d sat" works.
> The usb ID is 0bc2:2300
This ID is already in drivedb since smartmontools 5.40.
>>> "--test=short" passes without error.
>>> "--test=long" starts ok, but after a while reports "Aborted by host"
>>> with at 90% remaining.
>>> No dmesg relating to this "aborted by host event".
>> Some USB bridges send a ATA standby command to the drive after some
>> time of inactivity. This aborts the self-test.
> This was the problem...
> I repeated the long test with another session polling smartctl --all
> every 10 seconds... the long test completed without error.
> I wonder if the standby feature might be related to the errors logged by
> the OS.
Yes, "sense key: Not Ready" may be the result of the standby.
> Would you happen to know if this feature can be turned off?
The USB bridge possibly supports the SCSI command to configure standby time.
If this is the case, "sdparm -set SCT=N" may help, see