LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How do I get my USB memory stick to work in SuSE 8.2? (https://www.linuxquestions.org/questions/linux-hardware-18/how-do-i-get-my-usb-memory-stick-to-work-in-suse-8-2-a-144202/)

Paul_Lee 02-09-2004 05:31 PM

How do I get my USB memory stick to work in SuSE 8.2?
 
Hi all,
After much trial and tribulation I managed to get SuSE 8.2 installed and working.
However, I am still having problems getting it to recognise my USB memory
sticks (actually, I have two, and neither of them seem to work). I have a hub
connected to one of my USB ports, and I plug my stick into there, but there
is no indicator light on the stick, and (from what I can gather), an icon should
appear on the desktop, but one doesn't.

If I type mount into a shell, I get:

/dev/hda3 on / type reiserfs (rw)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda1 on /boot type ext2 (rw)
shmfs on /dev/shm type shm (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)

and if I do cat /etc/fstab, I get:
/dev/hda3 / reiserfs defaults 1 1
/dev/hda1 /boot ext2 defaults 1 2
/dev/hda2 swap swap pri=42 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
/dev/cdrecorder /media/cdrecorder auto ro,noauto,user,exec 0 0
/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0
/dev/fd0 /media/floppy auto noauto,user,sync 0 0

Someone suggested that I try looking at dmesg, and this is the output | grep usb:

usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-uhci.c: $Revision: 1.275 $ time 18:24:43 Mar 17 2003
usb-uhci.c: High bandwidth mode enabled
usb-uhci.c: v1.275:USB Universal Host Controller Interface driver
usb-ohci.c: USB OHCI at membase 0xc88f1000, IRQ 10
usb-ohci.c: usb-00:02.0, Acer Laboratories Inc. [ALi] USB 1.1 Controller
usb.c: new USB bus registered, assigned bus number 1
usb.c: USB device 2 (vend/prod 0x4b8/0x11d) is not claimed by any active driver.
usb.c: registered new driver usbscanner
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: USB Serial Driver core v1.4

Which means a lot to me! Can anyone suggest anything? I don't know which of
the /dev/sda*'s are allocated to the memory stick... if any!

Best wishes

Paul
--
http://www.paullee.com

ac1980 02-10-2004 05:17 PM

Try giving this command as root: "modprobe usb-storage"
then re-insert the key... it should be assigned sda1.

Paul_Lee 02-10-2004 05:28 PM

Thanks! I had a look at dmesg | tail -f

isapnp: No Plug & Play device found
eth0: no IPv6 routers present
Linux video capture interface: v1.00
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.

and re-inserted the memory stick....

Do I need to enter the details in my /etc/fstab ? And do I need to do the modprobe
command every time I want to insert the memory stick?

Many thanks!

Paul
--
http://www.paullee.com

Paul_Lee 02-10-2004 05:40 PM

Just another quick question. I'd still prefer the memory stick to automount, but I have noticed that in /media/, there is a new directory called sda1.
If I do mount /dev/sda1 /media/sda1, I get
mount: /dev/sda1 is not a valid block device

Best wishes

Paul

ac1980 02-10-2004 05:44 PM

Yes to both your questions. Or you can do like me and include it in a script.
I use sudo to run a command as root.

Code:

#!/bin/sh
sudo /sbin/modprobe usb-storage
sudo /bin/mount -o umask=0 /dev/sda1 /mnt/removable

IMPORTANT: remember to umount before extracting the key or you may lose data.

ac1980 02-10-2004 05:53 PM

Quote:

Originally posted by Paul_Lee
Just another quick question. I'd still prefer the memory stick to automount, but I have noticed that in /media/, there is a new directory called sda1.
If I do mount /dev/sda1 /media/sda1, I get
mount: /dev/sda1 is not a valid block device

Best wishes

Paul

I don't know much about automount, but I suppose you can use it, if it works with floppies/cds. Maybe it's even ready:
insert the key and then go to /media/sda1... you may find it ready!

So tell me if I'm wrong: you managed to read the key, didn't you? Of course when it's not inserted you'll get the error above. You don't get a "medium not ready" error because the device handle itself sda1 is dinamically changed by the kernel module...

IBall 02-10-2004 06:49 PM

I have a similar problem with my digital camera.

If I do mount /mnt/usb, I get:
mount: /dev/sda1 is not a valid block device

However, my fstab is set up to allow me to do this, as it worked before and still works intermitently.

If I do a dmesg when I insert the camera, I get:
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready
sda : block size assumed to be 512 bytes, disk size 1GB.
sda: test WP failed, assume Write Enabled
sda: I/O error: dev 08:00, sector 0
I/O error: dev 08:00, sector 0
unable to read partition table
hub.c: new USB device 00:1f.2-2.3, assigned address 12

Can anyone explain how to fix this?

Thanks in advance
From Ian

r_jensen11 02-10-2004 09:31 PM

Quote:

Originally posted by ac1980
Yes to both your questions. Or you can do like me and include it in a script.
I use sudo to run a command as root.

Code:

#!/bin/sh
sudo /sbin/modprobe usb-storage
sudo /bin/mount -o umask=0 /dev/sda1 /mnt/removable

IMPORTANT: remember to umount before extracting the key or you may lose data.

I learned that the hard way when I used the macs at school. Even with them, you have to unmount before you can safely remove. I lost many papers and presentations like that.....

Paul_Lee 02-11-2004 03:44 AM

HI ac1980,
Sorry I missed your post - I'll reply tonight (currently at work
you see)....things look hopeful. Now all I have to do is
learn a bit about sudo!

Sigh.....

Best wishes

Paul

Paul_Lee 02-11-2004 01:47 PM

Just an update:

I have plugged my memory stick in and done a "modprobe usb-storage" as root.
I get the following lines appended to my dmesg list:

Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.

Now, if I go into /media,
I already find sda1. If I do
mount /dev/sda1 /media/sda1, I get:
mount: /dev/sda1 is not a valid block device

(this is done as my non-root persona).... there is nothing in /mnt by the way.

If I do the above as root, I still get the "not valid block device" message.

I can cd into /media/sda1, but there is nothing in it (which I know is wrong as I
have loads of files on my memory stick)....

Thanks

Paul

r_jensen11 02-11-2004 05:01 PM

did you edit fstab? If you havn't, here's my line:

Code:

/dev/sda  /mnt/usb  vfat  noauto,user  0  0
There are ways of mounting it and telling it what filesystem to mount it as, but this makes it easier in the long run.

ac1980 02-12-2004 11:28 AM

I would give a try inserting it directly in a usb port on the pc, I heard of problems with some external usb hubs.
If it works this way, you should google for the brand of your hub and "linux" for a driver/setup script.

Having or not the fstab entry shouldn't make much difference as long as you mount as root. However, afaik, the virtual scsi device is mounted as a partition (eg sda1) and not as a disk (sda)

r_jensen11 02-12-2004 07:13 PM

Quote:

Originally posted by ac1980
I would give a try inserting it directly in a usb port on the pc, I heard of problems with some external usb hubs.
If it works this way, you should google for the brand of your hub and "linux" for a driver/setup script.

Having or not the fstab entry shouldn't make much difference as long as you mount as root. However, afaik, the virtual scsi device is mounted as a partition (eg sda1) and not as a disk (sda)

You mount the partition, not the disk, just like with any other device. If I wanted to, I could have multiple partitions on my USB key, but I just keep it at 1 for max file storage. If I had all linux computers at home, I would be tempted to format it as reiserfs, but then again, I'd probably never get hold of a linux computer outside my home....

As for the USB Hubs, I get better performance with using a USB hub vs not. I don't know why, it defies all logic, but I transfer files at full speed through the hub (USB1.2 or whatever it is, not 2.0), vs taking several minutes to transfer a 16MB file. Also, it's more convenient, since I have my computer in my closet now, and the usb hub is easier to reach.

ac1980 02-13-2004 08:14 AM

Just for reference, this is what I get in my /var/kern.log when I connect the camera.
Code:

<-- camera connect
Feb 13 14:59:00 camera kernel: hub.c: USB new device connect on bus1/1, assigned device number 4
Feb 13 14:59:00 camera kernel: usb-storage: act_altsettting is 0
Feb 13 14:59:00 camera kernel: usb-storage: id_index calculated to be: 81
Feb 13 14:59:00 camera kernel: usb-storage: Array length appears to be: 83
Feb 13 14:59:00 camera kernel: usb-storage: USB Mass Storage device detected
Feb 13 14:59:00 camera kernel: usb-storage: Endpoints: In: 0xcb010204 Out: 0xcb0101f0 Int: 0x00000000 (Period 0)
Feb 13 14:59:00 camera kernel: usb-storage: Found existing GUID 04b001060000000004214037
Feb 13 14:59:00 camera kernel: WARNING: USB Mass Storage data integrity not assured
Feb 13 14:59:00 camera kernel: USB Mass Storage device found at 4

<-- mount /mnt/sda1
Feb 13 14:59:16 camera kernel: usb-storage: queuecommand() called
Feb 13 14:59:16 camera kernel: usb-storage: *** thread awakened.
Feb 13 14:59:16 camera kernel: usb-storage: Command START_STOP (6 bytes)
Feb 13 14:59:16 camera kernel: usb-storage: 1b 00 00 00 01 00 00 00 08 5d fc cb
Feb 13 14:59:16 camera kernel: usb-storage: Bulk command S 0x43425355 T 0x51 Trg 0 LUN 0 L 0 F 0 CL 6
Feb 13 14:59:16 camera kernel: usb-storage: Bulk command transfer result=0
Feb 13 14:59:16 camera kernel: usb-storage: Attempting to get CSW...
Feb 13 14:59:16 camera kernel: usb-storage: Bulk status result = 0
Feb 13 14:59:16 camera kernel: usb-storage: Bulk status Sig 0x53425355 T 0x51 R 0 Stat 0x0
Feb 13 14:59:16 camera kernel: usb-storage: scsi cmd done, result=0x0
Feb 13 14:59:16 camera kernel: usb-storage: *** thread sleeping.
Feb 13 14:59:16 camera kernel: usb-storage: queuecommand() called
Feb 13 14:59:16 camera kernel: usb-storage: *** thread awakened.
Feb 13 14:59:16 camera kernel: usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
Feb 13 14:59:16 camera kernel: usb-storage: 1e 00 00 00 01 00 ff ff 48 53 13 c0
Feb 13 14:59:16 camera kernel: usb-storage: Bulk command S 0x43425355 T 0x52 Trg 0 LUN 0 L 0 F 0 CL 6
Feb 13 14:59:16 camera kernel: usb-storage: Bulk command transfer result=0
Feb 13 14:59:16 camera kernel: usb-storage: Attempting to get CSW...
Feb 13 14:59:16 camera kernel: usb-storage: Bulk status result = 0
Feb 13 14:59:16 camera kernel: usb-storage: Bulk status Sig 0x53425355 T 0x52 R 0 Stat 0x0
Feb 13 14:59:16 camera kernel: usb-storage: scsi cmd done, result=0x0
Feb 13 14:59:16 camera kernel: usb-storage: *** thread sleeping.

<-- umount
Feb 13 14:59:30 camera kernel: usb-storage: queuecommand() called
Feb 13 14:59:30 camera kernel: usb-storage: *** thread awakened.
Feb 13 14:59:30 camera kernel: usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
Feb 13 14:59:30 camera kernel: usb-storage: 1e 00 00 00 00 00 00 00 00 00 00 00
Feb 13 14:59:30 camera kernel: usb-storage: Bulk command S 0x43425355 T 0x7c Trg 0 LUN 0 L 0 F 0 CL 6
Feb 13 14:59:30 camera kernel: usb-storage: Bulk command transfer result=0
Feb 13 14:59:30 camera kernel: usb-storage: Attempting to get CSW...
Feb 13 14:59:30 camera kernel: usb-storage: Bulk status result = 0
Feb 13 14:59:30 camera kernel: usb-storage: Bulk status Sig 0x53425355 T 0x7c R 0 Stat 0x0
Feb 13 14:59:30 camera kernel: usb-storage: scsi cmd done, result=0x0
Feb 13 14:59:30 camera kernel: usb-storage: *** thread sleeping.



All times are GMT -5. The time now is 07:32 PM.