On Sun, Sep 2, 2012 at 11:57 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Sun, 2 Sep 2012, Alon Bar-Lev wrote: > >> > This shows the computer asking the drive to read 8 blocks starting at >> > block 0. The drive (actually the JMicron USB interface, not the drive >> > itself) returns an error code indicating that it thinks the command >> > was not sent properly -- even though it was. >> > >> > I don't understand why the JMicron unit doesn't accept this command. >> > It simply appears to be broken. Does it work if you plug it into a >> > computer running Windows or Mac OS X? >> > >> > Alan Stern >> > >> >> Hi, >> >> I don't know... I don't use these... and the disk is ext4... >> >> I have XP in qemu, I mapped the device and took usbmon (attached), so >> you probably see plugin within Linux, the plugout, then windows takes >> charge. >> >> I see the disk in device manager, but not in disk manager... don't know why. >> >> Maybe this will help... > > Yes, this shows what the problem is. It's a bug in the JMicron device. > > The usbmon trace shows that Windows uses READ FORMAT CAPACITIES and > READ CAPACITY(10) commands to determine the size of the drive. These > commands are not capable of reporting sizes larger than 2 TB, but they > also say what the drive's block size is. They both say that the block > size is 4096 bytes. > > Without your patch, Linux would also use READ CAPACITY(10). When it > sees that the size is larger than 2 TB, it issues a READ CAPACITY(16) > command, which _is_ capable of reporting the correct size of the drive. > (With your patch, Linux tries READ CAPACITY(16) right away.) At any > rate, it accepts the READ CAPACITY(16) results. > > But... READ CAPACITY(16) reports that the block size is 512 bytes, not > 4096! Linux believes this value, and so when it wants to read 4096 > bytes, it asks for 8 blocks. That's why the JMicron refused to carry > out the read -- it realized that 8 blocks would be 32768 bytes, not > 4096 bytes. > > Windows, on the other hand, believes the results from the other two > commands and therefore knows that the block size is 4096. Therefore it > is able to use the drive properly (although the usbmon trace doesn't > show any place where Windows determines the drive's actual size). > > I can't see any reasonable way of fixing this problem. Even if Linux > did settle for the READ CAPACITY(10) value, it would then think that > the drive was only 2 TB. > > Alan Stern > Thank you so much for the information! I guess I return this device. Alon. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html