PDA

View Full Version : mounting memory stick


Unregistered
01-15-2003, 10:36 PM
Does anyone know anything about mounting the memory stick?

I've had a lot of trouble under both RedHat and Mandrake, can anyone describe their setup that got this working?

Pieter

xDownForNowx
01-16-2003, 11:13 AM
From what I've read in the posts, before the db melt down, no-one has sucssessfully mounted the stick via clie in linux. You might want to try a mem stick reader. I hear that works.

windex82
01-16-2003, 08:29 PM
I was under the impression that enableing USB memory device in the kernel and re-compiling allowed you to mount /usb/whateverusbmemorydevicesarecalled /mnt
... i guess its not so easy?

longshadow
01-17-2003, 04:40 AM
Mounting MS from Clie to Linux desktop works perfectly in 2.4.x kernels (sure for 2.4.20, may be earlier kernels around 3-5 patchlevels down works too).

You need to enable following options in kernel config:
CONFIG_USB=y
CONFIG_USB_STORAGE=m
CONFIG_USB_STORAGE_DEBUG=y

and, for USB hub controller, one of following:
CONFIG_USB_UHCI=m
- or -
CONFIG_USB_OHCI=m

It depends of Your motherboard (UHCI works perfectly in most cases; compile both as modules and see what one working for You).

After recompilaton insert modules as following:
modprobe usb-storage
modprobe usb-uhci (or usb-ohci)

Create directory for using as mount point for Memory Stick (for example /mnt/ms).

Put Your Clie in cradle and run MSImport application on it.

After message "Connected to PC" appears on Clie screen, mount MS from host computer:
mount -t vfat /dev/sda1 /mnt/ms

That's all.

Warning: do not mount MS with 'sync' option - it crashes both Clie and host kernel when transferring files to MS.

Warning: do not tap 'Disconnect' on Clie until unmounting MS at host computer.

longshadow
01-17-2003, 05:02 AM
Sorry, I forget to mention... You, of course, need to compile SCSI disks support in Linux kernel besides USB storage support:

CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=m

Sorry for carelessness...

xDownForNowx
01-17-2003, 09:24 AM
you stallion...

windex82
01-17-2003, 12:02 PM
See, i thought it was that easy... just gotta enable usb storage in my kernel, eh and forget mandrake or redhat gentoo is the way to go, sorry didnt mean to start a distro war ;)

johnnyhill
01-20-2003, 05:56 PM
I patched to a 2.4.20 kernel but still have problems.If I try mount -t vfat /dev/sda1 /mnt , i get mount: /dev/sda1 is not a valid block device. I get these messages in /var/log/messages - any ideas ?



Jan 20 22:18:07 larry kernel: visor.c: USB HandSpring Visor, Palm m50x, Sony Clié driver v1.5
Jan 20 22:18:07 larry insmod: Using /lib/modules/2.4.19-4GB/kernel/drivers/usb/serial/visor.o
Jan 20 22:18:07 larry insmod: Symbol version prefix ''
Jan 20 22:18:18 larry kernel: usb.c: USB disconnect on device 2
Jan 20 22:18:18 larry kernel: usbserial.c: Sony Clié 4.x converter now disconnected from ttyUSB0
Jan 20 22:18:18 larry kernel: usbserial.c: Sony Clié 4.x converter now disconnected from ttyUSB1
Jan 20 22:24:36 larry kernel: hub.c: USB new device connect on bus1/1, assigned device number 3
Jan 20 22:24:36 larry kernel: usb.c: USB device 3 (vend/prod 0x54c/0x99) is not claimed by any active driver.
Jan 20 22:24:37 larry kernel: Initializing USB Mass Storage driver...
Jan 20 22:24:37 larry kernel: usb.c: registered new driver usb-storage
Jan 20 22:24:37 larry kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jan 20 22:24:43 larry kernel: usb-uhci.c: interrupt, status 3, frame# 705
Jan 20 22:24:43 larry kernel: usb.c: USB disconnect on device 3
Jan 20 22:24:44 larry kernel: hub.c: USB new device connect on bus1/1, assigned device number 4
Jan 20 22:24:46 larry kernel: sg: find_free_slot ...<7>sg: initializing sg_major_array ...<4>sg: allocated major 21
Jan 20 22:24:46 larry kernel: sg: ... found 15:00
Jan 20 22:24:46 larry kernel: sg_attach: dev0=(21:0)
Jan 20 22:24:46 larry kernel: Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type -1
Jan 20 22:24:46 larry kernel: resize_dma_pool: unknown device type -1
Jan 20 22:24:48 larry kernel: usb-uhci.c: interrupt, status 3, frame# 1620
Jan 20 22:24:48 larry kernel: scsi: device set offline - not ready or command retry failed after bus reset: host 0 channel 0 id 0 lun 0
Jan 20 22:24:48 larry insmod: Using /lib/modules/2.4.19-4GB/kernel/drivers/usb/storage/usb-storage.o
Jan 20 22:24:48 larry insmod: Symbol version prefix ''
Jan 20 22:24:48 larry kernel: WARNING: USB Mass Storage data integrity not assured
Jan 20 22:24:48 larry kernel: USB Mass Storage device found at 3
Jan 20 22:24:48 larry kernel: USB Mass Storage support registered.
Jan 20 22:24:49 larry kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jan 20 22:24:49 larry kernel: resize_dma_pool: unknown device type -1
Jan 20 22:24:49 larry kernel: usb-uhci.c: ENXIO 80000480, flags 0, urb c95fc1c0, burb c95fc5c0
Jan 20 22:24:49 larry last message repeated 3 times
Jan 20 22:24:49 larry /etc/hotplug/usb.agent[1892]: Can't ignore signal CHLD, forcing to default.
Jan 20 22:24:50 larry kernel: resize_dma_pool: unknown device type -1
Jan 20 22:24:53 larry kernel: usb-uhci.c: interrupt, status 3, frame# 488
Jan 20 22:24:58 larry kernel: usb-uhci.c: interrupt, status 3, frame# 1404

cyclone
01-20-2003, 08:14 PM
Let me amend xDownForNowx's comment regarding no one having successfully mounted a memory stick under Linux. That should be, no one has successfully mounted an NX-series memory stick under Linux. If someone has, please share here!

longshadow
01-21-2003, 03:20 AM
Don't know about OS5 based Clies. And original poster does not mention about NX. I done this for OS4.1 based NR70 - works perfectly.

Sorry for misinformation.

oldpdaguy
04-26-2003, 12:19 PM
The 2.4.20-8 kernel in stock RedHat 9.0 works fine with my N760 (Palm OS 4.1). This is the first time I've been able to mount and access the memory stick from linux. Woohoo!

Joerg_Mosthaf
04-30-2003, 05:02 AM
Originally posted by johnnyhill
I patched to a 2.4.20 kernel but still have problems.If I try mount -t vfat /dev/sda1 /mnt , i get mount: /dev/sda1 is not a valid block device. I get these messages in /var/log/messages - any ideas ?



Jan 20 22:18:07 larry kernel: visor.c: USB HandSpring Visor, Palm m50x, Sony Clié driver v1.5
Jan 20 22:18:07 larry insmod: Using /lib/modules/2.4.19-4GB/kernel/drivers/usb/serial/visor.o
Jan 20 22:18:07 larry insmod: Symbol version prefix ''
Jan 20 22:18:18 larry kernel: usb.c: USB disconnect on device 2
Jan 20 22:18:18 larry kernel: usbserial.c: Sony Clié 4.x converter now disconnected from ttyUSB0
Jan 20 22:18:18 larry kernel: usbserial.c: Sony Clié 4.x converter now disconnected from ttyUSB1
Jan 20 22:24:36 larry kernel: hub.c: USB new device connect on bus1/1, assigned device number 3
Jan 20 22:24:36 larry kernel: usb.c: USB device 3 (vend/prod 0x54c/0x99) is not claimed by any active driver.
Jan 20 22:24:37 larry kernel: Initializing USB Mass Storage driver...
Jan 20 22:24:37 larry kernel: usb.c: registered new driver usb-storage
Jan 20 22:24:37 larry kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jan 20 22:24:43 larry kernel: usb-uhci.c: interrupt, status 3, frame# 705
Jan 20 22:24:43 larry kernel: usb.c: USB disconnect on device 3
Jan 20 22:24:44 larry kernel: hub.c: USB new device connect on bus1/1, assigned device number 4
Jan 20 22:24:46 larry kernel: sg: find_free_slot ...<7>sg: initializing sg_major_array ...<4>sg: allocated major 21
Jan 20 22:24:46 larry kernel: sg: ... found 15:00
Jan 20 22:24:46 larry kernel: sg_attach: dev0=(21:0)
Jan 20 22:24:46 larry kernel: Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type -1
Jan 20 22:24:46 larry kernel: resize_dma_pool: unknown device type -1
Jan 20 22:24:48 larry kernel: usb-uhci.c: interrupt, status 3, frame# 1620
Jan 20 22:24:48 larry kernel: scsi: device set offline - not ready or command retry failed after bus reset: host 0 channel 0 id 0 lun 0
Jan 20 22:24:48 larry insmod: Using /lib/modules/2.4.19-4GB/kernel/drivers/usb/storage/usb-storage.o
Jan 20 22:24:48 larry insmod: Symbol version prefix ''
Jan 20 22:24:48 larry kernel: WARNING: USB Mass Storage data integrity not assured
Jan 20 22:24:48 larry kernel: USB Mass Storage device found at 3
Jan 20 22:24:48 larry kernel: USB Mass Storage support registered.
Jan 20 22:24:49 larry kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Jan 20 22:24:49 larry kernel: resize_dma_pool: unknown device type -1
Jan 20 22:24:49 larry kernel: usb-uhci.c: ENXIO 80000480, flags 0, urb c95fc1c0, burb c95fc5c0
Jan 20 22:24:49 larry last message repeated 3 times
Jan 20 22:24:49 larry /etc/hotplug/usb.agent[1892]: Can't ignore signal CHLD, forcing to default.
Jan 20 22:24:50 larry kernel: resize_dma_pool: unknown device type -1
Jan 20 22:24:53 larry kernel: usb-uhci.c: interrupt, status 3, frame# 488
Jan 20 22:24:58 larry kernel: usb-uhci.c: interrupt, status 3, frame# 1404

exactly the same problem here. And afterwards my USB is completely haywire, I have to reboot.
Any idea? I have my kernel compiled with all USB and SCSI options on. My USB Memorystick and USB mouse work perfectly, my Visor Pro can be synced via USB without problems - its just the Clie that screws up.

dBass 1.7
09-26-2003, 12:22 PM
"That's all.

Warning: do not mount MS with 'sync' option - it crashes both Clie and host kernel when transferring files to MS.

Warning: do not tap 'Disconnect' on Clie until unmounting MS at host computer."

Excuse my ignorance please. What is 'sync' option?

dBass 1.7
09-26-2003, 12:24 PM
That's all.

Warning: do not mount MS with 'sync' option - it crashes both Clie and host kernel when transferring files to MS.

Warning: do not tap 'Disconnect' on Clie until unmounting MS at host computer.


What is 'sync' mode?

ceratophyllum
09-26-2003, 10:18 PM
I have found the MS, SD, CF, are all pretty much flakey in linux. I have tried a variety of readers and a variety of media and sometimes the media just won't mount no way no how. Then other times it works perfectly. Sometimes running fdisk /dev/sda and just quitting fdisk and trying again to mount the media works. Other times, the mount process goes zombie, as do all subsequent attempts to mount the device. Nothing less than rebooting helps. I don't mean to point the finger at MS or any particular media/PDA in question; it just seems like USB-storage devices on linux are all unreliable. There is often some stuff in the dmesg about trouble reading the partition table of /dev/sda. I'm running gentoo, using the 2.4.20 gentoo-sources and I have a clie SJ33. I have had practically all the Palms up to the (horrid!) Tungsten T and a Sharp Zaurus SL5000D and I am most impressed with the SJ33. I have found that the Lexar Trio JUmpDrive (reads SD/MS) works very well under linux. You can get them at walmart for $20.00.

cyclone
10-03-2003, 05:32 PM
I haven't seen any flakiness when mounting MS or SD using one of the little 2" dongles (red for SD, green for MS) that plugs into the USB port. I do note that you have to wait about two seconds after inserting before mounting, however, presumably to let the kernel figure out what you've just inserted.

Has anyone been able to use a multi-device reader (i.e. one with one slot for SD, another slot for MS, etc.)? If so, how are the different slots referenced? Is the first one /dev/sda1, second one /dev/sda2, etc.? Or sda, sdb, etc.?

Bill

ceratophyllum
10-04-2003, 12:07 PM
I think they are sda,sdb,sdc, etc. After you insert the usb connector, type dmesg and you should see some messages about which device it is. I pretty much only use CF and MS so I can live with 2 separate thingies to plug in.

kormoc
10-11-2003, 02:28 PM
ok guys, I'm new to the forum, else I would have chimed in earlier.

With Kernel versions greater then 2.4.21, you only need
CONFIG_USB
CONFIG_USB_STORAGE
CONFIG_USB_UHCI or CONFIG_USB_OHCI
CONFIG_SCSI
CONFIG_BLK_DEV_SD
CONFIG_HOTPLUG

and for syncing you will also need:
CONFIG_USB_SERIAL
CONFIG_USB_SERIAL_VISOR

With kerenels 2.4.20 and below, you will need to patch the kernel.

Here's the patch:
--- linux/drivers/usb/storage/transport.c.orig Tue Dec 4 16:55:13 2001
+++ linux/drivers/usb/storage/transport.c Tue Dec 4 16:58:10 2001
@@ -817,10 +817,7 @@
}
/* was this a command-completion interrupt? */
- if (us->irqbuf[0] && (us->subclass != US_SC_UFI)) {
- US_DEBUGP("-- not a command-completion IRQ\n");
- return;
- }
+ us->irqbuf[0] = 0;

/* was this a wanted interrupt? */
if (!atomic_read(us->ip_wanted)) {

Or just replace these lines:

/* was this a command-completion interrupt? */
if (us->irqbuf[0] && (us->subclass != US_SC_UFI)) {
US_DEBUGP("-- not a command-completion IRQ\n");
return;
}

With :

us->irqbuf[0] = 0;

With different revisions of the kernel, the line number may change, so you might have to look around in the source, but the code should be exactly as shown.

Compile the kernel and install it and reset.

Now, put the clie in the cradle, and run msimport and you should see this when you run dmesg:
hub.c: new USB device 00:1d.1-1, assigned address 12
usb.c: kmalloc IF d8ae5c80, numif 1
usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0
usb.c: USB device number 12 default language ID 0x409
Manufacturer: Sony
Product: Sony PEG Mass Storage
usb-storage: act_altsettting is 0
usb-storage: id_index calculated to be: 66
usb-storage: Array length appears to be: 75
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xc3869a00 Out: 0xc3869a14 Int: 0xc3869a28 (Period 1)
usb-storage: Found existing GUID 054c00d90000000000000000
usb-storage: Allocating IRQ for CBI transport
usb-storage: usb_submit_urb() returns 0
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 12
usb.c: usb-storage driver claimed interface d8ae5c80
usb.c: kusbd: /sbin/hotplug add 12
usb.c: kusbd policy returned 0xfffffffe
hub.c: port 2, portstatus 100, change 0, 12 Mb/s
hub.c: port 1, portstatus 103, change 0, 12 Mb/s
hub.c: port 2, portstatus 100, change 0, 12 Mb/s

Now you should have /dev/sda1 (or sdb or sdc etc depending on how many scsi disks you have on your system.

If it complains about not being able to read the partition table, then you need to fsck the block device:
fsck.vfat /dev/sda

Then you should have /dev/sda1.

What I do is create /mnt/clie and put this line into my /etc/fstab file:
/dev/sda1 /mnt/clie vfat user,noauto 0 0

Now a normal user can mount the memory stick and umount it as well.

Also, if you are using the gentoo kernel sources, it's a bit odd with the usb stuff, the normal kernel is a lot better.

If your going to try to use one of those 6 in 1 card readers, good luck. I have yet to get mine to work. I get all six devices (sda to sdf) but I can not mount anything.

Make sure you don't remove the clie when it is copying files. It tends to screw up the memory stick's filesystem and sometimes locks the computer (I've only had this happen with the gentoo sources).

When you go to unmount the memory stick, sometimes it takes awhile, it has to sync the filesystem with the virtual one the kernel keeps with the one that's really on the clie. It shouldn't never take more then a few min.

I hope this helps some people.