LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   USB devices on Slackware, kernel 2.6.12.5 (https://www.linuxquestions.org/questions/linux-hardware-18/usb-devices-on-slackware-kernel-2-6-12-5-a-370507/)

jaakkop 10-06-2005 11:54 PM

USB devices on Slackware, kernel 2.6.12.5
 
How do I set up USB devices? Here is what I got with 'dmesg | grep usb' when I plugged my USB device:
Code:

usbcore: registered new driver usbfs
usbcore: registered new driver hub
usb usb1: default language 0x0409
usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: VIA Technologies, Inc. USB 2.0
usb usb1: Manufacturer: Linux 2.6.12.5 ehci_hcd
usb usb1: SerialNumber: 0000:00:10.3
usb usb1: hotplug
usb usb1: adding 1-0:1.0 (config #1, interface 0)
usb 1-0:1.0: hotplug
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: no power switching (usb 1.0)
usb usb2: default language 0x0409
usb usb2: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
usb usb2: Manufacturer: Linux 2.6.12.5 uhci_hcd
usb usb2: SerialNumber: 0000:00:10.0
usb usb2: hotplug
usb usb2: adding 2-0:1.0 (config #1, interface 0)
usb 2-0:1.0: hotplug
hub 2-0:1.0: usb_probe_interface
hub 2-0:1.0: usb_probe_interface - got id
hub 2-0:1.0: no power switching (usb 1.0)
usb usb3: default language 0x0409
usb usb3: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb3: Product: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#2)
usb usb3: Manufacturer: Linux 2.6.12.5 uhci_hcd
usb usb3: SerialNumber: 0000:00:10.1
usb usb3: hotplug
usb usb3: adding 3-0:1.0 (config #1, interface 0)
usb 3-0:1.0: hotplug
hub 3-0:1.0: usb_probe_interface
hub 3-0:1.0: usb_probe_interface - got id
hub 3-0:1.0: no power switching (usb 1.0)
usb usb4: default language 0x0409
usb usb4: new device strings: Mfr=3, Product=2, SerialNumber=1
usb usb4: Product: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#3)
usb usb4: Manufacturer: Linux 2.6.12.5 uhci_hcd
usb usb4: SerialNumber: 0000:00:10.2
usb usb4: hotplug
usb usb4: adding 4-0:1.0 (config #1, interface 0)
usb 4-0:1.0: hotplug
hub 4-0:1.0: usb_probe_interface
hub 4-0:1.0: usb_probe_interface - got id
hub 4-0:1.0: no power switching (usb 1.0)

Here's what 'lsusb' gave me:
Code:

Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000


Half_Elf 10-07-2005 12:11 AM

Don't use any "grep". If you have usb and usb-storage compiled in your kernel, just plug-in your device, type "dmesg", then search in the last few lines for something like "assigned new device to sda" (or whatever it may look like, it should be something about "sdX". If you drive have more than one partition, you may want to try "cfdisk /dev/sdX" to take a look at partition, otherwise use the "whole" device. Then, just mount this device like anything else : "mount /dev/sdX /mnt/where_you_want_it".

If you don't have/are not sure you have usb and usb-storage into your kernel, you might need to modprobe these modules :
"modprobe usb-core"
"modprobe usb-storage"
it should be fine then.

simcox1 10-07-2005 07:05 AM

I'm trying to find out out where my usb device is located, but dmesg doesn't give that info. Is there another way?

jaakkop 10-07-2005 07:46 AM

Ok, I now got it identified but now I need to know how to get it to mount automatically when the device is plugged... or at least to mount it with normal user.

Half_Elf 10-07-2005 08:26 AM

jaakkop : You might want to take a look at automount (if you want to mount it automatically once it is pluged. To mount it with your normal user, just add a line like this one in your fstab :
Code:

/dev/sdXY      /mnt/usb      auto        noauto,user,uid=your_user,gid=users,umask=000        0      0
Notice the "options". "notoauto" tell your system to not mount it automatically at boot. "user" give any user the right to mount this. "uid=..." assign files ownership to your user, "gid=..." assign the group files ownership to the group you specified (should be "users" usually) and "umask=000" with give a normal user read and write access on a FAT32 drive. Of course, you don't need all this, choose the one you need ("man mount" for more option).


Quote:

I'm trying to find out out where my usb device is located, but dmesg doesn't give that info. Is there another way?
simcox1 : It should be in dmesg, if it isn't there, there is probably a problem, maybe "usb-storage" isn't loaded (try "modprobe usb-storage") or maybe there is a problem about the drive (unsupported?).

simcox1 10-07-2005 09:14 AM

It's a usb camera. I managed to download photos using gphoto2 from the command line. I couldn't get digikam or gtkam to run. I have to run gphoto2 get-all-files as root user though. So I'm trying to locate where to change the permissions. According to dmesg:

USB Mass Storage support registered.
hub.c: new USB device 00:10.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x40a/0x578) is not claimed by any active driver.

This was after running modprobe usb-storage. I'm unsure where the device is actually located.

ciotog 10-07-2005 10:48 AM

I have a Sony DSC-P52 and have the following in my /etc/fstab
Code:

/dev/sda1        /mnt/dsc-p52    vfat        noauto,users    0  0
This allows any user to mount the camera (I don't have any other usb devices so it's always sda1).
Then I have the following menu command (I use WindowMaker):
Code:

mount /mnt/dsc-p52 ; sleep 2 ; xterm -geometry 96x60 -e mc /mnt/dsc-p52 ; umount /mnt/dsc-p52
This mounts the camera, then opens midnight commander with the camera folder in one pane. It's a quick and simple task to move all the photos/videos to whichever folder I like, then on closing MC the camera is unmounted.

simcox1 10-07-2005 11:14 AM

Which directories did you have to make and are there any symbolic links required?

ciotog 10-08-2005 11:28 PM

The mount point has to be created, but otherwise udev does the work of creating the necessary device node. This assumes you have everything prepared in the kernel - for my setup I have SCSI device support and SCSI disk support as modules, along with USB Mass Storage support (along with the rest of the needed USB subsystem, natch).

Here's what I get in /var/log/messages when I connect the camera:
Code:

Oct  9 00:18:21 chump kernel: usb 3-1: new full speed USB device using uhci_hcd and address 4
Oct  9 00:18:21 chump kernel: usb 3-1: Product: Sony DSC
Oct  9 00:18:21 chump kernel: usb 3-1: Manufacturer: Sony
Oct  9 00:18:21 chump kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Oct  9 00:18:26 chump kernel:  Vendor: Sony      Model: Sony DSC          Rev: 4.50
Oct  9 00:18:26 chump kernel:  Type:  Direct-Access                      ANSI SCSI revision: 00
Oct  9 00:18:26 chump kernel: SCSI device sda: 253696 512-byte hdwr sectors (130 MB)
Oct  9 00:18:26 chump kernel: sda: assuming Write Enabled
Oct  9 00:18:26 chump kernel: SCSI device sda: 253696 512-byte hdwr sectors (130 MB)
Oct  9 00:18:26 chump kernel: sda: assuming Write Enabled
Oct  9 00:18:26 chump kernel:  sda: sda1
Oct  9 00:18:26 chump kernel: Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
Oct  9 00:18:26 chump udev[20710]: creating device node '/dev/sda'
Oct  9 00:18:27 chump udev[20721]: creating device node '/dev/sda1'
Oct  9 00:19:00 chump udev[20774]: removing device node '/dev/sda1'
Oct  9 00:19:00 chump udev[20783]: removing device node '/dev/sda'
Oct  9 00:19:00 chump kernel: usb 3-1: USB disconnect, address 4

The camera needs to be in normal mode, not PTP mode for this to work properly.


All times are GMT -5. The time now is 11:30 PM.