LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-12-2004, 12:21 PM   #1
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
Question Finding the USB mass storage device


I have been unable to mount my USB pendrive under 2.6.x, so when I read the changelog for 2.64 and saw all the references to changes in the USB UHCI, OHCI and EHCI drivers, I was pretty hopeful that it would work after a kernel upgrade. Unfortunately, it hasn't.

When I enter 'mount -t vfat /dev/sda1 /mnt/flash', I get the dreaded "not a valid block device" message. I have also tried sdb1, sdc1, sdd1, sde1 and sdf1 without luck.

The pendrive is being recognized. When I do a 'lsusb', I get:

Unknown line at line 1809
Duplicate HUT Usage Spec at line 2650
Bus 004 Device 002: ID 04e8:0100 Samsung Electronics Co., Ltd.
Bus 004 Device 001: ID 0000:0000 Virtual Hub
Bus 003 Device 002: ID 04b8:011d Seiko Epson Corp.
Bus 003 Device 001: ID 0000:0000 Virtual Hub
Bus 002 Device 001: ID 0000:0000 Virtual Hub
Bus 001 Device 001: ID 0000:0000 Virtual Hub


When I do a 'cat /proc/scsi/usb-storage/2', I get:

Host scsi2: usb-storage
Vendor: CRUCIAL
Product: USB DRIVE
Serial Number: 0187365278445
Protocol: Transparent SCSI
Transport: Bulk
Quirks:

'cdrecord --scanbus' shows me:

Cdrecord 2.00.3 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
Linux sg driver version: 3.5.30
Using libscg version 'schily-0.7'
scsibus2:
2,0,0 200) 'CRUCIAL ' 'USB DRIVE ' '1.12' Removable Disk
2,1,0 201) *
2,2,0 202) *
2,3,0 203) *
2,4,0 204) *
2,5,0 205) *
2,6,0 206) *
2,7,0 207) *

What am I doing wrong here? Am I trying to mount the wrong device? How can I tell from this information which device I should be trying to mount? Is there some other command I should run that would tell me what device I should mount this to? What can I read to better understand which device to choose?
 
Old 03-12-2004, 12:38 PM   #2
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
You could try /dev/sgx according to what scsi driver you have configured into your kernel (module as well).
lsmod command could help you to determine what scsi modules are loaded and then assign a device name according to that. (if you compiled scsi drivers as modules of course).
Hope this helps
Ciao
 
Old 03-12-2004, 12:46 PM   #3
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Original Poster
Rep: Reputation: 30
Nope. That didn't work either. I tried /dev/sg[0-6], but no joy. lsmod shows that generic scsi (sg) is loaded. USB support it built into the kernel.

Maybe I will move usb support into modules and then try it.
 
Old 03-12-2004, 12:48 PM   #4
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
I just reminded another possible trick.
Insert your pendrive into the USB port, then reboot the system.
At one point after the kernel boot usb stuff you should find something like
new scsi device found at somewhere.
As boot messeges could flow very fast on screen, you can easely read them by i.e.
dmesg > boot_messages
This should show you what device is assigned to your pendrive.
Ciao
 
Old 03-12-2004, 01:52 PM   #5
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Original Poster
Rep: Reputation: 30
Nope. That didn't work either. But it did spew a lot of interesting error messages. When the pendrive is plugged in, my /var/log/debug fills up with:

Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 1, Code: 22, Value: 1
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 0, Code: 0, Value: 0
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 1, Code: 22, Value: 0
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 0, Code: 0, Value: 0
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 1, Code: 34, Value: 1
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 0, Code: 0, Value: 0
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 1, Code: 34, Value: 0
Mar 12 20:47:06 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 0, Code: 0, Value: 0
Mar 12 20:47:08 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 1, Code: 28, Value: 1
Mar 12 20:47:08 trooper kernel: evbug.c: Event. Dev: isa0060/serio0/input0, Type: 0, Code: 0, Value: 0

Trooper is the name of the machine. I wonder what evbug.c looks like.

When I insert the pendrive into a usb slot, this gets printed out to the console:

cat: /sys//devices/pci0000:00/0000:00:10.2/usb4/4-2/bNumConfigurations: No such file or directory
/etc/hotplug/usb.agent: line 144: [: too many arguments

So, this may be a hotplug problem to some extent. I am off to check their website.
 
Old 03-12-2004, 01:57 PM   #6
OdieQ
Member
 
Registered: Jan 2004
Location: Stockholm, Sweden
Distribution: Debian, Slackware
Posts: 71

Rep: Reputation: 15
I'm running 2.4 at the moment, this might not hold true with 2.6.

Check your kernel ring buffer (i.e. by running dmesg). When the mass storage device was inserted, you should see something like:
Code:
hub.c: new USB device 00:11.3-1, assigned address 4
usb.c: USB device 4 (vend/prod 0x1005/0xb113) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
  Vendor: USB       Model: Flash Drive       Rev: 1.12
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
SCSI device sda: 507901 512-byte hdwr sectors (260 MB)
sda: Write Protect is off
 sda: sda1 sda2 sda3 sda4
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4
USB Mass Storage support registered.
In this case, as you can see, my USB memory was attached to sda, so I should mount sda1. I have a hotplug script which updates a symlink in /dev/ called usbstick so I don't have to worry about this.
 
Old 03-12-2004, 02:46 PM   #7
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Original Poster
Rep: Reputation: 30
dmesg gives me:

Mar 12 21:21:02 trooper kernel: Type: Direct-Access ANSI SCSI revision: 02
Mar 12 21:21:08 trooper kernel: Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0, type 0
Mar 12 21:23:11 trooper kernel: usb 4-2: USB disconnect, address 4
Mar 12 21:36:00 trooper kernel: usb 4-2: new full speed USB device using address 5
Mar 12 21:36:00 trooper kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Mar 12 21:36:01 trooper scsi.agent[9732]: how to add device type= at /devices/pci0000:00/0000:00:10.2/usb4/4-2/4-2:1.0/host3/3:0:0:0 ??
Mar 12 21:36:01 trooper kernel: Vendor: CRUCIAL Model: USB DRIVE Rev: 1.12
Mar 12 21:36:01 trooper kernel: Type: Direct-Access ANSI SCSI revision: 02
Mar 12 21:36:01 trooper kernel: Attached scsi generic sg0 at scsi3, channel 0, id 0, lun 0, type 0
Mar 12 21:38:32 trooper kernel: usb 4-2: USB disconnect, address 5
Mar 12 21:40:38 trooper kernel: usb 4-2: new full speed USB device using address 6
Mar 12 21:40:38 trooper kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Mar 12 21:40:38 trooper scsi.agent[9883]: how to add device type= at /devices/pci0000:00/0000:00:10.2/usb4/4-2/4-2:1.0/host4/4:0:0:0 ??
Mar 12 21:40:38 trooper kernel: Vendor: CRUCIAL Model: USB DRIVE Rev: 1.12
Mar 12 21:40:38 trooper kernel: Type: Direct-Access ANSI SCSI revision: 02
Mar 12 21:40:38 trooper kernel: Attached scsi generic sg0 at scsi4, channel 0, id 0, lun 0, type 0

Looking at /sys, I see this:

bash-2.05b# ls -l /sys/bus/scsi/devices/
total 0
lrwxrwxrwx 1 root root 71 Mar 12 21:36 3:0:0:0 -> ../../../devices/pci0000:00/0000:00:10.2/usb4/4-2/4-2:1.0/host3/3:0:0:0

I am thinking now that this is a hotplugging problem. In the dmesg dump you can see that scsi.agent is asking "how to add device..." Looking at the README file in the source for hotplug-2004_01_05 there are these lines:

NOTES ABOUT THIS VERSION
------------------------
There's partial support for some of the new 2.5 hotplug features,
like SCSI hotplugging. There's more hotplug-related work yet to
be done as part of the 2.5 series; a 2.6 update will be required.

My guess is that hotplug has not been updated yet for the 2.6 kernel.
 
Old 03-12-2004, 04:04 PM   #8
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Rep: Reputation: 30
Hey I am getting this exact same error too:

cat: /sys//devices/pci0000:00/0000:00:10.2/usb4/4-2/bNumConfigurations: No such file or directory
/etc/hotplug/usb.agent: line 144: [: too many arguments



I have had a look and my camera (which is treated as a mass storage device) is regestered in my /proc/scsi/ but I canīt mount it, when I try it gives me a block device is not valid error

Oh yeah and I too installed 2.6.4 hoping it would sort my usb woes... I guess I was wrong.

Adam
 
Old 03-14-2004, 10:31 AM   #9
fideli
Member
 
Registered: Nov 2003
Location: Mississauga
Distribution: arch linux
Posts: 51

Rep: Reputation: 15
Quote:
Originally posted by jimdaworm
Hey I am getting this exact same error too:

/etc/hotplug/usb.agent: line 144: [: too many arguments

I've been getting that problem if I try to use 2.6.4, but I didn't have it in 2.6.3? Anyone know what the difference is?
 
Old 03-14-2004, 11:46 AM   #10
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Rep: Reputation: 30
Hey fideli I donīt know the difference, but it must have somthing to do with this script /etc/hotplug/usb.agent .

It doesnīt make much difference appart from the error message with 2.6.4 I still havenīt been able to use mass storage usb devices with 2.6.x

Adam
 
Old 03-18-2004, 12:39 PM   #11
OdieQ
Member
 
Registered: Jan 2004
Location: Stockholm, Sweden
Distribution: Debian, Slackware
Posts: 71

Rep: Reputation: 15
In case your still haven't fixed this

I was fiddling with my fstab and noticed that I am not mounting sda1 for my USB memory stick, but rather sda*.

It shows up with four partitions, just like yours, but these are not accesible. I was confusing it with a digital camera I use occasionally, which should be mounted using patiotion 1. So, if you can't mount sda1, perhaps you should try mounting sda instead?

* Or sdb, sdc or whatever
 
Old 03-18-2004, 12:54 PM   #12
failure_man
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Slackware
Posts: 60

Rep: Reputation: 16
Quote:
Originally posted by fideli
I've been getting that problem if I try to use 2.6.4, but I didn't have it in 2.6.3? Anyone know what the difference is?
I've seen this problem, and actually started a thread about it a few days ago. I'm not sure why it does that in 2.6.4 and not 2.6.3 but, at least in my case, the thing works flawlessly anyway. I just commented out that bit in usb.agent since it wasn't doing anything but coughing (apparently pointless) error messages and got on with my life.

Quote:
Originally posted by jimdaworm
Hey fideli I donīt know the difference, but it must have somthing to do with this script /etc/hotplug/usb.agent .

It doesnīt make much difference appart from the error message with 2.6.4 I still havenīt been able to use mass storage usb devices with 2.6.x

Adam
Do you have both usb mass storage and scsi emulation compiled? Usb-mass-storage devices are alwasy scsi emulated.

Last edited by failure_man; 03-18-2004 at 12:59 PM.
 
Old 03-18-2004, 01:10 PM   #13
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Rep: Reputation: 30
Hey failure_man I thought about doing the same thing only thing I wasnīt sure exatly what part to comment out, I know it line it is! but wasnīt sure where to start and finish commenting it out.

Also did commenting it out make your usb mass storage work??

I had it working fine in the 2.4.x kernels but have not been able to get it working with any 2.6.x kernel.

Could show me your fstab ??

Thanks
Adam

*********Edit************
I have the same error (Its not a valid block device) when I try to mount my scsi emmulated cdwriter.

Last edited by jimdaworm; 03-18-2004 at 01:14 PM.
 
Old 03-18-2004, 01:16 PM   #14
failure_man
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Slackware
Posts: 60

Rep: Reputation: 16
I'm not at my box right now but I'll post exactly what I did and how I got usb-mass-storage to work under 2.6.x when I get home.

The commenting out bit didn't fix anything. There actually wasn't anything wrong. All the commenting out did was get rid of some erronious error messages at boot.
 
Old 03-18-2004, 01:33 PM   #15
jimdaworm
Member
 
Registered: Aug 2003
Location: Spain
Distribution: Ubuntu
Posts: 897

Rep: Reputation: 30
Thanks I have been wanting to get it working for ages now!!

Adam
 
  


Reply



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
Mass storage device USB xeebeeeeeee Linux - Hardware 10 02-13-2008 12:11 PM
USB Mass storage Device purefan Linux - Hardware 15 06-06-2005 01:56 PM
usb - mass storage device d1l2w3 Mandriva 7 01-10-2005 10:10 PM
USB Mass Storage Device ebasi Linux - Hardware 2 12-23-2004 02:06 PM
Usb mass storage device laguna Linux - Hardware 4 08-12-2002 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:51 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
Open Source Consulting | Domain Registration