usb hdd "device not ready" on write after short idle time
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.
usb hdd "device not ready" on write after short idle time
I have an external usb hdd that seems to be working fine under windows XP but is giving me grief under linux. The first thing I noticed is that a file system mounted on the drive would switch from read/write mode to read only mode after a seemingly unpredictable write error.
Looking at dmesg I found 'Device not ready' errors for the drive. After playing with it for a while I have discovered that sustained read or write activity to the drive will prevent the device not ready errors from occurring, but that the first write attempt after an idle period of a few seconds produces an error every time.
I get the same result under Fedora Core 4 and Kubuntu dapper.
Is this a hardware glitch or a driver problem? XP seems to cope with it OK.
The drive is a Samsung HM12JC - 2.5 inch 120 Gb ide - connected through an Alcor Micro Corp AU6390 USB2.0 to ATA/ATAPI Bridge Controller.
relevent lines from dmesg:
[17341301.700000] scsi11 : SCSI emulation for USB Mass Storage devices
[17341301.700000] usb-storage: device found at 14
[17341301.700000] usb-storage: waiting for device to settle before scanning
[17341306.700000] Vendor: Generic Model: USB Disk Rev: 9.02
[17341306.700000] Type: Direct-Access ANSI SCSI revision: 02
[17341306.700000] SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)
[17341306.700000] sdb: assuming drive cache: write through
[17341306.704000] SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB)
[17341306.704000] sdb: assuming drive cache: write through
[17341306.704000] sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 >
[17341306.828000] sd 11:0:0:0: Attached scsi disk sdb
[17341306.828000] sd 11:0:0:0: Attached scsi generic sg2 type 0
[17341306.828000] usb-storage: device scan complete
[17343249.960000] sd 11:0:0:0: Device not ready.
[17343249.960000] end_request: I/O error, dev sdb, sector 200000
lsusb -v -s 5:14
Bus 005 Device 014: ID 058f:6390 Alcor Micro Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x058f Alcor Micro Corp.
idProduct 0x6390
bcdDevice 1.00
iManufacturer 1 Generic
iProduct 2 USB TO IDE Bridge
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
Does this happen at reboot too (I mean without the drive powering down)? If it is not ready -- it is not ready, after all. .
Checked the cable? Checked the file system (fschk)? What's at sector 200000?
Have checked with several different cables and on several different computers. This is independent of the filesystem or any particular sector. Writing to any part of the disc (eg via dd or badblocks -w) after a few seconds of the disk being idle results in "Device not ready" messages. If the disk is kept busy (with other writes or reads) then there is no problem in writing. It is only the first write after idle that results in "Device not ready." The drive is powered via the USB. It does not power down - at least it does not spin down. I don't know how to check or control whether a usb hard drive enters into some power saving state while it is idle.
Oh, right, my error. I reasoned that there might be some power-down parameter set in the BIOS. I don't really have that much experience with USB (my board supports only 1.1, so it's no use for hard disks).
KDE (in Kubuntu) has at least two USB monitoring tools. Try those to find out whether there is any power-down-on-idle setting. Is the power drain of the disk within the specs of your USB ATA/ATAPI Bridge Controller?
Looks like there is a problem with the USB2.0 to ATA/ATAPI Bridge Controller I was using. I switched to a different one and have no more problem. Still not sure if it is a problem with the Alcor Micro Corp AU6390 in general or just the particular one I bought.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.