SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345
Rep:
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:
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?
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
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
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.
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.
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345
Original Poster
Rep:
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.
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.
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.