* Re: Problems accessing USB Mass Storage
@ 2002-09-17 18:15 Jonathan Corbet
2002-09-17 18:22 ` Randy.Dunlap
2002-09-18 9:22 ` Andries Brouwer
0 siblings, 2 replies; 19+ messages in thread
From: Jonathan Corbet @ 2002-09-17 18:15 UTC (permalink / raw)
To: gen-lists; +Cc: linux-kernel
Don't know if this is helpful or not, but, based on my messing around with
SmartMedia USB stuff...
SmartMedia cards are weird in that they have a (seemingly) random amount of
waste space at the beginning of the card. Your 8MB card, in particular,
has nothing of interest in the first 25 sectors. Some cards have a
reasonable partition table in the first sector, and some don't. Modern
Windows systems (and cameras, of course) seem to be able to access the
filesystem on the card without needing to see a partition table.
A little while I posted a Lexar SmartMedia driver patch which hacked around
this by substituting a fake partition table when the first sector was read.
I'm not sure it's the right solution, though. A better way, perhaps, is a
little user-space program which writes the appropriate partition table
depending on the card capacity. Note that fdisk doesn't (easily) work for
this purpose, since it wants partitions to start on cylinder boundaries.
You might try just using dd to copy your card to disk with an offset of 25
sectors, and see of you can mount the resulting image.
Then again, the interface to some SmartMedia readers is vastly more
complicated, as the sddr09 driver shows.
jon
Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 18:15 Problems accessing USB Mass Storage Jonathan Corbet
@ 2002-09-17 18:22 ` Randy.Dunlap
2002-09-17 19:46 ` Mark C
2002-09-17 19:50 ` Thomas Dodd
2002-09-18 9:22 ` Andries Brouwer
1 sibling, 2 replies; 19+ messages in thread
From: Randy.Dunlap @ 2002-09-17 18:22 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: gen-lists, linux-kernel
On Tue, 17 Sep 2002, Jonathan Corbet wrote:
| Don't know if this is helpful or not, but, based on my messing around with
| SmartMedia USB stuff...
|
| SmartMedia cards are weird in that they have a (seemingly) random amount of
| waste space at the beginning of the card. Your 8MB card, in particular,
| has nothing of interest in the first 25 sectors. Some cards have a
| reasonable partition table in the first sector, and some don't. Modern
| Windows systems (and cameras, of course) seem to be able to access the
| filesystem on the card without needing to see a partition table.
|
| A little while I posted a Lexar SmartMedia driver patch which hacked around
| this by substituting a fake partition table when the first sector was read.
| I'm not sure it's the right solution, though. A better way, perhaps, is a
| little user-space program which writes the appropriate partition table
| depending on the card capacity. Note that fdisk doesn't (easily) work for
| this purpose, since it wants partitions to start on cylinder boundaries.
|
| You might try just using dd to copy your card to disk with an offset of 25
| sectors, and see of you can mount the resulting image.
|
| Then again, the interface to some SmartMedia readers is vastly more
| complicated, as the sddr09 driver shows.
This is a bit like what we (JE, David Brownell, and I) saw at
the USB plugfest in 1999. We had a camera device that we
couldn't mount as a filesystem, but we could dd it.
When we did that and studied the dd-ed file, we could see a
FAT filesystem beginning after the first <N> blocks (but more than
25 sectors IIRC -- more like after 50-100 KB, or maybe even more).
--
~Randy
"Linux is not a research project. Never was, never will be."
-- Linus, 2002-09-02
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 18:22 ` Randy.Dunlap
@ 2002-09-17 19:46 ` Mark C
2002-09-17 20:12 ` jbradford
2002-09-17 21:21 ` Jonathan Corbet
2002-09-17 19:50 ` Thomas Dodd
1 sibling, 2 replies; 19+ messages in thread
From: Mark C @ 2002-09-17 19:46 UTC (permalink / raw)
To: linux-kernel
On Tue, 2002-09-17 at 19:22, Randy.Dunlap wrote:
> This is a bit like what we (JE, David Brownell, and I) saw at
> the USB plugfest in 1999. We had a camera device that we
> couldn't mount as a filesystem, but we could dd it.
> When we did that and studied the dd-ed file, we could see a
> FAT filesystem beginning after the first <N> blocks (but more than
> 25 sectors IIRC -- more like after 50-100 KB, or maybe even more).
Sorry to sound a bit bewildered, but would be the next best thing for me
to do on this?,
I have also been advised by Jonathan Corbet
to use dd to copy your card to disk with an offset of 25
looking through the info and man pages for dd, I can find no mention of
offset at all, the next best thing I could find was the command option
'skip'
Sorry to sound abit overwhelmed.
Mark
--
---
To steal ideas from one person is plagiarism;
to steal from many is research.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 19:46 ` Mark C
@ 2002-09-17 20:12 ` jbradford
2002-09-17 21:21 ` Jonathan Corbet
1 sibling, 0 replies; 19+ messages in thread
From: jbradford @ 2002-09-17 20:12 UTC (permalink / raw)
To: Mark C; +Cc: linux-kernel
> > This is a bit like what we (JE, David Brownell, and I) saw at
> > the USB plugfest in 1999. We had a camera device that we
> > couldn't mount as a filesystem, but we could dd it.
> > When we did that and studied the dd-ed file, we could see a
> > FAT filesystem beginning after the first <N> blocks (but more than
> > 25 sectors IIRC -- more like after 50-100 KB, or maybe even more).
>
> Sorry to sound a bit bewildered, but would be the next best thing for me
> to do on this?,
> I have also been advised by Jonathan Corbet
> to use dd to copy your card to disk with an offset of 25
Have you tried reading from a different card? The common opinion seems to be that the actual data starts some way in to the card, and as you get an input/output error when you try to access the card from the begining, it could be that there is a genuine media error, that is not showing up when you use drivers from another OS, that do not attempt to read those first few blocks, because they 'know' where the filesystem begins.
Just an idea, anyway.
John.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 19:46 ` Mark C
2002-09-17 20:12 ` jbradford
@ 2002-09-17 21:21 ` Jonathan Corbet
1 sibling, 0 replies; 19+ messages in thread
From: Jonathan Corbet @ 2002-09-17 21:21 UTC (permalink / raw)
To: Mark C; +Cc: linux-kernel
> I have also been advised by Jonathan Corbet
> to use dd to copy your card to disk with an offset of 25
>
> looking through the info and man pages for dd, I can find no mention of
> offset at all, the next best thing I could find was the command option
> 'skip'
That's what I meant. Something like:
dd if=/dev/sda of=/somewhere/image skip=25
If that works, please let me know - maybe there *is* a place for my hackish
fake partition table patch...
jon
Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 18:22 ` Randy.Dunlap
2002-09-17 19:46 ` Mark C
@ 2002-09-17 19:50 ` Thomas Dodd
2002-09-17 19:58 ` Matthew Dharm
1 sibling, 1 reply; 19+ messages in thread
From: Thomas Dodd @ 2002-09-17 19:50 UTC (permalink / raw)
To: linux-kernel, linux-usb-users
Mark C. Wrote:
>>> [root@stimpy dev]# dd if=/dev/sda of=/dev/null bs=1k count=1
>>> dd: reading `/dev/sda': Input/output error
>>> 0+0 records in
>>> 0+0 records out
Randy.Dunlap wrote:
> On Tue, 17 Sep 2002, Jonathan Corbet wrote:
>
> |
> | You might try just using dd to copy your card to disk with an offset of 25
> | sectors, and see of you can mount the resulting image.
>
> This is a bit like what we (JE, David Brownell, and I) saw at
> the USB plugfest in 1999. We had a camera device that we
> couldn't mount as a filesystem, but we could dd it.
> When we did that and studied the dd-ed file, we could see a
> FAT filesystem beginning after the first <N> blocks (but more than
> 25 sectors IIRC -- more like after 50-100 KB, or maybe even more).
See the above form Mark's post. He tried to dd a 1K block
and it failed. Granted, The first few blocks may need to be skipped,
but right now he cannot even get the raw data out.
If we can get the data, we can use the loop device to mount it.
Any ideas to figure out the why the dd fails?
-Thomas
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 19:50 ` Thomas Dodd
@ 2002-09-17 19:58 ` Matthew Dharm
2002-09-17 20:13 ` Thomas Dodd
0 siblings, 1 reply; 19+ messages in thread
From: Matthew Dharm @ 2002-09-17 19:58 UTC (permalink / raw)
To: Thomas Dodd; +Cc: linux-kernel, linux-usb-users
[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]
The device may not actually have the beginning few sectors. Use skip= to
try to read something from the middle of the media.
Yes, I actually have seen this before. The firmware 'fakes' a partition
table on the first attempt to read one, but sector 0 really isn't there.
Matt
On Tue, Sep 17, 2002 at 02:50:32PM -0500, Thomas Dodd wrote:
>
> Mark C. Wrote:
> >>> [root@stimpy dev]# dd if=/dev/sda of=/dev/null bs=1k count=1
> >>> dd: reading `/dev/sda': Input/output error
> >>> 0+0 records in
> >>> 0+0 records out
>
>
> Randy.Dunlap wrote:
> > On Tue, 17 Sep 2002, Jonathan Corbet wrote:
> >
> > |
> > | You might try just using dd to copy your card to disk with an offset of 25
> > | sectors, and see of you can mount the resulting image.
> >
> > This is a bit like what we (JE, David Brownell, and I) saw at
> > the USB plugfest in 1999. We had a camera device that we
> > couldn't mount as a filesystem, but we could dd it.
> > When we did that and studied the dd-ed file, we could see a
> > FAT filesystem beginning after the first <N> blocks (but more than
> > 25 sectors IIRC -- more like after 50-100 KB, or maybe even more).
>
> See the above form Mark's post. He tried to dd a 1K block
> and it failed. Granted, The first few blocks may need to be skipped,
> but right now he cannot even get the raw data out.
>
> If we can get the data, we can use the loop device to mount it.
>
> Any ideas to figure out the why the dd fails?
>
> -Thomas
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
How would you like this tie wrapped around your hairy round head?
-- Greg
User Friendly, 9/2/1998
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 19:58 ` Matthew Dharm
@ 2002-09-17 20:13 ` Thomas Dodd
2002-09-17 21:13 ` [Linux-usb-users] " Mark C
2002-09-18 9:28 ` Andries Brouwer
0 siblings, 2 replies; 19+ messages in thread
From: Thomas Dodd @ 2002-09-17 20:13 UTC (permalink / raw)
To: Matthew Dharm; +Cc: linux-kernel, linux-usb-users, gen-lists
Matthew Dharm wrote:
> The device may not actually have the beginning few sectors. Use skip= to
> try to read something from the middle of the media.
Give that a go Mark.
Try a few values like 25, 50, 75, and 100. with bs=1k and
unset (default 512 byte).
> Yes, I actually have seen this before. The firmware 'fakes' a partition
> table on the first attempt to read one, but sector 0 really isn't there.
Am I glad I have a CF camera:) What kind of
junk is SmartMedia, missing sectors? Ugh!
-Thomas
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 20:13 ` Thomas Dodd
@ 2002-09-17 21:13 ` Mark C
2002-09-17 21:40 ` Thomas Dodd
2002-09-17 21:58 ` Rogier Wolff
2002-09-18 9:28 ` Andries Brouwer
1 sibling, 2 replies; 19+ messages in thread
From: Mark C @ 2002-09-17 21:13 UTC (permalink / raw)
To: linux-usb-users; +Cc: linux-kernel
On Tue, 2002-09-17 at 21:13, Thomas Dodd wrote:
>
> Give that a go Mark.
>
> Try a few values like 25, 50, 75, and 100. with bs=1k and
> unset (default 512 byte).
If I'm reading this correctly, I have been trying:
[root@stimpy mark]# dd if=/dev/sda of=tmp/tmp.img skip=50 \
bs=1k dd: reading `/dev/sda': Input/output error
0+0 records in
0+0 records out
Then the output of dmesg:
SCSI device (ioctl) reports ILLEGAL REQUEST.
SCSI device sda: 16384 512-byte hdwr sectors (8 MB)
sda: test WP failed, assume Write Enabled
sda: I/O error: dev 08:00, sector 0
I/O error: dev 08:00, sector 0
unable to read partition table
I/O error: dev 08:00, sector 96
I have altered skip from 25 - 100 and received the same errors, except
the sectors change in size with relation to altering the skip size.
This may be the wrong way of running the command, if so I'm sorry for
wasting peoples time on that.
Mark
--
---
To steal ideas from one person is plagiarism;
to steal from many is research.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 21:13 ` [Linux-usb-users] " Mark C
@ 2002-09-17 21:40 ` Thomas Dodd
2002-09-17 21:51 ` Mark C
2002-09-17 21:58 ` Rogier Wolff
1 sibling, 1 reply; 19+ messages in thread
From: Thomas Dodd @ 2002-09-17 21:40 UTC (permalink / raw)
To: Mark C; +Cc: linux-usb-users, linux-kernel
Mark C wrote:
> [root@stimpy mark]# dd if=/dev/sda of=tmp/tmp.img skip=50 \
> bs=1k dd: reading `/dev/sda': Input/output error
That's correct.
> Then the output of dmesg:
>
> SCSI device (ioctl) reports ILLEGAL REQUEST.
> SCSI device sda: 16384 512-byte hdwr sectors (8 MB)
> sda: test WP failed, assume Write Enabled
> sda: I/O error: dev 08:00, sector 0
> I/O error: dev 08:00, sector 0
> unable to read partition table
> I/O error: dev 08:00, sector 96
That's what I expected. I didn't help.
Sector 96 is a little odd. 50 1K blocks
should be sector 99. (counting starts at zero)
I wonder why 96 is accessed...
This is really starting to look like it's
*NOT* really a Mass Storage Class device,
just claiming to be. (black list time?)
I noticed the windows driver setup several
other interfaces, like audio and VfW (video).
Best sugestion for now is buy 1) a memory card,
2) a card reader that works there are several.
It probably doesn't use the internal memory if a card
is loaded, but you'd have to read the manul/test to
find out. 8M isn't much room for pics at 1280x1024
any way :)
-Thomas
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 21:40 ` Thomas Dodd
@ 2002-09-17 21:51 ` Mark C
0 siblings, 0 replies; 19+ messages in thread
From: Mark C @ 2002-09-17 21:51 UTC (permalink / raw)
To: Thomas Dodd; +Cc: linux-usb-users, linux-kernel
On Tue, 2002-09-17 at 22:40, Thomas Dodd wrote:
> Sector 96 is a little odd. 50 1K blocks
> should be sector 99. (counting starts at zero)
>
> I wonder why 96 is accessed...
>
> This is really starting to look like it's
> *NOT* really a Mass Storage Class device,
> just claiming to be. (black list time?)
Now how did I know you were going to say that :-)
>
> I noticed the windows driver setup several
> other interfaces, like audio and VfW (video).
It can do streaming Audio/Video
> Best sugestion for now is buy 1) a memory card,
> 2) a card reader that works there are several.
I have a 16mb Stmart Media Card included with the pack.
Can you possibly suggest any card readers that *will* work on Linux =>
2.4.18 (ie use a specific type, usb, serial) and do they have to be
compatible with specific memory cards?
Sorry to sound vague, but I've never used one before.
Just fishing :-)..I do a google...
And if so any chance of a few quick links on getting the memory card
readers to work?
(don't worry too much about that, I just figured if you know any that
were maybe bookmarked)
> It probably doesn't use the internal memory if a card
> is loaded, but you'd have to read the manul/test to
> find out. 8M isn't much room for pics at 1280x1024
> any way :)
True :-)
--
---
To steal ideas from one person is plagiarism;
to steal from many is research.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 21:13 ` [Linux-usb-users] " Mark C
2002-09-17 21:40 ` Thomas Dodd
@ 2002-09-17 21:58 ` Rogier Wolff
2002-09-17 22:17 ` Thomas Dodd
1 sibling, 1 reply; 19+ messages in thread
From: Rogier Wolff @ 2002-09-17 21:58 UTC (permalink / raw)
To: Mark C; +Cc: linux-usb-users, linux-kernel
On Tue, Sep 17, 2002 at 10:13:13PM +0100, Mark C wrote:
> On Tue, 2002-09-17 at 21:13, Thomas Dodd wrote:
>
> >
> > Give that a go Mark.
> >
> > Try a few values like 25, 50, 75, and 100. with bs=1k and
> > unset (default 512 byte).
>
> If I'm reading this correctly, I have been trying:
>
> [root@stimpy mark]# dd if=/dev/sda of=tmp/tmp.img skip=50 \
> bs=1k dd: reading `/dev/sda': Input/output error
> 0+0 records in
> 0+0 records out
Guys,
When dd is told to skip a certain number of input blocks it doesn't
seek past them, but reads them and then discards them. Thus if you're
not supposed to read sectors 1-100 then this will not work.
Try the following program:
/* seek.c (C) R.E.Wolff@harddisk-recovery.nl */
/*
gcc -Wall -O2 seek.c -o seek
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#ifndef O_LARGEFILE
#define O_LARGEFILE 0100000
#endif
long long lseek64 (int fd, long long offset, int whence);
int main (int argc,char **argv)
{
long long off;
long long tt;
if(argc < 2)
exit(0); /* don't seek at all */
if (strncmp (argv[1],"0x",2) )
sscanf (argv[1],"%Ld",&off);
else
sscanf (argv[1],"%Lx",&off);
if (argc > 3) {
if (strncmp (argv[3],"0x",2) )
sscanf (argv[3],"%Ld",&tt);
else
sscanf (argv[3],"%Lx",&tt);
if (argv[2][0] == '+')
off += tt;
else
off -= tt;
}
errno = 0;
if ((lseek64 (0,off,SEEK_CUR) < 0) &&
(errno != 0))
perror ("seek");
exit (0);
}
with the command:
dd if=/dev/sda of=firstpart
(Get the partition table)
(seek 0x100000;dd of=secondpart) < /dev/sda
Get everything beyond 1Mb. If this works, then we have to figure out
how low we can make the "0x100000" number to get all of the data.
Hypothesis: The partition table specifies that the data starts
on sector 200, and they didn't implement sectors 1-199.....
Cheap basterds.
(My memory stick is just over 128 * 10^6 bytes, and not even
close to 128 * 2^20 bytes....)
Roger.
--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* The Worlds Ecosystem is a stable system. Stable systems may experience *
* excursions from the stable situation. We are currenly in such an *
* excursion: The stable situation does not include humans. ***************
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 21:58 ` Rogier Wolff
@ 2002-09-17 22:17 ` Thomas Dodd
2002-09-17 22:23 ` Randy.Dunlap
0 siblings, 1 reply; 19+ messages in thread
From: Thomas Dodd @ 2002-09-17 22:17 UTC (permalink / raw)
To: linux-kernel; +Cc: Rogier Wolff, gen-lists, linux-usb-users
Rogier Wolff wrote:
> On Tue, Sep 17, 2002 at 10:13:13PM +0100, Mark C wrote:
> When dd is told to skip a certain number of input blocks it doesn't
> seek past them, but reads them and then discards them. Thus if you're
> not supposed to read sectors 1-100 then this will not work.
Fair enough. I, and the others though it did a seek.
> Try the following program:
<snip>
> with the command:
>
> dd if=/dev/sda of=firstpart
>
> (Get the partition table)
>
> (seek 0x100000;dd of=secondpart) < /dev/sda
>
> Get everything beyond 1Mb. If this works, then we have to figure out
> how low we can make the "0x100000" number to get all of the data.
>
> Hypothesis: The partition table specifies that the data starts
> on sector 200, and they didn't implement sectors 1-199.....
Where did the sector 200 come from?
Something in the dmesg output from before?
(I don't really grok SCSI or USB at that level :( )
> Cheap basterds.
Agree:)
-Thomas
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 22:17 ` Thomas Dodd
@ 2002-09-17 22:23 ` Randy.Dunlap
0 siblings, 0 replies; 19+ messages in thread
From: Randy.Dunlap @ 2002-09-17 22:23 UTC (permalink / raw)
To: Thomas Dodd; +Cc: linux-kernel, Rogier Wolff, gen-lists, linux-usb-users
On Tue, 17 Sep 2002, Thomas Dodd wrote:
| Rogier Wolff wrote:
| > On Tue, Sep 17, 2002 at 10:13:13PM +0100, Mark C wrote:
|
| > When dd is told to skip a certain number of input blocks it doesn't
| > seek past them, but reads them and then discards them. Thus if you're
| > not supposed to read sectors 1-100 then this will not work.
|
| Fair enough. I, and the others though it did a seek.
|
| > Try the following program:
| <snip>
| > with the command:
| >
| > dd if=/dev/sda of=firstpart
| >
| > (Get the partition table)
| >
| > (seek 0x100000;dd of=secondpart) < /dev/sda
| >
| > Get everything beyond 1Mb. If this works, then we have to figure out
| > how low we can make the "0x100000" number to get all of the data.
| >
| > Hypothesis: The partition table specifies that the data starts
| > on sector 200, and they didn't implement sectors 1-199.....
|
| Where did the sector 200 come from?
| Something in the dmesg output from before?
| (I don't really grok SCSI or USB at that level :( )
I think that's part of the hypothesis, but if we can read the
first sector, it should be trivial to decode the partition table,
if it's a typical DOS/Windows/PC-type partition table.
If someone can read the first sector, I'll be glad to decode it;
just send it.
--
~Randy
"Linux is not a research project. Never was, never will be."
-- Linus, 2002-09-02
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 20:13 ` Thomas Dodd
2002-09-17 21:13 ` [Linux-usb-users] " Mark C
@ 2002-09-18 9:28 ` Andries Brouwer
1 sibling, 0 replies; 19+ messages in thread
From: Andries Brouwer @ 2002-09-18 9:28 UTC (permalink / raw)
To: Thomas Dodd; +Cc: Matthew Dharm, linux-kernel, linux-usb-users, gen-lists
On Tue, Sep 17, 2002 at 03:13:43PM -0500, Thomas Dodd wrote:
> Am I glad I have a CF camera:) What kind of
> junk is SmartMedia, missing sectors? Ugh!
People are just spreading misinformation.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
2002-09-17 18:15 Problems accessing USB Mass Storage Jonathan Corbet
2002-09-17 18:22 ` Randy.Dunlap
@ 2002-09-18 9:22 ` Andries Brouwer
1 sibling, 0 replies; 19+ messages in thread
From: Andries Brouwer @ 2002-09-18 9:22 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: gen-lists, linux-kernel
On Tue, Sep 17, 2002 at 12:15:13PM -0600, Jonathan Corbet wrote:
> SmartMedia cards are weird in that they have a (seemingly) random amount of
> waste space at the beginning of the card. Your 8MB card, in particular,
> has nothing of interest in the first 25 sectors. Some cards have a
> reasonable partition table in the first sector, and some don't. Modern
> Windows systems (and cameras, of course) seem to be able to access the
> filesystem on the card without needing to see a partition table.
>
> A little while I posted a Lexar SmartMedia driver patch which hacked around
> this by substituting a fake partition table when the first sector was read.
The structure of SmartMedia cards is well-known and precisely documented.
See, e.g., http://www.win.tue.nl/~aeb/linux/smartmedia/SmartMedia_Format.pdf
What varies is how readers present this to the outside world.
The card starts with the CIS, followed by a remapping table that tells
where on the card a given user sector lives. There are also sector checksums
and information about bad sectors.
Some readers have this as built-in knowledge, and present to card to
the outside world as an ordinary block device.
Some readers give direct access to the bits on the card, and then
understanding this remapping business is a job for the driver.
If you see non-understood space at the beginning of the card,
then one might suspect that your reader is of the latter kind.
The partition table will be on the card, but not on sector zero.
Andries
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
@ 2002-09-17 22:04 Thomas Dodd
2002-09-17 22:12 ` [Linux-usb-users] " Randy.Dunlap
0 siblings, 1 reply; 19+ messages in thread
From: Thomas Dodd @ 2002-09-17 22:04 UTC (permalink / raw)
To: Rogier Wolff; +Cc: linux-kernel, linux-usb-users
Rogier Wolff wrote:
> On Tue, Sep 17, 2002 at 10:46:31AM -0700, Greg KH wrote:
>
>>On Tue, Sep 17, 2002 at 12:37:37PM -0500, Thomas Dodd wrote:
>>
>>>I get the feeling it's not a true mass storage device.
>>
>>Sounds like it.
>
>
> Nope. Sure does sound like it's a mass storage device. And it works
> too.
>
> The kernel managed to read the partition table off it, and got
> one valid partition: sda1.
Accept that you cannot read data from the device. At all.
Even dd fails. And the windows drivers work (using XP
in vmware it think it was) correctly on this same device.
-Thomas
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 22:04 Thomas Dodd
@ 2002-09-17 22:12 ` Randy.Dunlap
0 siblings, 0 replies; 19+ messages in thread
From: Randy.Dunlap @ 2002-09-17 22:12 UTC (permalink / raw)
To: Thomas Dodd; +Cc: Rogier Wolff, linux-kernel, linux-usb-users
On Tue, 17 Sep 2002, Thomas Dodd wrote:
|
|
| Rogier Wolff wrote:
| > On Tue, Sep 17, 2002 at 10:46:31AM -0700, Greg KH wrote:
| >
| >>On Tue, Sep 17, 2002 at 12:37:37PM -0500, Thomas Dodd wrote:
| >>
| >>>I get the feeling it's not a true mass storage device.
| >>
| >>Sounds like it.
| >
| >
| > Nope. Sure does sound like it's a mass storage device. And it works
| > too.
| >
| > The kernel managed to read the partition table off it, and got
| > one valid partition: sda1.
|
| Accept that you cannot read data from the device. At all.
| Even dd fails. And the windows drivers work (using XP
| in vmware it think it was) correctly on this same device.
Really? Rogier's 'seek.c' program looks quite feasible to me.
'dd' wasn't seeking beyond sectors, it was trying to read &
discard them.
--
~Randy
"Linux is not a research project. Never was, never will be."
-- Linus, 2002-09-02
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: Problems accessing USB Mass Storage
@ 2002-09-17 22:51 Mark C
2002-09-17 23:09 ` [Linux-usb-users] " Randy.Dunlap
0 siblings, 1 reply; 19+ messages in thread
From: Mark C @ 2002-09-17 22:51 UTC (permalink / raw)
To: Patrick Mansfield; +Cc: linux-kernel, linux-usb-users
On Tue, 2002-09-17 at 23:21, Patrick Mansfield wrote:
> You should be able to run the equivalent:
>
> dd if=/dev/sda of=/dev/zero bs=512 count=8
I done that and please find the output below:
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command START_STOP (6 bytes)
usb-storage: 1b 00 00 00 01 00 74 c1 00 00 00 00
usb-storage: Bulk command S 0x43425355 T 0x20 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: clearing endpoint halt for pipe 0xc0038280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: Attempting to get CSW (2nd try)...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x20 R 0 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0x20 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 0x20 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.
SCSI device (ioctl) reports ILLEGAL REQUEST.
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 e9 df
usb-storage: Bulk command S 0x43425355 T 0x21 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 0x21 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 e9 df
usb-storage: Bulk command S 0x43425355 T 0x22 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 0x22 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sda: 16384 512-byte hdwr sectors (8 MB)
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage: 1a 00 3f 00 ff 00 00 00 00 00 e9 df
usb-storage: Bulk command S 0x43425355 T 0x23 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 -32 xferred 0/255
usb-storage: clearing endpoint halt for pipe 0xc0038280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: usb_stor_transfer_partial(): unknown error
usb-storage: Bulk data transfer result 0x2
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x23 R 255 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0x23 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 0x23 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.
sda: test WP failed, assume Write Enabled
sda: I/O error: dev 08:00, sector 0
I/O error: dev 08:00, sector 0
unable to read partition table
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
usb-storage: 1e 00 00 00 01 00 d7 d4 b7 1e 14 c0
usb-storage: Bulk command S 0x43425355 T 0x24 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 0x24 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
I/O error: dev 08:00, sector 0
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
usb-storage: 1e 00 00 00 00 00 12 c0 30 33 67 d5
usb-storage: Bulk command S 0x43425355 T 0x25 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 0x25 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
Thanks
Mark
--
---
To steal ideas from one person is plagiarism;
to steal from many is research.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
2002-09-17 22:51 Mark C
@ 2002-09-17 23:09 ` Randy.Dunlap
0 siblings, 0 replies; 19+ messages in thread
From: Randy.Dunlap @ 2002-09-17 23:09 UTC (permalink / raw)
To: Mark C; +Cc: Patrick Mansfield, linux-kernel, linux-usb-users
On 17 Sep 2002, Mark C wrote:
| On Tue, 2002-09-17 at 23:21, Patrick Mansfield wrote:
|
| > You should be able to run the equivalent:
| >
| > dd if=/dev/sda of=/dev/zero bs=512 count=8
|
| I done that and please find the output below:
So most (all?) of these don't work.
Have you tried Rogier's 'seek' program yet?
| sda: test WP failed, assume Write Enabled
| sda: I/O error: dev 08:00, sector 0
| I/O error: dev 08:00, sector 0
| unable to read partition table
If sector 0 isn't readable, just use the secondpart instructions
that Rogier posted. Start with a fairly large number (like he
used, was it 0x10000 ?). If that works, use smaller values of
the seek offset and try to find the smallest value that still
works. The first sector with the smallest value that works
_might_ be a master boot record/partition table with some useful
info in it, or it might just be a boot record followed by a
FAT filesystem, or something_else_who_knows_what.
Anyway, if you can do that, you can post the data and I'll take
a look at it.
--
~Randy
"Linux is not a research project. Never was, never will be."
-- Linus, 2002-09-02
^ permalink raw reply [flat|nested] 19+ messages in thread
[parent not found: <Pine.LNX.4.33L2.0209171627330.14033-100000@dragon.pdx.osdl.net>]
* Re: [Linux-usb-users] Re: Problems accessing USB Mass Storage
[not found] <Pine.LNX.4.33L2.0209171627330.14033-100000@dragon.pdx.osdl.net>
@ 2002-09-17 23:46 ` Mark C
0 siblings, 0 replies; 19+ messages in thread
From: Mark C @ 2002-09-17 23:46 UTC (permalink / raw)
To: Randy.Dunlap, Thomas Dodd, Matthew Dharm, Rogier Wolff
Cc: linux-usb-users, linux-kernel
On Wed, 2002-09-18 at 00:29, Randy.Dunlap wrote:
> On 18 Sep 2002, Mark C wrote:
>
> | On Wed, 2002-09-18 at 00:09, Randy.Dunlap wrote:
> |
> | > Have you tried Rogier's 'seek' program yet?
> |
> | Yes, but I think I'm getting the whole syntax wrong.
>
> maybe so. he had (...) parens around the command and you don't.
> the parens are important there.
Running:
[root@stimpy mark]# (seek 0x100000;dd of=secondpart) < /dev/sda
dd: reading `standard input': Input/output error
0+0 records in
0+0 records out
Heres the dmesg output:
I/O error: dev 08:00, sector 2048
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
usb-storage: 1e 00 00 00 00 00 12 c0 70 ca 86 c4
usb-storage: Bulk command S 0x43425355 T 0x5b 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 0x5b R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
I think This is really taking up too many peoples personal time now,
So I'm going to purchase a Smart card reader and try to use that instead
(yes One I know Linux supports :-)).
I decided at the start if this week, to learn C, now I have a goal, I'm
going to get this camera working, if its the last thing I do (is its
possible at all).
Along the way I should gain a whole lot more knowledge into how the
kernel interacts with devices ( yes I know there is a lot to learn
before I start playing around with writing drivers, but this a target to
head for)
Once again I would like to thank everybody for the time and effort they
have put into this, Its really appreciated.
I anyone feels I'm just dropping this and wishes to get this cracked,
them I will be more than willing to carry on trying.
Cheers
Mark
--
---
To steal ideas from one person is plagiarism;
to steal from many is research.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2002-09-18 9:23 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-17 18:15 Problems accessing USB Mass Storage Jonathan Corbet
2002-09-17 18:22 ` Randy.Dunlap
2002-09-17 19:46 ` Mark C
2002-09-17 20:12 ` jbradford
2002-09-17 21:21 ` Jonathan Corbet
2002-09-17 19:50 ` Thomas Dodd
2002-09-17 19:58 ` Matthew Dharm
2002-09-17 20:13 ` Thomas Dodd
2002-09-17 21:13 ` [Linux-usb-users] " Mark C
2002-09-17 21:40 ` Thomas Dodd
2002-09-17 21:51 ` Mark C
2002-09-17 21:58 ` Rogier Wolff
2002-09-17 22:17 ` Thomas Dodd
2002-09-17 22:23 ` Randy.Dunlap
2002-09-18 9:28 ` Andries Brouwer
2002-09-18 9:22 ` Andries Brouwer
-- strict thread matches above, loose matches on Subject: below --
2002-09-17 22:04 Thomas Dodd
2002-09-17 22:12 ` [Linux-usb-users] " Randy.Dunlap
2002-09-17 22:51 Mark C
2002-09-17 23:09 ` [Linux-usb-users] " Randy.Dunlap
[not found] <Pine.LNX.4.33L2.0209171627330.14033-100000@dragon.pdx.osdl.net>
2002-09-17 23:46 ` Mark C
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox