umass media size off-by-one?
Craig Boston
craig at feniz.gank.org
Tue Mar 6 02:23:56 UTC 2007
Hi all, I ran into this while trying to use geli to encrypt an external
usb-2 hard drive. It appears that sometimes the media size reported by
umass is one sector too big. For example:
umass0: Prolific Technology Inc. Mass Storage Device, rev 2.00/1.00, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <WDC WD18 00JB-00DUA0 65.1> Fixed Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 171705MB (351651889 512 byte sectors: 255H 63S/T 21889C)
# dd if=/dev/zero of=/dev/da0 oseek=351651888 count=1
dd: /dev/da0: Input/output error
1+0 records in
0+0 records out
0 bytes transferred in 0.002951 secs (0 bytes/sec)
# dd if=/dev/zero of=/dev/da0 oseek=351651887 count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.000982 secs (521360 bytes/sec)
This is with a "high speed, power 100 mA, config 1, Mass Storage
Device(0x3507), Prolific Technology Inc.(0x067b), rev 1.00" enclosure.
I tested with two USB flash memory devices and those seem to report the
correct size.
I'm currently rebuilding a kernel with USB_DEBUG to see if it's specific
to a certain protocol and try to figure out if it's a bug in one of them
or if the enclosure is lying. Has anyone run into this before?
Craig
More information about the freebsd-stable
mailing list