OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Debian => Topic started by: jpmatrix on October 19, 2007, 06:36:50 am

Title: Usb Storage
Post by: jpmatrix on October 19, 2007, 06:36:50 am
help
i'm trying to mount my usb key on debian tichy

so i've put these lines from angstrom fstab into /etc/fstab:

Quote
#
# USB
#
/dev/sda1       /media/usbhdd   vfat            noauto,umask=000,noatime,iocharset=utf8,codepage=932    0  0
devpts          /dev/pts        devpts          mode=0620,gid=5       0  0
usbfs           /proc/bus/usb   usbfs           defaults              0  0


then i've created /dev/sda nodes:
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2


then
modprobe usbstorage
then i plug my usb key

then mount /media/hdd

it fails with :

mount: /dev/sda1 is not a valid block device


any help please?
Title: Usb Storage
Post by: ZDevil on October 19, 2007, 07:49:15 am
How about:

modprobde ohci-hcd?

If that works, then simply add ohci-hcd to /etc/modules so that the module will load automatically when the system boots up.

Or ask the gurus?  
Title: Usb Storage
Post by: jpmatrix on October 19, 2007, 08:58:14 am
Quote from: ZDevil
How about:

modprobde ohci-hcd?

If that works, then simply add ohci-hcd to /etc/modules so that the module will load automatically when the system boots up.

Or ask the gurus?  


oh yeah i forgot the ohci-hcd stuff ..
unhopefully, i now have a curious message as i plug the key :

rejected 1 configuration due to insufficient available bus power
...........
Title: Usb Storage
Post by: ZDevil on October 19, 2007, 09:31:14 am
I got the same error when plugging in my Sony Ericsson w800i (which can function as a USB mass storage device).
Title: Usb Storage
Post by: jpmatrix on October 19, 2007, 09:49:40 am
Quote from: ZDevil
I got the same error when plugging in my Sony Ericsson w800i (which can function as a USB mass storage device).

hmm
i've just try to plug in my PSP (which has its own power!) and .. it works!
so is it a kernel problem or some config files to tweak ?
Title: Usb Storage
Post by: e.stoiber on October 19, 2007, 10:19:01 am
I have the same prob with insufficient power,
but I tested the stick with the stock sharp rom and there it got mounted without problems.
So it must be some kernel probs,.....or ?????
Title: Usb Storage
Post by: tux on October 19, 2007, 12:42:59 pm
Quote from: e.stoiber
I have the same prob with insufficient power,
but I tested the stick with the stock sharp rom and there it got mounted without problems.
So it must be some kernel probs,.....or ?????
 I've not tried my usb storage devices yet. I will try to find time to do so.  One suggestion: try the mount commands from a terminal and see what the messages are. I have had retorts from the system when mounting cards demanding that I specify the filetype. Yes, jp, I did notice the settings in your file! But I think it is probably easier to debug using mount from the command line. Don't know if this is anything to do with it. It shouldn't be kernel problems: if angstrom kernels were having difficulties in that respect the bug reports would be flying in.

I wonder how significant the message about power is?

I'll try one of my sticks that did work before Titchy and report any success or useful error messages back.  

PS Neil has put a source page on the TitchyLinux site. The kernel source is 2.6.20, which I believe is the base for the zImage on the site.
Title: Usb Storage
Post by: tux on October 19, 2007, 02:45:01 pm
 
Here is the list of modules that are loaded at the present:

debian:~# lsmod
Module                  Size  Used by
sd_mod                 15280  0
usb_storage            34788  0
scsi_mod               91848  2 sd_mod,usb_storage
ohci_hcd               20708  0
usbcore               117472  3 usb_storage,ohci_hcd
ipv6                  253404  12
snd_pcm_oss            49088  0
snd_mixer_oss          15328  2 snd_pcm_oss
snd_soc_spitz           5612  0
snd_soc_pxa2xx_i2s      3352  1 snd_soc_spitz
snd_soc_wm8750         18736  2 snd_soc_spitz
snd_soc_pxa2xx          4416  1 snd_soc_spitz
snd_soc_core           26176  3 snd_soc_spitz,snd_soc_wm8750,snd_soc_pxa2xx
snd_pcm                81381  3 snd_pcm_oss,snd_soc_pxa2xx,snd_soc_core
snd_timer              21828  1 snd_pcm
snd                    52084  7 snd_pcm_oss,snd_mixer_oss,snd_soc_spitz,snd_soc_wm8750,snd_soc_core,snd_pcm,snd_
imer
soundcore               6596  2 snd
snd_page_alloc          6312  1 snd_pcm
dm_snapshot            14816  0
dm_mirror              18868  0
dm_mod                 52396  2 dm_snapshot,dm_mirror
hostap_cs              55092  0
hostap                108932  1 hostap_cs
ieee80211_crypt         4928  1 hostap
orinoco_cs             13860  1
orinoco                40564  1 orinoco_cs
hermes                  5856  2 orinoco_cs,orinoco
mousedev                9788  1
debian:~#
I'll put the other bits in further posts.
 
Title: Usb Storage
Post by: tux on October 19, 2007, 02:57:11 pm
 What happens with the 128MB stick: when I connected the stick.

usb 1-2: new full speed USB device using pxa27x-ohci and address 5
usb 1-2: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
scsi 1:0:0:0: Direct-Access              disgo            4.31 PQ: 0 ANSI: 0 CCS
SCSI device sda: 239872 512-byte hdwr sectors (123 MB)
sda: Write Protect is off
sda: Mode Sense: 45 00 00 08
sda: assuming drive cache: write through

SCSI device sda: 239872 512-byte hdwr sectors (123 MB)
sda: Write Protect is off
sda: Mode Sense: 45 00 00 08
sda: assuming drive cache: write through
sda: unknown partition table
sd 1:0:0:0: Attached scsi removable disk sda
usb-storage: device scan complete

Then I used mount:

debian:/# mount /dev/sda1 /media/cf -t vfat

mount: special device /dev/sda1 does not exist


So I have used fdisk and will now format the stick as ext2 and see what happens
Title: Usb Storage
Post by: tux on October 19, 2007, 03:12:42 pm
 So I'm cheating and using gparted on 'Big Z'. I'm logged in as the 'normal' user while I'm SSHing in as root from my desktop.

I'm removing the stick and replacing it to see what dmesg says.

usb 1-2: new full speed USB device using pxa27x-ohci and address 7
usb 1-2: configuration #1 chosen from 1 choice
scsi3 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 7
usb-storage: waiting for device to settle before scanning
scsi 3:0:0:0: Direct-Access              disgo            4.31 PQ: 0 ANSI: 0 CCS
SCSI device sda: 239872 512-byte hdwr sectors (123 MB)
sda: Write Protect is off
sda: Mode Sense: 45 00 00 08
sda: assuming drive cache: write through
SCSI device sda: 239872 512-byte hdwr sectors (123 MB)
sda: Write Protect is off
sda: Mode Sense: 45 00 00 08
sda: assuming drive cache: write through
 sda: sda1

sd 3:0:0:0: Attached scsi removable disk sda
usb-storage: device scan complete


Now we'll see what mount produces:

debian:/# mount /dev/sda1 /media/cf
debian:/# ls /media/cf
lost+found
debian:/#


So success with a 128MB stick partitioned and formatted as ext2.

I'll experiment further with partitioning and formatting this and the larger devices.

I'm assuming from the other posts that sel-powered devices like my iriver and the Archos should be ok using mount? I'll leave it to you guys to play with fstab and such.

I'llget back if partitioning the bigger sticks gets over the bus power message. I suspect that some clever chap will need to tell us what to do to sort that out though.

Meanie, Koen where are you when we need you?  

Cheers

 
Title: Usb Storage
Post by: tux on October 19, 2007, 03:41:08 pm
 I've just connected my Archos PMA 430 to to Big Z! I might add I'm using the Archos host cable to the Z and the Archos data cable to join up to the Archos. Here is dmesg:

usb 1-2: new full speed USB device using pxa27x-ohci and address 8
usb 1-2: configuration #1 chosen from 1 choice
scsi4 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 8
usb-storage: waiting for device to settle before scanning
scsi 4:0:0:0: Direct-Access     HTC42603 0G7AT00               PQ: 0 ANSI: 0
SCSI device sda: 58605120 512-byte hdwr sectors (30006 MB)
sda: Write Protect is off
sda: Mode Sense: 33 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 58605120 512-byte hdwr sectors (30006 MB)
sda: Write Protect is off
sda: Mode Sense: 33 00 00 00
sda: assuming drive cache: write through
 sda: sda1 sda2
sd 4:0:0:0: Attached scsi disk sda
usb-storage: device scan complete
debian:/#

Yes it does show two partitions on the Archos. The openpma, uses bitbake? and OE stuff?, OS sets up two partitions to do its thing.

Now for the mount instruction:

debian:/# mount /dev/sda1 /media/sticks
debian:/# ls /media/sticks
books  Documents  Mophun  Music  pda  Photo  System  Video
debian:/#

sda1 on the Archos is the working partition.

debian:/# df /media/sticks
Filesystem           1K-blocks      Used  Available   Use% Mounted on
/dev/sda1          28702096   1100944  27601152   4%   /media/sticks
debian:/#

Approx 30GB available.

I think my iriver with the 40GB would mount also.

Shame I have no real use for this space as yet!

I will play about with other usb storage devices and in particular the bigger sticks. I'll report back. I hope someone has an idea about the bus power message. I'm, sure I scanned a post about that issue somewhere, ages ago. Can't remember where though.  

It's not all hopeless though, is it?
Title: Usb Storage
Post by: e.stoiber on October 19, 2007, 03:58:59 pm
So,... I did check some kernelsources on my gentoo box and it turns out,.......
there are changes since kernel 2.6.17 to check the powerconsumption !!
Title: Usb Storage
Post by: tux on October 19, 2007, 04:44:12 pm
Quote from: e.stoiber
So,... I did check some kernelsources on my gentoo box and it turns out,.......
there are changes since kernel 2.6.17 to check the powerconsumption !!
 looks like you have found some pointers to the problem. I expect there is a switch to turn off the checking somewhere!  

But I do know that  some people have used a powered hub to get round these problems. Not very convenient for usb sticks though.  

The two larger usb sticks I used, an Attache 1GB and a Disgo 512MB got the power message. The Disgo actually has a bright blue led that flashes on access.  

I was surprised to find that a cheap CF reader worked without complaint!   I did find that I needed to run fdisk /dev/sda and then quit from fdisk, before a 2GB CF card would work. I can't remember if I had to do that for the smaller one I tried.  

I tried a lexar JumpDrive, meant to be an SD card reader, which got the power message. I also tried a sdhc reader that came with the cards I use in the N800, that got the same message.

I have some other little gadgets that I will check out and report back on.

Somebody said that usb wifi dongles had problems running on Z power. I wonder if that problem is related.

I suppose that I should say I've been doing all this while the adapter is plugged in. Better check the success stories without external power!  

Cheers for now

 
Title: Usb Storage
Post by: e.stoiber on October 19, 2007, 04:52:42 pm
I checked further in hub.c source and at least the checking seems to be gone since 2.6.21,
so i'll try a 2.6.22 from angstrom tomorrow and see what it tells me.
Another possibility is to try the not working device if the "Z" is not on battery power.
Title: Usb Storage
Post by: jpmatrix on October 19, 2007, 05:36:55 pm
Quote from: e.stoiber
I checked further in hub.c source and at least the checking seems to be gone since 2.6.21,
so i'll try a 2.6.22 from angstrom tomorrow and see what it tells me.
Another possibility is to try the not working device if the "Z" is not on battery power.

i've tried with the Z not on battery power and same bus power message...
(i'm trying with a usb multi reader, trying to read a 2Gb MemoryStick card)


ps: i've tried the same reader while adding an external 4ports powered usb hub and it works! so the checking seems really there


ps: my MSI BT USB dongle works without any problem...
Title: Usb Storage
Post by: dlj0 on October 20, 2007, 09:57:37 am
Quote from: jpmatrix
Quote from: ZDevil
How about:

modprobde ohci-hcd?

If that works, then simply add ohci-hcd to /etc/modules so that the module will load automatically when the system boots up.

Or ask the gurus?  


oh yeah i forgot the ohci-hcd stuff ..
unhopefully, i now have a curious message as i plug the key :

rejected 1 configuration due to insufficient available bus power
...........

I got that message at one time, then got a powered usb hub -- very convenient for multiple devices.  But with debian I have been able to just plug in my usb keychain device, and it works.  The proper modules just load, once I start ohci-hcd.
Title: Usb Storage
Post by: dlj0 on October 20, 2007, 09:58:48 am
Quote from: jpmatrix
Quote from: ZDevil
I got the same error when plugging in my Sony Ericsson w800i (which can function as a USB mass storage device).

hmm
i've just try to plug in my PSP (which has its own power!) and .. it works!
so is it a kernel problem or some config files to tweak ?

I believe the limited power available to the usb port would be a hardware limitation, not something that could be re-configured.
Title: Usb Storage
Post by: dlj0 on October 20, 2007, 10:03:47 am
Quote from: tux
sda: unknown partition table
sd 1:0:0:0: Attached scsi removable disk sda
usb-storage: device scan complete

Then I used mount:

debian:/# mount /dev/sda1 /media/cf -t vfat

mount: special device /dev/sda1 does not exist


So I have used fdisk and will now format the stick as ext2 and see what happens

Huh.  Mine works fine with whatever fs (vfat, probably) that came on the thing.  I guess you have managed to mount it successfully on another machine, but that would be worth testing.  And, keeping the fs vfat makes the device usable on more machines.
Title: Usb Storage
Post by: ZDevil on October 20, 2007, 10:55:51 am
Quote from: dlj0
I believe the limited power available to the usb port would be a hardware limitation, not something that could be re-configured.

But my Z can connect and use the SE w800i phone in pdaX without trouble, while there is a error showing not enough power in Debian. So I rather think it is not really hardware limitation in some cases.
Title: Usb Storage
Post by: tux on October 20, 2007, 02:38:42 pm
Quote from: dlj0
Quote from: tux
sda: unknown partition table
sd 1:0:0:0: Attached scsi removable disk sda
usb-storage: device scan complete

Then I used mount:

debian:/# mount /dev/sda1 /media/cf -t vfat

mount: special device /dev/sda1 does not exist


So I have used fdisk and will now format the stick as ext2 and see what happens

Huh.  Mine works fine with whatever fs (vfat, probably) that came on the thing.  I guess you have managed to mount it successfully on another machine, but that would be worth testing.  And, keeping the fs vfat makes the device usable on more machines.
 In fact, any device that actually works at all will work with whatever format is on it. I was just checking if there was a problem with the default partitions on the device. There are some that seem to have a system all of their own.  

The interesting thing to me, was that the CF card reader worked. But I could only mount the CF card after I ran fdisk on /dev/sda. I didn't actually have to alter anything, just use it and quit. Then the CF card could be mounted.  

Some devices, like the swapped out 6GB drive, just hung when I ran fdisk. (Works fine in the CF slot.)

Strange happenings.

 
Title: Usb Storage
Post by: Marcin iwi Iwinski on March 06, 2008, 09:06:51 pm
I know that topic is quite old - but i'm having the "bus power" problem as well. I'm using sharp version of yongguns's 2.6.24. Did anyone find any solution ?
Title: Usb Storage
Post by: speculatrix on March 07, 2008, 03:48:39 am
when I first started using linux on the desktop full time (oh, about 7 years ago) I was trying to use a particular memory card reader with a sony memstick, and it just wouldn't work. then I discovered I had to do some patches to the kernel - scary stuff - and it worked. I investigated and found that apparently many manufacturers did not create hardware that properly fulfils the USB specifications, but that Windows was very lax about enforcing any standards, and thus the manufacturers got away with it. This means that linux had to add kludges to allow the hardware to work.
I would hope that in theory things are better now, but quite possibly not.

So, it's quite possible that the hardware will work, but reports the wrong information to the Z, which assumes that the usb device isn't functioning, reports an incorrect error, and fails to fire it up?
Title: Usb Storage
Post by: Marcin iwi Iwinski on March 07, 2008, 09:13:50 pm
I've found something eventually

https://www.oesf.org/forum/index.php?showto...&hl=pegasus (https://www.oesf.org/forum/index.php?showtopic=20739&hl=pegasus)
Title: Usb Storage
Post by: ZDevil on March 11, 2008, 06:26:57 am
Quote from: Marcin iwi Iwinski
I've found something eventually
https://www.oesf.org/forum/index.php?showto...&hl=pegasus (https://www.oesf.org/forum/index.php?showtopic=20739&hl=pegasus)
Does this trick work?
Title: Usb Storage
Post by: radiochickenwax on July 13, 2008, 07:45:21 pm
Quote from: ZDevil
Does this trick work?

Yes, this trick works... but it's kind of a pain to do this every time.

*EDIT*

I was thinking about trying to change the kernel configs for this reason.  Does anyone know which line it is to change this behavior?  Or is it not even the kernel?

*EDIT2*  

Udev might be a good workaround, according to post #5 in the following:

http://ubuntuforums.org/showthread.php?p=3533694#post3533694 (http://ubuntuforums.org/showthread.php?p=3533694#post3533694)

*EDIT3*

FWIW, there's a good deal of info at

http://www.mjmwired.net/kernel/Documentati...-management.txt (http://www.mjmwired.net/kernel/Documentation/usb/power-management.txt)
Title: Usb Storage
Post by: pelrun on July 13, 2008, 11:01:43 pm
The udev trick is the way to go, see my old post: https://www.oesf.org/forum/index.php?showto...st&p=177297 (https://www.oesf.org/forum/index.php?showtopic=25757&view=findpost&p=177297)