LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   auto detect usb when inserted (https://www.linuxquestions.org/questions/gentoo-87/auto-detect-usb-when-inserted-878961/)

Adol 05-05-2011 05:34 AM

auto detect usb when inserted
 
Hello,

I cant get my usb devices to autodetect when they are inserted.

I tried to use autofs with code as follows:

autofs.master:
Code:


# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#      "nosuid" and "nodev" options unless the "suid" and "dev"
#      options are explicitly given.
#
/net    -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
# mount point    config file              options
/devices        /etc/autofs/auto.misc    --timeout=5 --ghost
#/net            -hosts

auto.misc:
Code:

#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd              -fstype=iso9660,nosuid,nodev    :/dev/cdrom
usb1            -fstype=auto                    :/dev/sde1
usb2            -fstype=auto                    :/dev/sdf1

# the following entries are samples to pique your imagination
#linux          -ro,soft,intr          ftp.example.org:/pub/linux
#boot          -fstype=ext2            :/dev/hda1
#floppy        -fstype=auto            :/dev/fd0
#floppy        -fstype=ext2            :/dev/fd0
#e2floppy      -fstype=ext2            :/dev/fd0
#jaz            -fstype=ext2            :/dev/sdc1
#removable      -fstype=ext2            :/dev

Also, I have a usb network access point that wont power up in Gentoo(light wont turn on). I know it works because I was using it in OpenSuse.

Its possible that I'm missing a kernel module but don't know what it would be.

What am I missing here?

Any help would be great.

i92guboj 05-06-2011 01:25 AM

Quote:

Originally Posted by Adol (Post 4347189)
Hello,

I cant get my usb devices to autodetect when they are inserted.

I tried to use autofs with code as follows:

autofs.master:
Code:


# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#      "nosuid" and "nodev" options unless the "suid" and "dev"
#      options are explicitly given.
#
/net    -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
# mount point    config file              options
/devices        /etc/autofs/auto.misc    --timeout=5 --ghost
#/net            -hosts

auto.misc:
Code:

#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

cd              -fstype=iso9660,nosuid,nodev    :/dev/cdrom
usb1            -fstype=auto                    :/dev/sde1
usb2            -fstype=auto                    :/dev/sdf1

# the following entries are samples to pique your imagination
#linux          -ro,soft,intr          ftp.example.org:/pub/linux
#boot          -fstype=ext2            :/dev/hda1
#floppy        -fstype=auto            :/dev/fd0
#floppy        -fstype=ext2            :/dev/fd0
#e2floppy      -fstype=ext2            :/dev/fd0
#jaz            -fstype=ext2            :/dev/sdc1
#removable      -fstype=ext2            :/dev


These days I wouldn't use autofs at all. May I suggest looking into udisks? There are some udisks based tools that can do automounting, like this:

http://bitbucket.org/byronclark/udiskie

Quote:

Also, I have a usb network access point that wont power up in Gentoo(light wont turn on). I know it works because I was using it in OpenSuse.

Its possible that I'm missing a kernel module but don't know what it would be.

What am I missing here?

Any help would be great.
What does the system log (dmesg) says when you plug the device?

Adol 05-06-2011 10:32 AM

Quote:

Originally Posted by i92guboj (Post 4348054)
These days I wouldn't use autofs at all. May I suggest looking into udisks? There are some udisks based tools that can do automounting, like this:

http://bitbucket.org/byronclark/udiskie



What does the system log (dmesg) says when you plug the device?

Thank you for your reply.

Before I plug anything in I get this:

Code:

[103464.682285] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103464.682295] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001803 0  ACK POWER sig=j CSC CONNECT
[103464.682302] hub 1-0:1.0: port 5, status 0501, change 0001, 480 Mb/s
[103464.708024] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001803 0  ACK POWER sig=j CSC CONNECT
[103464.812016] hub 1-0:1.0: debounce: port 5: total 125ms stable 100ms status 0x501
[103464.863063] ehci_hcd 0000:00:12.2: port 5 high speed
[103464.863069] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001005 0  ACK POWER sig=se0 PE CONNECT
[103464.914030] usb 1-5: new high speed USB device using ehci_hcd and address 5
[103464.965063] ehci_hcd 0000:00:12.2: port 5 high speed
[103464.965069] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001005 0  ACK POWER sig=se0 PE CONNECT
[103465.029500] usb 1-5: default language 0x0409
[103465.030241] usb 1-5: udev 5, busnum 1, minor = 4
[103465.030243] usb 1-5: New USB device found, idVendor=2019, idProduct=ab2a
[103465.030245] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[103465.030247] usb 1-5: Product: GW-USNANO2
[103465.030249] usb 1-5: Manufacturer: Planex Communications Inc.
[103465.030250] usb 1-5: SerialNumber: 00e04c000001
[103465.030321] usb 1-5: usb_probe_device
[103465.030324] usb 1-5: configuration #1 chosen from 1 choice
[103465.030492] usb 1-5: adding 1-5:1.0 (config #1, interface 0)
[103465.030552] drivers/usb/core/inode.c: creating file '005'
[103465.030573] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103522.614568] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103522.614577] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001002 0  ACK POWER sig=se0 CSC
[103522.614584] hub 1-0:1.0: port 5, status 0100, change 0001, 12 Mb/s
[103522.614587] usb 1-5: USB disconnect, address 5
[103522.614588] usb 1-5: unregistering device
[103522.614590] usb 1-5: unregistering interface 1-5:1.0
[103522.614647] usb 1-5: usb_disable_device nuking all URBs
[103522.718015] hub 1-0:1.0: debounce: port 5: total 100ms stable 100ms status 0x100

after I plug it in I get this:
Code:

[103464.682285] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103464.682295] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001803 0  ACK POWER sig=j CSC CONNECT
[103464.682302] hub 1-0:1.0: port 5, status 0501, change 0001, 480 Mb/s
[103464.708024] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001803 0  ACK POWER sig=j CSC CONNECT
[103464.812016] hub 1-0:1.0: debounce: port 5: total 125ms stable 100ms status 0x501
[103464.863063] ehci_hcd 0000:00:12.2: port 5 high speed
[103464.863069] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001005 0  ACK POWER sig=se0 PE CONNECT
[103464.914030] usb 1-5: new high speed USB device using ehci_hcd and address 5
[103464.965063] ehci_hcd 0000:00:12.2: port 5 high speed
[103464.965069] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001005 0  ACK POWER sig=se0 PE CONNECT
[103465.029500] usb 1-5: default language 0x0409
[103465.030241] usb 1-5: udev 5, busnum 1, minor = 4
[103465.030243] usb 1-5: New USB device found, idVendor=2019, idProduct=ab2a
[103465.030245] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[103465.030247] usb 1-5: Product: GW-USNANO2
[103465.030249] usb 1-5: Manufacturer: Planex Communications Inc.
[103465.030250] usb 1-5: SerialNumber: 00e04c000001
[103465.030321] usb 1-5: usb_probe_device
[103465.030324] usb 1-5: configuration #1 chosen from 1 choice
[103465.030492] usb 1-5: adding 1-5:1.0 (config #1, interface 0)
[103465.030552] drivers/usb/core/inode.c: creating file '005'
[103465.030573] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103522.614568] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103522.614577] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001002 0  ACK POWER sig=se0 CSC
[103522.614584] hub 1-0:1.0: port 5, status 0100, change 0001, 12 Mb/s
[103522.614587] usb 1-5: USB disconnect, address 5
[103522.614588] usb 1-5: unregistering device
[103522.614590] usb 1-5: unregistering interface 1-5:1.0
[103522.614647] usb 1-5: usb_disable_device nuking all URBs
[103522.718015] hub 1-0:1.0: debounce: port 5: total 100ms stable 100ms status 0x100
[103570.309884] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0020
[103570.309892] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001803 0  ACK POWER sig=j CSC CONNECT
[103570.309899] hub 1-0:1.0: port 5, status 0501, change 0001, 480 Mb/s
[103570.413020] hub 1-0:1.0: debounce: port 5: total 100ms stable 100ms status 0x501
[103570.464075] ehci_hcd 0000:00:12.2: port 5 high speed
[103570.464079] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001005 0  ACK POWER sig=se0 PE CONNECT
[103570.515025] usb 1-5: new high speed USB device using ehci_hcd and address 6
[103570.566026] ehci_hcd 0000:00:12.2: port 5 high speed
[103570.566030] ehci_hcd 0000:00:12.2: GetStatus port:5 status 001005 0  ACK POWER sig=se0 PE CONNECT
[103570.630519] usb 1-5: default language 0x0409
[103570.631264] usb 1-5: udev 6, busnum 1, minor = 5
[103570.631266] usb 1-5: New USB device found, idVendor=2019, idProduct=ab2a
[103570.631268] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[103570.631270] usb 1-5: Product: GW-USNANO2
[103570.631271] usb 1-5: Manufacturer: Planex Communications Inc.
[103570.631273] usb 1-5: SerialNumber: 00e04c000001
[103570.631341] usb 1-5: usb_probe_device
[103570.631344] usb 1-5: configuration #1 chosen from 1 choice
[103570.631513] usb 1-5: adding 1-5:1.0 (config #1, interface 0)
[103570.631588] drivers/usb/core/inode.c: creating file '006'

This looks important. What file is this? Do I need to use it somehow?
Quote:

[103570.631588] drivers/usb/core/inode.c: creating file '006'
It looks like its being found but its not powering up or doing anything.

Also, I'll take a look at udisks. Thanks for the suggestion. Many times I have no idea what to look into when I have these problems.

Adol 05-07-2011 11:14 AM

Ok so I found out that it is being auto mounted.

When I su - and then open dolphin my usb drive shows up as it should.

I really don't want to use dolphin in super user mode.

How can I get it to do the same thing with my user account?

i92guboj 05-07-2011 05:07 PM

Please, try to do this in command line as a regular user, and before plugging the drive.

Code:

udisks --monitor
Then plug it into the usb port, and let us know if there's any output. If there's no output, repeat as root and tell us what happens.

Adol 05-07-2011 08:54 PM

Quote:

Originally Posted by i92guboj (Post 4349514)
Please, try to do this in command line as a regular user, and before plugging the drive.

Code:

udisks --monitor
Then plug it into the usb port, and let us know if there's any output. If there's no output, repeat as root and tell us what happens.

There is no output either way:

Code:

petreuss@Linux ~ $ udisks --monitor
Monitoring activity from the disks daemon. Press Ctrl+C to cancel.
Linux petreuss # udisks --monitor
Monitoring activity from the disks daemon. Press Ctrl+C to cancel.
^C
Linux petreuss # exit
exit

Linux petreuss is my root account.

Also I emerged udisks yesterday to try and use it. but I got this error:
Code:

*  CONFIG_USB_SUSPEND:        is not set when it should be.

i92guboj 05-08-2011 04:40 PM

Do you have devicekit and udev enabled globally? Try this command and see if it reports anything:

Code:

USE="consolekit udev policykit -hal" emerge -auDvN world

Adol 05-09-2011 05:25 AM

Quote:

Originally Posted by i92guboj (Post 4350320)
Do you have devicekit and udev enabled globally? Try this command and see if it reports anything:

Code:

USE="consolekit udev policykit -hal" emerge -auDvN world

Hello,

This fixed all of my problems.

Everything works as it should now(it also gave me a bootup sound in KDE)

Thank you very much.

i92guboj 05-09-2011 09:06 AM

Quote:

Originally Posted by Adol (Post 4350767)
Hello,

This fixed all of my problems.

Everything works as it should now(it also gave me a bootup sound in KDE)

Thank you very much.

Note that USE flags given this way (in command line) are not saved, so their effect may go away the next time you do a global update. To make this permanent you need to save these USE flag in your /etc/make.conf file. If you have installed Gentoo yourself you should already know how to deal with that, if not just ask for guidance.

Adol 05-10-2011 12:27 AM

Quote:

Originally Posted by i92guboj (Post 4350953)
Note that USE flags given this way (in command line) are not saved, so their effect may go away the next time you do a global update. To make this permanent you need to save these USE flag in your /etc/make.conf file. If you have installed Gentoo yourself you should already know how to deal with that, if not just ask for guidance.

Thank you.

I have already added all the use flags to my /etc/make.conf

Thanks again


All times are GMT -5. The time now is 12:00 PM.