# Genuine question - usb flash disks and 2.6+

## Pink

Has anyone actually got their usb flash disk/usb mp3 player working in 2.6+ kernel? 

Please note, I am not asking about any other usb device - just flash drives. I am also not asking how to, their are plenty of other threads about it. Just the one simple question.

I know it works on my system - I run gs-sources (2.4.23) and plug it in (a bytestor 256mb flash drive), mount it (it is always /dev/sda1), copy files, delete files, unmount it. Plug it straight back in and repeat until not funny.

No matter what 2.6 kernel I use, from 2.6-test4 to 2.6.2-love1, they will not mount, (no block device) the first time, then unplug, plug it back in and nothing - absolutely nothing, no flicker, nothing. No change in /dev/sd, no flashing led on the flash drive - simply not seen.

This is the only reason I have not changed to 2.6+ (and I love the love-sources!)

So my simple question (again) has anyone got their usb flash drive working in 2.6+? (plug it in, mount it, unmount , plug it in again, etc)   :Shocked: 

Let me know I have a chance of sanity....

----------

## ehudokai

I have a Sony Clie N710C that my father recently gave me.

I had tryed before to mount it in linux under 2.6.  It mounts the memory stick exactly the same way as a usb drive.  I was unsuccessful until I went back to 2.4.  Then it mounted beautifully.....

Then I ran across this post on the clie-linux mailing list http://kreucher.net/pipermail/clie-linux/2004q1/000492.html

There the individual offers a patch to remove the strict protocol checking from the transport.c file.  I could be way off base, but your device may be violating the usb drive specs similarly to my sony clie's...

I haven't tested this yet, but I am about to and I'll let you know if it works.

-jb

----------

## 0ctane

 *ehudokai wrote:*   

> I haven't tested this yet, but I am about to and I'll let you know if it works.
> 
> -jb

 

Keep us posted.  I want to connect a Sony memorystick camera.  What kernel options are needed in 2.6?

----------

## ehudokai

Ok, well I was able to mount my memory stick under 2.6 with the patch mentioned previously.  However, there are still issues.

First is that it recognized the scsi disk and created a device for it, but apparently didn't scan the disk for partitions.. because no sda1 showed up. Once I used a partitioning tool to make sure the disk really was my MS, it then scanned and sda1 showed up, and I was able to mount it.

Second problem is that once I unmounted the device and tried disconnecting it, both the scsi_mod and usb_storage hung.  Thus trying to reattach the device was futile.

I am a programmer, but I know VERY little about kernel hacking.  I was trying to figure out how to increase the DEBUG level so I could see more in my logs, but haven't exactly figured out how to do that.

On the memory stick camera front, I have been able to mount my sony memory stick through my DV camera under 2.6, so you should be able to do that.  You need to have scsi enabled including the suboptions of scsi disk and scsi generic all preferably as modules, and the usb-storage module as well.  That should do it.  Then you should be able to plug it in, and if you have hotplug running it should autodetect it.  If not you can modprobe the appropriate modules.. which I think are 

```
scsi_mod sd_mod sg usb-storage

and your usb drivers
```

That should allow it to show up as well.  It ought to show up as /dev/sda1 unless that device is in use in which case /dev/sdb1 and so on... so mount that dev and you should be good.  Hope that helps  :Very Happy: 

If anyone has any links to some good kernel debugging howtos I would love the info!!!

----------

## creese

Using mm-souces-2.6.2-r1 my compact flash usb reader works. Only problem is that it doesn't scan the partition table. I have to do "fdisk /dev/sda" to get it to scan the table. Works fine after that. Plugging and unplugging works fine.

Chad

----------

## jetblack

 *PickledOnion wrote:*   

> So my simple question (again) has anyone got their usb flash drive working in 2.6+? (plug it in, mount it, unmount , plug it in again, etc)  

 

Yes. 128 MB SanDisk cruzer mini. works like a charm on every 2.6 kernel I've tried.

----------

## 0ctane

 *ehudokai wrote:*   

> 
> 
> On the memory stick camera front, I have been able to mount my sony memory stick through my DV camera under 2.6, so you should be able to do that.  You need to have scsi enabled including the suboptions of scsi disk and scsi generic all preferably as modules, and the usb-storage module as well.  That should do it.  Then you should be able to plug it in, and if you have hotplug running it should autodetect it
> 
> ...
> ...

 

I was adventurous and just plugged it in.  Worked fine in 2.6.1.  I did not have to enable any special scsi stuff in the kernel, just usb support.  I changed my /etc/fstab so that I could mount it as "user".  Unmounting leaves /dev/sda1 (other posts/threads mention this), but it is not giving me any troubles.  I can remount to the same location and everything works great.  The only downside is no long filenames.    :Smile: 

----------

## Pink

Thanks for all the replies - at least I know it is possible.

I don't mind things not working as long as I know they can - kind of like a light at the end of the tunnel...  :Very Happy: 

*goes back to searching for the solution*

----------

## ehudokai

 *0ctane wrote:*   

>  The only downside is no long filenames.   

 

Be sure your mounting it with the vfat filesystem type.

----------

## Pink

Linux 2.6.3-rc2 kernel is just out and there is an interesting remark in the changelog about usb:

 *Quote:*   

> USB gadget: file_storage.c -- remove device_unregister_wait()

 

Maybe this is the fix I've been waiting for, can't wait for Steel to release the love on this one...  :Very Happy: 

----------

## melanarchy

I am having the same problem as PickledOnion with my Toshiba PDR-M81 digital camera.  It worked fine with 2.4.x series kernels but when I plug it in to my 2.6.4 kernel I get the following dmesg:

```
usb 2-1: new full speed USB device using address 2

scsi0 : SCSI emulation for USB Mass Storage devices

```

from that point on the camera no longer shows a link when I try to turn it on.

The expectant behaviour would be that after plugging in the camera it would appear in /dev/sda as a file system (vfat) that I could mount, however after plugging the camera in /dev/sda does not appear.

I have USB compiled in, including USB Mass Storage, as well as USB file system support etc.

SCSI generic, disk, cdrom etc. 

Incidentally my ipod works better w/ 2.6.4 than it did with any of the 2.4 kernels.

mel

----------

## 0ctane

I did not have to use any of the SCSI emulation options to get my Sony DSC-V1 working (gentoo-dev-sources 2.6.3).  Maybe there is a conflict?  Possibly turn off scsi emulation if you do not need it for anything else.

----------

## wolfpakk

i have a usb sony digital camera (dcs p52) and vanilla-kernel 2.6.3 and have no problem mounting it as /dev/sda1

----------

## jamesm

 *PickledOnion wrote:*   

> Has anyone actually got their usb flash disk/usb mp3 player working in 2.6+ kernel? 
> 
> 

 

I have successfully mounted, and used, my Sony Memory Stick based camera (Sony DSC-P8) with 2.6.3 (vanilla sources)

----------

## Pink

Thanks, I have them working perfectly now - it was a general issue with the early 2.6 kernels (2.6.1 to be exact) - I think everyone has them working once they upgraded and any problems now are specific hardware problems.   :Very Happy: 

----------

