Please send messages to the mailing list as well as to me.  I don't keep 
old messages on my computer; if I need to read them later I look for them 
in the mailing list archives.


On Thu, 1 Dec 2005, Bryan Wu wrote:

> 1. About the 64M file for g_file_storage driver.
> I setup the 64M file following the instruction on the
> http://www.linux-usb.org/gadget/file_storage.html, but when I use fdisk to
> get the partition information on this file, the number of cylinders = ZERO.
> Is that right?
> ==========================================================================
> -bash-2.05b# fdisk fsg_data 
> You must set cylinders.
> You can do this from the extra functions menu.
> 
> Command (m for help): p
> 
> Disk fsg_data: 0 MB, 0 bytes
> 16 heads, 8 sectors/track, 0 cylinders
> Units = cylinders of 128 * 512 = 65536 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> fsg_data1               1        1024       65532    b  W95 FAT32
> ============================================================================

That's right.  Since the file isn't a physical disk drive, it doesn't have
real cylinders.  You have to _tell_ fdisk how many cylinders there are
supposed to be (and also how many heads and how many sectors).

> 2. Gadget is Linux 2.6.12, Host is Linux 2.6.14
> Gadget can be recognized as /dev/sdb, but it can't be mount

> usb-storage: Bad target number (7:0)
> usb-storage: scsi cmd done, result=0x40000
> usb-storage: *** thread sleeping.
> usb-storage: device scan complete
> ============================================================================
> What's mean "Bad target number"? 

That message is normal.  The host's SCSI core treats the gadget as an
entire SCSI bus, which can have as many as 8 devices (called "targets" in
the SCSI world).  But the gadget is only a single device, target 0.  When
the host looks for targets 1 - 7, naturally it fails.

> So I tried to mount the gadget like this:
> # mount -t vfat /dev/sdb /mnt/test

I think you actually used /dev/sdb1, not /dev/sdb.

> Here are new messages in Linux Host
> ============================================================================
> usb-storage: Command READ_10 (10 bytes)
> usb-storage:  28 00 00 00 00 08 00 00 01 00
> usb-storage: Bulk Command S 0x43425355 T 0x9 L 512 F 128 Trg 0 LUN 0 CL 10
> usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
> usb-storage: Status code 0; transferred 31/31
> usb-storage: -- transfer complete
> usb-storage: Bulk command transfer result=0
> usb-storage: usb_stor_bulk_transfer_sglist: xfer 512 bytes, 1 entries
> usb-storage: Status code 0; transferred 512/512
> usb-storage: -- transfer complete
> usb-storage: Bulk data transfer result 0x0
> usb-storage: Attempting to get CSW...
> usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
> usb-storage: Status code 0; transferred 0/13
> usb-storage: -- short transfer
> usb-storage: Received 0-length CSW; retrying...

Those last three lines should not have happened; they indicate a bug in
your udc.  It sent an extra 0-length packet when it should not have.

> FAT: bogus number of reserved sectors
> VFS: Can't find a valid FAT filesystem on dev sdb1.
> ============================================================================

That's because you didn't run mkdosfs first.  You have to create a
filesystem before you can mount it.

> 3. Gadget is Linux 2.6.12 + WinXP SP2 Host
> ============================================================================
> Windows will add a new disk, but ask me to format it.

If you had used mkdosfs then Windows would not have asked you to format 
the disk.  It would already be formatted.

>  So I tried to format
> it. It's running very slow and makes my PC very slow. And at last, the
> format operation failed. I also saw some messages like lun_file_read and
> lun_file_write from gadget device.

I don't know what happened with Windows.  You didn't send a log showing 
the format operation.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to