LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 04-19-2004, 08:48 AM   #1
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Rep: Reputation: 15
Mounting USB 2.0 JetFlash memory stick causes hang


I recently bought a nice, new, aerodynamic USB memory stick. It works in Windows, it works in Mac, but Linux doesn't like it. Essentially, I follow typical procedures I found in various manuals and posts, and my system locks up and I have to reset the system.

I've gotten quite good at searching for and finding solutions to my Linux problems, but this one has me completely stumped. I've checked several USB how-to's, posts here, posts elsewhere.

System: Linux 2.4.20-8 (Redhat 9)
These were done under KDE 3 (for convenience, but the same things happen without.)
Athalon 900, 256MB, MB is Asus A7V133
Memory stick: Transcend JetFlash 128MB - it works on Win/Mac. Haven't tried on other Linuxes.

What I do:

"lsmod" tells me I haven't got "usb-storage" up, so:

root root# modprobe usb-storage

/var/log/messages says:
Apr 19 18:16:42 localhost kernel: Initializing USB Mass Storage driver...
Apr 19 18:16:42 localhost kernel: usb.c: registered new driver usb-storage
Apr 19 18:16:42 localhost kernel: USB Mass Storage support registered.

Just for info:

root root# mount
/dev/hde2 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)

Here I plug in the memory stick...

Apr 19 18:19:25 localhost kernel: hub.c: new USB device 00:04.2-2, assigned address 2
Apr 19 18:19:25 localhost kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Apr 19 18:19:25 localhost kernel: Vendor: JetFlash Model: TS128MJF2B Rev: 2.00
Apr 19 18:19:25 localhost kernel: Type: Direct-Access ANSI SCSI revision: 02
Apr 19 18:19:28 localhost /etc/hotplug/usb.agent: Setup usb-storage for USB product ea0/2168/200
Apr 19 18:19:29 localhost devlabel: devlabel service started/restarted

Another check:

root root# cat /proc/scsi/usb-storage-0/1
Host scsi1: usb-storage
Vendor: USB
Product: Flash Disk
Serial Number: BA0304403E93683E

Protocol: Transparent SCSI
Transport: Bulk
GUID: 0ea02168ba0304403e93683e
Attached: Yes

And now...

root root# mount -t vfat /dev/sda1 /flash

...the interesting part (by interesting, I mean hair-tearingly frustrating). The memory stick light comes on. After about 75 seconds, system locks up, and caps/scroll lock starts to flash. I have to reset the system (and remove the memory stick). After I boot up, I get this from the log:

This would be where I mounted it...
Apr 19 18:23:29 localhost kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
Apr 19 18:23:29 localhost kernel: SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
Apr 19 18:23:29 localhost kernel: sda: Write Protect is off
Apr 19 18:23:29 localhost kernel: sda: sda1 sda2 sda3 sda4
Presumably this corresponds to my system locking up etc.
Apr 19 18:24:44 localhost kernel: usb_control/bulk_msg: timeout
Apr 19 18:24:44 localhost kernel: usb.c: USB disconnect on device 00:04.2-2 address 2

Now, occasionally things happen slightly differently. I might get some weird messages after mount. Or, if I'm not under KDE, there are more prolific error messages spat out (which I don't know how to catch).

I don't even want to think about setting up fstab yet.

(Incidentally, how do I set things up so I don't have to "modprobe usb-storage" every time?)

Added: after reading a few threads, I ran "dmesg" - I'm hesitant to post the 164 lines; should I post the whole lot, or is there a specific part that is relevant? A quick grep for anything usb gives:

usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 17:26:20 Mar 13 2003
usb-uhci.c: High bandwidth mode enabled
usb-uhci.c: USB UHCI at I/O 0xd400, IRQ 9
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
usb-uhci.c: USB UHCI at I/O 0xd000, IRQ 9
usb-uhci.c: Detected 2 ports
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
usb.c: registered new driver hiddev
usb.c: registered new driver hid
hid-core.c: USB HID support drivers

I would appreciate any help
 
Old 04-21-2004, 05:44 AM   #2
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Okay, after a little more searching, I've become slightly more confused.

1) A few resources instruct me to "mount -t usb(dev)fs none /proc/bus/usb" before I do anything. But, as above, it seems something is already mounted there:

root root# mount
/dev/hde2 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)

Is this important?

2) Another site said that I should replace usb-uhci with uhci in /etc/modules. I don't have an /etc/modules, which makes this somewhat tricky.

3) Somewhere else said that there's nothing for it, I need the 2.6 kernel. The manufacturer claims it'll work on any 2.4+ kernel - I'm not one to take a manufacturers word as absolute truth, though...
 
Old 04-21-2004, 10:13 AM   #3
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
Plug it in and straight away run 'dmesg' in a console. Check the last few lines. You are looking for something like this....

usb 1-7: new high speed USB device using address 3
scsi4 : SCSI emulation for USB Mass Storage devices
Vendor: Generic Model: STORAGE DEVICE Rev: 1.01
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sdb: 16064 512-byte hdwr sectors (8 MB)
sdb: assuming Write Enabled
sdb: assuming drive cache: write through
sdb: sdb1
Attached scsi removable disk sdb at scsi4, channel 0, id 0, lun 0
Attached scsi generic sg2 at scsi4, channel 0, id 0, lun 0, type 0
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3

If that looks OK you should be able to check it out further with fdisk (e.g. fdisk /dev/sdb in this example), check the filesystem(s) on it, and so on. Maybe it is corrupted and that is why you get a system hang when you mount it.
 
Old 04-24-2004, 07:51 AM   #4
od51
LQ Newbie
 
Registered: Apr 2004
Location: Australia
Distribution: Mandrake 9.0 /10.0
Posts: 14

Rep: Reputation: 0
I stalled Mandrake 9.0 when I tried to use a recently acquired JetFlash USB memory stick as recommended in the provided pamphlet:
mount -a -t msdos /dev/sda1 /mnt/jetflash

A first, but minor, point is that the "-a" option is used to mount filesystems described in the file /etc/fstab. When you state the device and the mount point, the "a" option seems irrelevant.

The main point is that /dev/sda1 specifically refers to the first primary partition on the mass storage device, and so I checked how the thing was partitioned. The partition table contained invalid information, according to the command:
fdisk -l /dev/sda
The first sector on the memory stick was a label for a FAT16 file system, from the text shown by the command:
dd if=/dev/sda bs=512 count=1 | hexdump -C

Then I successfully mounted the whole device (/dev/sda)with the command:
mount -t msdos /dev/sda /mnt/jetflash

I guess that when the memory stick was first used by just plugging it into Windows (Win2k) it was automatically formatted without partitioning (in "superfloppy" mode).

I would guess that it would be helpful to add an entry to the file /etc/fstab to make a user-mountable arrangement like that for a floppy or a CDROM.

On your last question, I did not need to run "modprobe". It seems to me that this is taken care of when the USB driver recognises that a new device has been plugged in.
 
Old 04-29-2004, 11:13 PM   #5
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks for the replies. Sorry for the week long silence, but not only have I been busy, my hard drive comitted hari-kari and I'm in the process of replacing it. Once my computer is back up and running, I'll see what happens...
 
Old 05-12-2004, 08:43 AM   #6
awjd1966
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
I ended up re-partitioning the Jetflash on my Windows box.
Not simple: 'cause using fdisk hung from the dos-prompt.

I used Usbstorage-tools to make the Jetflash bootable and then booted using it (in my case USB-HDD). Then I used FDISK from there (the jetflash was then C: ) I deleted and re-created primary partition.
Then used Format to re-format the jetflash.

(I read somwhere that the jetflash is shipped with some kind of super-floppy partition which is unrecognised by linux. It kept on saying that my USB drive was not a valid block device.)

Then inserted the jetflash into my linux box and hey-presto good as gold all worked as advertised on the Transcend web-site.

So hope this helps someone out there. Pity I had to use my windows box to do this maybe someone knows how to do this on linux???
 
Old 05-24-2004, 11:24 PM   #7
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Right. The problem was indeed shonky partitioning.

I've repartitioned it but forgot to save the fdisk output, but there were basically four partitions with various oddities (different logical/physical start and finish points if I recall), and Linux seemed to have problems with it. In the docs for umount it does indeed mention that mounting bad filesystems can crash the system, so it's not like I wasn't warned...

Before I repartitioned it, mounting /dev/sda worked (instead of sda1).

To repartition it, I:
0. Copied all my stuff to the hard drive;
1. Ran fdisk;
2. Deleted all four partitions;
3. Created a new, primary partition #1 of maximum size;
4. Set the type to b (Win95 FAT32);
5. Wrote the changes;
6. Ran mkdosfs /dev/sda1

This seemed to work okay in Linux (I can now mount sda and sda1) and in Windows (I can read and write to the partition). It also works okay in Mac OSX, but not in Mac OS9 (as it sort of did before).

Given that Mac OS9 itself doesn't work properly under Mac OS9, this doesn't surprise me; but nonetheless I shall try [awjd1966]'s solution and see if there's any difference.

Thank you all for your time.

(Now I have a problem with disconnecting it, but that's probably better as a separate thread.)
 
Old 05-25-2004, 03:33 AM   #8
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Quick correction:

When you run mkdosfs after creating the Win95 FAT32 partition, you should actually use:
mkdosfs -F 32 /dev/sda1
Otherwise it picks a number between 12-16 for the FAT. It also helps to run scandisk under Windows to pick up anything it that may cause problems (but beware of it mysteriously reverting to the bad partitions).

For some reason, Windows thinks I have an invisible 512B folder, but that doesn't worry me too much.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 06:39 PM
Transcend Jetflash 1GB USB Memory Stick on Fedora Core 3: Give it a volume label. Jim_Farmer Linux - Hardware 1 04-29-2005 01:32 PM
Prob. in mounting Jetflash USB2.0 mem stick in Suse 9.0 nilaybhatt Linux - Hardware 0 12-30-2004 01:25 AM
Prob. in mounting Jetflash USB2.0 mem stick in Suse 9.0 nilaybhatt Linux - Hardware 0 12-30-2004 12:56 AM
Want regular user to have memory stick mounting rights king8 Red Hat 3 11-10-2003 07:31 PM


All times are GMT -5. The time now is 02:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration