Click to See Complete Forum and Search --> : usb memory stick


sniper32
09-26-2003, 07:01 AM
i bought a usb memory stick (Lexar, 256MB, USB2.0) to interchange data between two linux pcs (both with identical suse 8.1; kernel 2.4.19). on my computer at work everything works fine (hotplugging..), but when I'm plugging the stick into my box at home the whole system hangs and I have to restart by using the reset button.
generally, the usb support in my home pc is working and I'm syncing my palm without any problems.
some more information on my system:

lsmod:
usb-uhci 23084 0 (unused)
ehci-hcd 14888 0 (unused)
usbcore 61760 1 [usbserial snd usb-uhci ehci-hcd]

any suggestions??
thanks!

banzaikai
09-26-2003, 07:23 AM
Howdy.

Errr... Is there a "usb-storage" listed under your lsmod? If not, you need to recompile the kernal with the JumpDrive installed (so it can be detected). My JumpDrive Pro USB 2.0 (the one on sale not too long ago at OfficeMax) wasn't being seen on my system until I updated the kernel to version 2.4.20-20.7 using Redhat's up2date.

I'd suggest getting one of the 2.4.20-xx.x kernels, and recompiling (or use rpm / apt-get).

Now, I just have to get the darn thing mounted as my second scsi-controller...

Hope this helps...

banzai "kernel klink" kai

mrBen
09-26-2003, 07:25 AM
Are you using the hotplug manager at all?

I'm just trying to remember what modules I use for mine - some of them might (or might not be):

usbdevfs (not sure about this one)
usbstorage (you definitely need this one)
ide-scsi (sounds weird, but I think you need it - stick will act like a large scsi drive - /dev/sda)

Try adding those on, and seeing if it helps at all.

Also, do you have USB 2.0? If not, then take out the ehci module.

HTH

sniper32
09-27-2003, 06:12 AM
i know that the module usb-storage is missing, but I shouldn't be forced to recompile my kernel just to add a module. by the way, if I plugg the drive into the usb port EVERYTHING freezes immediately. I even tried it in RC3 with the same result.
I'm a little bit lost in the hotplugging concept. Where do I have to add a line like 'load usb-storage and scsi_mod' when I plugg my USB-drive in? the latter module seems to be missing, too (or it's called sr_mod???)..
I will just post the whole output of lsmod:

Module Size Used by Not tainted
snd-pcm-oss 48576 0 (autoclean)
snd-mixer-oss 12728 1 (autoclean) [snd-pcm-oss]
videodev 5600 0 (autoclean)
isa-pnp 29664 0 (unused)
usbserial 18492 0 (autoclean) (unused)
parport_pc 25544 1 (autoclean)
lp 6656 0 (autoclean)
parport 25056 1 (autoclean) [parport_pc lp]
ipv6 224220 -1 (autoclean)
snd-via8233 7820 1
snd-pcm 71296 0 [snd-pcm-oss snd-via8233]
snd-timer 13156 0 [snd-pcm]
snd-ac97-codec 26628 0 [snd-via8233]
snd 35556 0 [snd-pcm-oss snd-mixer-oss snd-via8233 snd-pcm snd-timer snd-ac97-codec]
soundcore 3396 0 [snd]
st 28460 0 (autoclean) (unused)
sr_mod 14616 0 (autoclean)
sg 29056 0 (autoclean)
joydev 5920 0 (unused)
evdev 4640 0 (unused)
input 3296 0 [joydev evdev]
usb-uhci 23084 0 (unused)
ehci-hcd 14888 0 (unused)
usbcore 61760 1 [usbserial snd usb-uhci ehci-hcd]
af_packet 13800 1 (autoclean)
8139too 15208 1
mii 1232 0 [8139too]
nls_iso8859-15 3324 2 (autoclean)
nls_cp437 4316 2 (autoclean)
vfat 9620 2 (autoclean)
fat 32376 0 (autoclean) [vfat]
lvm-mod 65408 0 (autoclean)
ide-scsi 8816 0
ide-cd 30340 0
cdrom 28736 0 [sr_mod ide-cd]
reiserfs 210644 1

suggestions??

I should have at least two USB2.0 ports:

guiri:/etc # lspci -v
00:10.0 USB Controller: VIA Technologies, Inc. USB (rev 80) (prog-if 00 [UHCI])
Subsystem: VIA Technologies, Inc. USB
Flags: bus master, medium devsel, latency 32, IRQ 11
I/O ports at e400 [size=32]
Capabilities: [80] Power Management version 2

00:10.1 USB Controller: VIA Technologies, Inc. USB (rev 80) (prog-if 00 [UHCI])
Subsystem: VIA Technologies, Inc. USB
Flags: bus master, medium devsel, latency 32, IRQ 11
I/O ports at e800 [size=32]
Capabilities: [80] Power Management version 2

00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82) (prog-if 20 [EHCI])
Subsystem: VIA Technologies, Inc. USB 2.0
Flags: bus master, medium devsel, latency 32, IRQ 5
Memory at dffffe00 (32-bit, non-prefetchable) [size=256]
Capabilities: [80] Power Management version 2

banzaikai
09-27-2003, 07:12 AM
Okay, then...

modprobe usb-storage, and see if the jumpdrive pops up. It's just that my drive wasn't even being seen until I ran up2date and bumped my kernel up to 2.4.20-20.7 (up2date uses rpms, btw). I figured since this fixed my problem (and a couple of other issues that had been bugging me), I figured you may benefit by just re-compiling.

Most usb controllers are actually "root hubs", and control two ports per hub, so it looks like you have six usb ports (4 usb1 and 2 usb2 -> uhci=v1.1 / ehci=v2.0).

As to your system freezing, it may be that since the usb-storage module isn't installed, the system may not know how to deal with it (another reason to bump up your kernel to 2.4.20-xx). Although when I plugged mine in using 2.4.19, it just ignored it. Another possibility may be you've got an IRQ/PnP problem - check the obvious first...

banzai

sniper32
09-28-2003, 10:13 AM
I feel that re-compiling could solve my problems, but I'm sure it should also work with the 2.4.19 since I use the USB stick at work without problems. I think I'm just overlooking some details or it's a chipset problem. Also had to patch my kernel to enable dma mode for my hdd.
I just post all the usb concerning output of /var/log/messages just to be sure that I'm not missing some obvious things. For me everything seems to be ok (hotplug, USB2.0.. ). In the last lines you can see that I add usb-storage manually and without any error message the system hangs after I plug the drive into the port. the last line is just the next reboot. I do not have any idea left, but would be thankful for any help.

/var/log/messages (in parts):

Sep 28 15:32:44 guiri /etc/hotplug/usb.rc[420]: loaded HCD: ehci-hcd
Sep 28 15:32:45 guiri /etc/hotplug/usb.rc[420]: loaded HCD: usb-uhci
Sep 28 15:32:45 guiri /etc/hotplug/usb.rc[420]: loaded HCD: ehci-hcd
.
.
Sep 28 15:32:49 guiri kernel: usb.c: registered new driver usbdevfs
Sep 28 15:32:49 guiri kernel: usb.c: registered new driver hub
Sep 28 15:32:49 guiri kernel: hcd.c: ehci-hcd @ 00:10.3, VIA Technologies, Inc. USB 2.0
Sep 28 15:32:49 guiri kernel: hcd.c: irq 5, pci mem e494ce00
Sep 28 15:32:49 guiri kernel: usb.c: new USB bus registered, assigned bus number 1
Sep 28 15:32:49 guiri kernel: ehci-hcd.c: USB 2.0 support enabled, EHCI rev 1. 0
Sep 28 15:32:49 guiri kernel: hub.c: USB hub found
Sep 28 15:32:49 guiri kernel: hub.c: 4 ports detected
Sep 28 15:32:49 guiri kernel: usb-uhci.c: $Revision: 1.275 $ time 00:17:20 Aug 5 2003
Sep 28 15:32:49 guiri kernel: usb-uhci.c: High bandwidth mode enabled
Sep 28 15:32:49 guiri kernel: usb-uhci.c: USB UHCI at I/O 0xe800, IRQ 11
Sep 28 15:32:49 guiri kernel: usb-uhci.c: Detected 2 ports
Sep 28 15:32:49 guiri kernel: usb.c: new USB bus registered, assigned bus number 2
Sep 28 15:32:49 guiri kernel: hub.c: USB hub found
Sep 28 15:32:49 guiri kernel: hub.c: 2 ports detected
Sep 28 15:32:49 guiri kernel: usb-uhci.c: USB UHCI at I/O 0xe400, IRQ 11
Sep 28 15:32:49 guiri kernel: usb-uhci.c: Detected 2 ports
Sep 28 15:32:49 guiri kernel: usb.c: new USB bus registered, assigned bus number 3
Sep 28 15:32:49 guiri kernel: hub.c: USB hub found
Sep 28 15:32:49 guiri kernel: hub.c: 2 ports detected
Sep 28 15:32:49 guiri kernel: usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
Sep 28 15:32:49 guiri kernel: uhci.c: USB Universal Host Controller Interface driver v1.1
.
.
Sep 28 15:32:54 guiri kernel: usb.c: registered new driver serial
Sep 28 15:32:54 guiri kernel: usbserial.c: USB Serial support registered for Generic
Sep 28 15:32:54 guiri kernel: usbserial.c: USB Serial Driver core v1.4
.
.
Sep 28 15:34:27 guiri kernel: Initializing USB Mass Storage driver...
Sep 28 15:34:27 guiri kernel: usb.c: registered new driver usb-storage
Sep 28 15:34:27 guiri kernel: USB Mass Storage support registered.
Sep 28 15:36:38 guiri syslogd 1.4.1: restart.

sniper32
09-28-2003, 11:09 AM
I changed the variable: HOTPLUG_USB_USE_USBMODULES in /etc/sysconfig/hotplug from 'no' to 'yes' and it takes about ten seconds til the pc hangs (just as usual..). the interesting thing is that this way I get more messages from the kernel!! the problems seems to be the usbdevfs!!

ep 28 16:46:50 guiri kernel: hub.c: USB new device connect on bus1/4, assigned device number 2
Sep 28 16:46:50 guiri kernel: scsi: limiting sg entries to 204
Sep 28 16:46:50 guiri kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Sep 28 16:46:50 guiri kernel: Vendor: LEXAR Model: JUMPDRIVE PRO Rev: 0
Sep 28 16:46:50 guiri kernel: Type: Direct-Access ANSI SCSI revision: 02
Sep 28 16:46:50 guiri kernel: sd: allocated major 8
Sep 28 16:46:50 guiri kernel: sg_attach: dev1=(21:1)
Sep 28 16:46:50 guiri kernel: sd: find_free_slot ...<7>sd: ... found 08:00
Sep 28 16:46:50 guiri kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Sep 28 16:46:50 guiri kernel: SCSI device sda: 503808 512-byte hdwr sectors (258 MB)
Sep 28 16:46:50 guiri kernel: sda: Write Protect is off
Sep 28 16:46:50 guiri kernel: sda: sda1
Sep 28 16:46:50 guiri kernel: WARNING: USB Mass Storage data integrity not assured
Sep 28 16:46:50 guiri kernel: USB Mass Storage device found at 2
Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 32 ret -71
Sep 28 16:46:54 guiri /etc/hotplug/usb.agent[1290]: cannot get config descriptor 0, Protocol error (71)
Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -71
Sep 28 16:46:54 guiri /etc/hotplug/usb.agent[1290]: cannot get config descriptor: Protocol error
Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -71
Sep 28 16:46:54 guiri /etc/hotplug/usb.agent[1290]: cannot get config descriptor: Protocol error
Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -71
Sep 28 16:46:54 guiri /etc/hotplug/usb.agent[1290]: cannot get config descriptor: Protocol error
Sep 28 16:49:02 guiri syslogd 1.4.1: restart.

banzaikai
09-30-2003, 08:48 AM
I just thought of somethin' silly...

Aside from the kernel version, and that I don't use the hotplug, the only differences between our machines lie in the fact that I don't have USB2 ports. The JumpDrive works just fine in a USB1.1 port (and pretty darn fast, too). Come to think of it, I've got mine plugged into a hub (all my usb ports are on the back of the computer, so it's easier to pop them in and out of the hub extension on top), although I doubt it's that.


Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 32 ret -71
Sep 28 16:46:54 guiri /etc/hotplug/usb.agent[1290]: cannot get config descriptor 0, Protocol error (71)
Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -71
Sep 28 16:46:54 guiri /etc/hotplug/usb.agent[1290]: cannot get config descriptor: Protocol error


I don't think it's the hotplug, since it just seems to be passing on what usbdevfs is reporting. It looks as if many people are having problems like this, as a Google search for "usb rqt rq len" pops up all kinds of usbdevfs related problems, not just with usb drives. Didn't see any solutions posted.

Here's what my /var/log/dmesg has to say on my system:

usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 15:05:55 Aug 18 2003
usb-uhci.c: High bandwidth mode enabled
usb-uhci.c: USB UHCI at I/O 0xd000, IRQ 11 <--motherboard "root hub"
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver <--ext. hub
hub.c: new USB device 00:07.2-1, assigned address 2
hub.c: USB hub found
hub.c: 7 ports detected
hub.c: new USB device 00:07.2-2, assigned address 3 <--my Intel microscope (cool gadget!)
usb.c: USB device 3 (vend/prod 0x813/0x1) is not claimed by any active driver.
hub.c: new USB device 00:07.2-1.3, assigned address 4 <--Jumpdrive
usb.c: USB device 4 (vend/prod 0x5dc/0x200) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
usb-uhci.c: interrupt, status 3, frame# 426
Vendor: LEXAR Model: JUMPDRIVE PRO Rev: 0
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
SCSI device sdb: 503808 512-byte hdwr sectors (258 MB)
sdb: Write Protect is off
sdb: sdb1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4 <--told ya it was the Jumpdrive
USB Mass Storage support registered.

And everything works. I'm thinking that it's gonna be something really stupid that we're not seeing - there's gotta be some difference between your two machines.

banzai "Know It's Something Stupid" kai

sniper32
09-30-2003, 12:53 PM
situation changed a little bit, but I'm not sure if it got better....
I think I messed the stick up by formatting it under xp. that explains why it doesn't work under linux and I get this strange error messages (Sep 28 16:46:54 guiri kernel: usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -71 ....).
to sum it up:

my test enviroment contains of 4 parts

PC A suse8.1 standard kernel
PC B suse8.1 standard, but patched kernel (my box...)
USBMEM 1 256MB - working in PC A, but not in B
USBMEM 2 256MB - neither working in PC A nor in PC B (mine!!)

to start with the biggest problems first:
how can I reanimate the USBMEM 2?? simple formatting with -fdisk doesn't seem to work (tried FAT16 and LINUX, whatever that means..).
:confused:
-with USBMEM 1 in PC B everything seems to be ok, but the hotplug manager does not add any line to the fstab, although the yast2 runlevel editor says it's working ), the drive is not loaded and obviously I won't be able to read/write from/the drive. I link the module usb-storage statically, because the hotplug won't do that, although it should. maybe it isn't working at all.
Apart from that, my dmesg looks pretty much the same, but apparently doesn't work similar.
meanwhile I changed so many things in the configuration that I'm begiining to lose the overview.
For the beginning I would be very thankful for a solution to the first problem.
!!keep trying!!

banzaikai
10-02-2003, 07:54 AM
Okay...

Lexar's site (http://www.lexarmedia.com) seems to be Win/Mac-centric, and I didn't see anything about formatting the darn things. So, I just "cat /proc/mounts" and got:

/dev/sdb1 /mnt/JumpDrive vfat rw 0 0

So, it looks as if the drive shows up as a FAT device (note: FAT16 supports partitions up to 2048MB, and FAT32 is up around 137GB {4Gb x 32K clusters}). Since you've only got a 256M device, either FAT will work.

If you have access to a Win machine,
You don't -format- with fdisk, you partition with it. Afterwards, you use the DOS format command, assuming it works like any other disk drive. WinXP changed how they do this, I think you have to go to "Manage this computer", then "(Hard) Drives", then partition/format from there. Oddly enough, I know only one person in my family that actually uses XP, so I don't have much practice with it... Gimme a DOS prompt anyday!

If that doesn't do the trick, you may have to call Lexar and ask how to re-prep the drive.

I noticed that my edited /etc/fstab had the line for the jumpdrive removed (???!), and I had to re-enter it (and mount manually), but it does work (as cat /proc/mounts shows). I'm thinking that kudzu hasn't got to the module loading for the drive until after fstab is run, and since it has no sdb1 to mount, it edits the file back to normal (instead of telling me "device /dev/sdb1" not available). I'll play with it and see...

banzai

sniper32
10-08-2003, 05:24 PM
finally I managed to reanimate my usb drive by formatting (?) it with the fdisk command under linux. the FS is called Verst. FAT16 (the program offers various types of FAT16 FSs). however, I'm able to access the drive from any linux box in my office and from winXP, but not from my pc at home.
Right now I'm trying to search for the error a little bit off topic.
I removed the module isa-pnp with rmmod and got a pretty good looking output from /var/log/messages. the icon for /dev/sda1 even appeared on my desktop and I tried to open the folder, but it was inaccesible. the system froze after a few minutes without any error message..
'regular looking output'...
hub.c: USB new device connect on bus1/2, assigned device number 2
Oct 8 22:49:39 guiri kernel: scsi: limiting sg entries to 204
Oct 8 22:49:39 guiri kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Oct 8 22:49:39 guiri kernel: Vendor: LEXAR Model: JUMPDRIVE PRO Rev: 0
Oct 8 22:49:39 guiri kernel: Type: Direct-Access ANSI SCSI revision: 02
Oct 8 22:49:39 guiri kernel: sd: allocated major 8
Oct 8 22:49:39 guiri kernel: sg_attach: dev1=(21:1)
Oct 8 22:49:39 guiri kernel: sd: find_free_slot ...<7>sd: ... found 08:00
Oct 8 22:49:39 guiri kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Oct 8 22:49:39 guiri kernel: SCSI device sda: 503808 512-byte hdwr sectors (258 MB)
Oct 8 22:49:39 guiri kernel: sda: Write Protect is off
Oct 8 22:49:39 guiri kernel: sda: sda1
Oct 8 22:49:39 guiri kernel: WARNING: USB Mass Storage data integrity not assured
Oct 8 22:49:39 guiri kernel: USB Mass Storage device found at 2
Oct 8 22:49:41 guiri /etc/hotplug/usb.agent[1541]: Can't ignore signal CHLD, forcing to default.


furthermore I discovered that I could have some IRQ conflicts (graphic adapter and USB hub both have IRQ 11), but I'm not able to change the IRQ for my vga since it is a agp.
any suggestions how I could manage my IRQs and how I could prevent isa-pnp from loading (I don't need it, do I??)
another remarkable thing is that in the output of the office's pcs there is a line starting with something similar to 'sg_init' or 'sd_init' that is lacking in the above output...
thanx for support

banzaikai
10-17-2003, 02:27 AM
finally I managed to reanimate my usb drive by formatting (?) it with the fdisk command under linux. the FS is called Verst. FAT16 (the program offers various types of FAT16 FSs). however, I'm able to access the drive from any linux box in my office and from winXP, but not from my pc at home.


Glad to know this, as the email I got from Lexar's tech support didn't answer squat (I offered to supply the proceedure for adding their drives to Linux boxes, as they don't have that info on their web page, and they told me how to get it going - incorrectly - , and didn't answer my other two questions about formatting and locking the drives). Oh, well.

The VFAT, IIRC, allows varying the size of clusters when formatting, to allow for optimization of available space. This means that if you have 2^16 clusters you can map (65,536), and have 256MB (268,435,456B) of space, then you can use 4KB (4,096B) clusters. If you use 8KB (8,192B) clusters, then you only need 2^15 (32,768) bits to map it. Anyway, it allows for this variable cluster sizing, settling on a maximum of 2^16 x 32KB clusters = 2GB max. When switching to 2^32 (FAT32), we get 4Gb x 32KB = 140 TB. However, using FAT-32, we could also use the same amount of bits to map smaller (and more manageable) clusters of 512B, which would still get us up to a 2.1GB sized drive before having to resort to 1K clusters.


another remarkable thing is that in the output of the office's pcs there is a line starting with something similar to 'sg_init' or 'sd_init' that is lacking in the above output...


Found a good site for checking on these weird items: http://om.cse.unsw.edu.au/lxr/linux/http/ident?i=sg_init
just punch in your criteria, and go...
It seems these are scsi-related inits, and may have already run on your system (check your boot log) prior to your message log.


furthermore I discovered that I could have some IRQ conflicts (graphic adapter and USB hub both have IRQ 11), but I'm not able to change the IRQ for my vga since it is a agp.


What's AGP got to do with it? After disabling my secondary IDE (since I have a SCSI card at another IRQ), my nVidia popped right into IRQ15 automatically. However, my USB and ETH0 share IRQ11, and both run just fine (but your mileage may vary).


Oct 8 22:49:41 guiri /etc/hotplug/usb.agent[1541]: Can't ignore signal CHLD, forcing to default.


Looked this up on Google, and found that the CHLD is something to do with the mail/messaging (CHange Log Directory?), and is probably indicating that the usb.agent can't write to the specified log, and is switching to the default (root?). I'd suggest trying without the hotplug and see what happens...

banzai

Satanic Atheist
10-17-2003, 06:52 AM
I know of computers that won't boot with a USB 1.1/2 compatible drive plugged into USB 1.1 (have to quickly plug it in whilst the machine boots). This doesn't happen with USB 2. I think it's a known bug that can't be solved (happens before OS takes control).

But, if you think crashing your machine with a USB Pendrive is a little extreme, I can crash mine just by disconnecting my speaker cable!

James