LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-12-2007, 02:01 PM   #1
jrfk2
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Rep: Reputation: 0
udev: distinguish between USB floppy & memory stick


Writing udev rules and need to distinguish between floppy devices and USB memory sticks ..

Sifting thru all the udevinfo stuff I see that sticks have SYSFS{dev}=="8:17" and floppys have "8:32" ..

As best I can find out from surfin the net those numbers are major/minor numbers I *think* ... but haven't found anything to explain what they mean in detail and if I can count on them for those specific devices on different h/w, etc...

Or if there is better SYSFS info to use ..

Appreciate any pointers ...
 
Old 02-12-2007, 02:37 PM   #2
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
When writing my rules I use SYSFS{Product}="Product Name". It's almost always the name that can be found in dmesg. My USB floppy drive's product is "MISTSUMI FLOPPY" and my flash drives are "JUMPDRIVE TRIO" and "SanDisk Cruzer Micro" et al. I also used the rules to create symlinks automatically for easier fstab entries and mounting.
 
Old 02-13-2007, 07:03 AM   #3
jrfk2
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Original Poster
Rep: Reputation: 0
Yep, I was going to use SYSFS{product} as well but then found different USB Keys report different stuff, and I was hoping (praying? ;-)) there was some value in all the udevinfo stuff that identified the type of device generically ..

I did since find some more details on major/minor and I don't think they can be used to identify the type of device, so I'm still kinda stuck ..
 
Old 02-13-2007, 09:18 AM   #4
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
The major/minor numbers are completely arbitrary, but they should be the same across computers (or else /dev would have had serious problems way back when you had to manually create /dev files to add new hardware, it should be fine, but like i said, the numbers are arbitrary, you should really find another way if you can.
 
Old 02-15-2007, 09:07 AM   #5
jrfk2
LQ Newbie
 
Registered: Jan 2006
Posts: 24

Original Poster
Rep: Reputation: 0
I also noticed that the USB floppy reports SYSFS{interface}=="FLOPPY" but the memory stick doesn't report that SYS{interface} at all. Is there any way to write rules to take advantage of that?

Last edited by jrfk2; 02-15-2007 at 09:12 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB memory, Compact Flash, Memory Stick energiza Linux - Hardware 2 08-22-2006 09:29 PM
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 05:39 PM
Help with udev and usb stick ProtoformX Slackware 3 04-28-2006 02:22 AM
Floppy, Memory Stick, Vfat Issues tubatodd Slackware 24 01-10-2005 08:33 PM
sony memory stick floppy disk adaptor midshipracer Linux - Hardware 0 08-27-2003 03:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:56 PM.

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