linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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; 9+ 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] 9+ 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
  0 siblings, 2 replies; 9+ 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] 9+ messages in thread

end of thread, other threads:[~2002-09-17 23:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.33L2.0209171627330.14033-100000@dragon.pdx.osdl.net>
2002-09-17 23:46 ` [Linux-usb-users] Re: Problems accessing USB Mass Storage Mark C
2002-09-17 22:51 Mark C
2002-09-17 23:09 ` [Linux-usb-users] " Randy.Dunlap
  -- 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 18:22 Randy.Dunlap
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).