Hi,
I'm trying to implement the USB mass storage class (Kernel 2.4.6 and
Cypress EZ-OTG CY767200 controller)and I'm having problems reading the
boot sector on my USB Flash drive when I mount it.
Here's how I mount the thumb drive:
mount -t vfat /dev/sda1 /files
(there isn't anything in /files directory)
Here's what it returns:
fatfs: bogus logical sector size 20487
VFS: Can't find a valid MSDOS filesystem on dev 08:00.
I've tracked it down to the fat_read_super() function in fat_inode.c
when it tries to read (bread()) the first sector (0) on the drive. The
contents of the read don't look anywhere close to what I read when I use
a separate program in WinXP to read the first sector which is correct.
I suspect that the USB and SCSI subsystems don't have any problems
because it reports the thumb drive correctly as you can see below.
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: SanDisk Model: Cruzer Titanium Rev: 0.4
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 2001888 512-byte hdwr sectors (1025 MB)
sda: Write Protect is off
Partition check:
sda: sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
I'm stumped! Anyone else come across this problem?
Or can you point me in the right direction?
I've tried a couple of different flash drives with the same result. In
fact the ASCII represent of the sector read has the following text,
"Invalid partition table. Error loading operating sytem . Missing
operating system." I don't know if means anything and I can't find it
anywhere in the source code.
The mass storage debug printf's (see below) indicate that it's using
Bulk transport and Transparent SCSI protocol. Anyone know where I can
find 'Transparent SCSI' command set documentation?
Thanks,
Dave M.
.\drivers\usb\hub.c: USB new device connect on bus1/1, assigned device
number 3
usb-storage: act_altsettting is 0
usb-storage: id_index calculated to be: 42
usb-storage: Array length appears to be: 44
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0x004bf4e0 Out: 0x004bf4f4 Int: 0x00000000
(Period 0)
usb-storage: New GUID 078152004e4ee52056605806
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: *** thread sleeping.
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage: 12 00 00 00 ff 00 00 00 54 5b 13 00
usb-storage: Bulk command S 0x43425355 T 0x1 Trg 0 LUN 0 L 255 F 128 CL
6
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 255 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 36/255
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x1 R 219 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
Vendor: SanDisk Model: Cruzer Titanium Rev: 0.4
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi removable disk sda at scsi0, channel 0, id 0, lun 0
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (1/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (2/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (3/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (4/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (5/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (6/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (7/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage: 00 00 00 00 00 00 00 00 00 00 4a 00
usb-storage: Bulk command S 0x43425355 T 0x9 Trg 0 LUN 0 L 0 F 128 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x9 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage: 25 00 00 00 00 00 00 00 00 00 4a 00
usb-storage: Bulk command S 0x43425355 T 0xa Trg 0 LUN 0 L 8 F 128 CL 10
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 8 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 8/8
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xa R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sda: 2001888 512-byte hdwr sectors (1025 MB)
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage: 1a 00 3f 00 08 00 00 00 00 00 4a 00
usb-storage: Bulk command S 0x43425355 T 0xb Trg 0 LUN 0 L 8 F 128 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 8 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 4/8
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xb R 4 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
sda: Write Protect is off
Partition check:
sda:<7>usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command READ_10 (10 bytes)
usb-storage: 28 00 00 00 00 00 00 00 02 00 4a 00
usb-storage: Bulk command S 0x43425355 T 0xc Trg 0 LUN 0 L 1024 F 128 CL
10
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 1024 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 1024/1024
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xc R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
mount -t vfat /dev/sda1 /files
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command START_STOP (6 bytes)
usb-storage: 1b 00 00 00 01 00 12 00 00 00 00 00
usb-storage: Bulk command S 0x43425355 T 0xd Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xd R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
usb-storage: 1e 00 00 00 01 00 00 00 bc fc f5 00
usb-storage: Bulk command S 0x43425355 T 0xe Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xe R 0 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0xe Trg 0 LUN 0 L 18 F 128 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 18 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 18/18
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xe R 0 Stat 0x0
usb-storage: -- Result from auto-sense is 0
usb-storage: -- code: 0x70, key: 0x5, ASC: 0x24, ASCQ: 0x0
usb-storage: Illegal Request: invalid field in CDB
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command START_STOP (6 bytes)
usb-storage: 1b 00 00 00 01 00 00 00 00 00 00 00
usb-storage: Bulk command S 0x43425355 T 0xf Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0xf R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command READ_10 (10 bytes)
usb-storage: 28 00 00 00 00 00 00 00 01 00 00 00
usb-storage: Bulk command S 0x43425355 T 0x10 Trg 0 LUN 0 L 512 F 128 CL
10
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 512 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 512/512
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x10 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
fatfs: bogus logical sector size 20487
VFS: Can't find a valid MSDOS filesystem on dev 08:00.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel