Thanks, that did help a lot !!
I read the usb-storage code and found a fix_read_capacity() function. It seems that someone else has the same problem!
I modified line 226 in protocol.c, and my USB drive worked perfectly.
/* Fix the READ CAPACITY result if necessary */ - if (us->flags & US_FL_FIX_CAPACITY) + //if (us->flags & US_FL_FIX_CAPACITY) fix_read_capacity(srb);
[EMAIL PROTECTED] oopass]$ dmesg usb-storage: US: Fixing capacity: from 251905 to 251904 usb-storage: scsi cmd done, result=0x0 usb-storage: *** thread sleeping. SCSI device sda: 251904 512-byte hdwr sectors (129 MB)
Actually I did attach /proc/bus/usb/devices in my mail, but it was truncated becuase the mail was too long.
Here is the content of that file:
[EMAIL PROTECTED] oopass]$ cat /proc/bus/usb/devices
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.8.1-ck1 ohci_hcd S: Product=ALi Corporation USB 1.1 Controller (#2) S: SerialNumber=0000:00:06.0 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=066f ProdID=8000 Rev= 0.01 S: Manufacturer=SigmaTel, Inc. S: Product=USBMSC Audio Player S: SerialNumber=012345678901 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 4 B: Alloc= 11/900 us ( 1%), #Int= 1, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.06 S: Manufacturer=Linux 2.6.8.1-ck1 ohci_hcd S: Product=ALi Corporation USB 1.1 Controller S: SerialNumber=0000:00:02.0 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1It seems that P: Vendor=046d ProdID=c001 Rev= 4.10 S: Manufacturer=Logitech S: Product=USB Mouse C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 50mA I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=10ms
[EMAIL PROTECTED] oopass]$ cat /proc/bus/usb/devices | grep '^[TI]' T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 4 I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0 I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=02 Driver=usbhid
Alan Stern wrote:
On Mon, 16 Aug 2004, Darsen Lu wrote:
I have a 128MB Apacer Audio Steno, but I can't mount it under kernel 2.6. Does anyone know how to solve this problem?
It works on Windows and Mandrake 9.2 (kernel 2.4.22-10mdk). However, when I tried Mandrake 10 (kernel 2.6.3-7mdk) it failed. I typed "dmesg" and saw "Buffer I/O error on device sda, logic block ....." I found similar problems concerning usb storage devices on the web (including kernel 2.6.5, 2.6.6, 2.6.7, 2.6.7bk20, 2.6.8 ...)
Then, I compiled linux-2.6.8.1, which is the newest version now. I patched it with supermount and compiled it, but the same thing happened. I don't know what to do. I attached some information below for convenience. Thanks in advance!
The problem is clear enough, although why it comes up isn't quite so obvious...
Your log says:
SCSI device sda: 251905 512-byte hdwr sectors (129 MB)
So your device claims to have 251905 blocks, numbered from 0 to 251904.
usb-storage: Illegal Request: Logical block address out of range
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
end_request: I/O error, dev sda, sector 251904
Buffer I/O error on device sda, logical block 251904
But when the computer tries to read the last block, the device returns an error saying that block number 251904 is out of range. Clearly this is a bug in your device. Maybe it really has only 251904 blocks, so the last block number should be 251903.
Why does Linux try to read the last block of the device? My guess is
because the device doesn't have a regular valid partition table stored in
the first block, so the system tries to find an alternate type of partition table in the last block. Maybe Linux 2.4 doesn't look for the same sorts of alternate partition tables and so doesn't trigger the bug.
It's possible to create a patch that will reduce by 1 the value reported for the number of blocks in your device. That might be enough to make things work. To do this, I need to see the contents of your /proc/bus/usb/devices file with the device plugged in (the file you sent before didn't have an entry for the device).
Alan Stern
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users
.
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users