LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2011, 06:47 AM   #1
xerox
Member
 
Registered: Mar 2011
Posts: 43

Rep: Reputation: 0
Question udev rules aimed for USB drives only


I have written a udev rule as follows:

Code:
RUN+=/.../.../example.sh
Whenever i plug in a USB drive, this rule is executed, however it is also done when i plug in a dongle for WiFi. How do i make this udev rule specific for USB drives only. In other words this script should be run for USB devices only.
 
Old 03-15-2011, 12:30 AM   #2
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
As part of the rule you might specify:
Code:
SUBSYSTEMS=="usb"
but the WiFi dongle is also a USB device, isn't it?
 
1 members found this post helpful.
Old 03-15-2011, 12:44 AM   #3
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
This might help:
Code:
ATTRS{product}=="Mass Storage Device"
reported from udevinfo (or udevadm info).

So a rule might include this to match only Mass Storage Devices.
 
1 members found this post helpful.
Old 03-16-2011, 12:40 AM   #4
xerox
Member
 
Registered: Mar 2011
Posts: 43

Original Poster
Rep: Reputation: 0
yea...dongle is also under usb subsystems...i will try and see...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to write udev rules for USB hard disk drives mscole Slackware 14 11-04-2010 06:46 PM
udev rules not unmounting usb jjinno Linux - General 2 11-24-2009 04:29 PM
USB flash disk read problems using udev rules janfranken Linux - Desktop 6 02-18-2009 07:33 PM
Udev rules and USB bus cferron Linux - Hardware 4 03-11-2008 10:37 AM
udev rules fail on identical sata hard disk drives xushi Linux - Hardware 5 01-03-2008 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration