SCSI error: return code = 0x10000 on USB Mass Storage device
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
SCSI error: return code = 0x10000 on USB Mass Storage device
I'm running Debian (sid, custom compiled Debian kernel version 2.6.14) on an IBM Thinkpad R50, and have been having trouble getting an AMS Venus DS-2316SU2BK enclosure working. Here's a paste from /var/log/messages that indicates the basic error:
kernel: usb 4-4: new high speed USB device using ehci_hcd and address 22
kernel: scsi20 : SCSI emulation for USB Mass Storage devices
kernel: Vendor: ST325082 Model: 3AS Rev: 3.03
kernel: Type: Direct-Access ANSI SCSI revision: 04
kernel: SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
kernel: SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
kernel: sda:<7>usb-storage: queuecommand called
kernel: sda1 sda2
kernel: Attached scsi disk sda at scsi20, channel 0, id 0, lun 0
kernel: usb 4-4: USB disconnect, address 22
kernel: sd 20:0:0:0: SCSI error: return code = 0x10000
kernel: end_request: I/O error, dev sda, sector 488396928
kernel: printk: 8 messages suppressed.
The hard drive (Seagate Barracuda ST3250823AS) has been set up in XP with a 100GB NTFS partition, a 32GB FAT-32 partion, and the remainder not partitioned.
Things I have tried which have not solved the problem:
* compiled in usb-storage vs. module
* changing max_sectors in drivers/usb/storage/scsiglue.c to a lower number
(by commenting out if statement relating to USB_VENDOR_ID_GENESYS)
* different HDD (previously Hitachi Deskstar T7K250)
* different USB cable (cable that came with the enclosure, and another Hi-Speed cable I had lying around at home)
* previous kernel (2.6.12)
I see a few lines near the end of the debug output that look suspicious, particularly the one saying "Invalid command operation code":
Bulk status result = 0
Bulk Status S 0x53425355 T 0x8 R 0 Stat 0x0
-- Result from auto-sense is 0
-- code: 0x70, key: 0x5, ASC: 0x20, ASCQ: 0x0
Illegal Request: Invalid command operation code
scsi cmd done, result=0x2
I'll put the full debug output from one connect/disconnect cycle in a subsequent post.
As mentioned, here's the usb_storage debug output:
kernel: usb-storage:
USB Mass Storage device detected
-- associate_dev
Vendor: 0x0928, Product: 0x0002, Revision: 0x0000
Interface Subclass: 0x06, Protocol: 0x50
Transport: Bulk
Protocol: Transparent SCSI
usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1
GetMaxLUN command result is 1, data is 0
*** thread sleeping.
device found at 22
waiting for device to settle before scanning
queuecommand called
*** thread awakened.
Command INQUIRY (6 bytes)
12 00 00 00 24 00
Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries
Status code 0; transferred 36/36
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command TEST_UNIT_READY (6 bytes)
00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x2 L 0 F 0 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command READ_CAPACITY (10 bytes)
25 00 00 00 00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x3 L 8 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries
Status code 0; transferred 8/8
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command TEST_UNIT_READY (6 bytes)
00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x4 L 0 F 0 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command READ_CAPACITY (10 bytes)
25 00 00 00 00 00 00 00 00 00
Bulk Command S 0x43425355 T 0x5 L 8 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries
Status code 0; transferred 8/8
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
*** thread awakened.
Command READ_10 (10 bytes)
28 00 00 00 00 00 00 00 08 00
Bulk Command S 0x43425355 T 0x6 L 4096 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
Status code 0; transferred 4096/4096
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x0
scsi cmd done, result=0x0
*** thread sleeping.
queuecommand called
*** thread awakened.
Command (unknown command) (12 bytes)
a0 00 00 00 00 00 00 00 10 00 00 00
Bulk Command S 0x43425355 T 0x7 L 4096 F 128 Trg 0 LUN 0 CL 12
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
Status code -32; transferred 0/4096
clearing endpoint halt for pipe 0xc0009680
usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=81 len=0
usb_stor_clear_halt: result = 0
Bulk data transfer result 0x2
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x7 R 4096 Stat 0x1
-- transport indicates command failure
-- unexpectedly short transfer
Issuing auto-REQUEST_SENSE
Bulk Command S 0x43425355 T 0x8 L 18 F 128 Trg 0 LUN 0 CL 6
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_buf: xfer 18 bytes
Status code 0; transferred 18/18
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code 0; transferred 13/13
-- transfer complete
Bulk status result = 0
Bulk Status S 0x53425355 T 0x8 R 0 Stat 0x0
-- Result from auto-sense is 0
-- code: 0x70, key: 0x5, ASC: 0x20, ASCQ: 0x0
Illegal Request: Invalid command operation code
scsi cmd done, result=0x2
*** thread sleeping.
# this next bit is repeated 7 times, with the number
# in Bad target number the only thing changing (1-7)
queuecommand called
*** thread awakened.
Bad target number (1:0)
scsi cmd done, result=0x40000
*** thread sleeping.
device scan complete
queuecommand called
*** thread awakened.
Command READ_10 (10 bytes)
28 00 1d 1c 58 80 00 00 08 00
Bulk Command S 0x43425355 T 0x9 L 4096 F 128 Trg 0 LUN 0 CL 10
usb_stor_bulk_transfer_buf: xfer 31 bytes
Status code 0; transferred 31/31
-- transfer complete
Bulk command transfer result=0
usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries
Status code 0; transferred 4096/4096
-- transfer complete
Bulk data transfer result 0x0
Attempting to get CSW...
usb_stor_bulk_transfer_buf: xfer 13 bytes
Status code -71; transferred 0/13
-- unknown error
Bulk status result = 4
-- transport indicates error, resetting
storage_disconnect() called
usb_stor_stop_transport called
usb_reset_device returns -19
usb_stor_Bulk_reset called
No reset during disconnect
scsi cmd done, result=0x70000
queuecommand called
Fail command during disconnect
-- usb_stor_release_resources
-- sending exit command to thread
-- dissociate_dev
*** thread sleeping.
*** thread awakened.
-- exiting
For what it's worth, I think I've tracked down the segment of code that is producing the "Illegal Request: Invalid command operation code" error message (drivers/scsi/sr_ioctl.c, line ~149):
Okay, I found a solution that seems to work so far (in that I can now access my FAT32 partition under Linux), using rough instructions from the following address:
According to that post, the error is related to the unknown command 0xA0...10..., which sends a REPORT_LUNS signal to the enclosure, resulting in badness. This is apparently because the device reports to be SCSI revision 04, but does not support all the commands. The solution is to stop the driver sending REPORT_LUNS to the enclosure. In my case, I did the following:
Code:
echo 'ST325082:3AS:0x01' > /proc/scsi/device_info
The generic solution (according to the last post by Patrick Mansfield on that thread) is the following, assuming that scsi_mod has been loaded (or compiled in):
Where <vendor> and <model> are taken from the kernel messages when the device is plugged in. In my case:
Code:
kernel: usb 4-4: new high speed USB device using ehci_hcd and address 22
kernel: scsi20 : SCSI emulation for USB Mass Storage devices
kernel: Vendor: ST325082 Model: 3AS Rev: 3.03
kernel: Type: Direct-Access ANSI SCSI revision: 04
Possibly also with Laser SATA/USB2 external HDD case
Hello gringer,
This also may happen with the Laser SATA/USB2 external HDD case, at least for Linux kernel version 2.6.18. The behavior is a bit different, because I can write files to the drive (including a 12GB image), but it fails most of the time for writing lots of little files to the disk.
/var/log/messages output (showing vendor, model):
Code:
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: ST332062 Model: 0AS Rev: K
Type: Direct-Access ANSI SCSI revision: 02
This has not been tested extensively yet, so I'm not really sure if it will work. On the other hand, I have now been able to finish some music tagging, which I was not able to complete before now (without the disk failing part way through).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.