SCIENTIFIC-LINUX-USERS Archives

March 2010

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Stodola <[log in to unmask]>
Reply To:
Mark Stodola <[log in to unmask]>
Date:
Fri, 5 Mar 2010 09:06:37 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (93 lines)
Tim Edwards wrote:
> On 05/03/10 15:36, Mark Stodola wrote:
>   
>> Tim Edwards wrote:
>>     
>>> On 05/03/10 15:16, Mark Stodola wrote:
>>>  
>>>       
>>>>>         
>>>>>           
>>>> Tim,
>>>>
>>>> I think you are confusing sysfs with environment variables.  the %E{key}
>>>> is used for environment variables.  The serial number is a SYSFS
>>>> attribute.  Try changing %E{serial} to %s{serial} and see if it works.
>>>>
>>>> Cheers,
>>>> Mark
>>>>
>>>>     
>>>>         
>>> That didn't work unfortunately, my rules file now looks like this:
>>> KERNEL=="sd*", SUBSYSTEMS=="scsi", SYMLINK+="disknumber-%s{serial}"
>>>
>>> Any other ideas?
>>>
>>> Tim
>>>   
>>>       
>> It works here, I just made a /etc/udev/rules.d/10-test.rules file with
>> your above line.
>> Next I ran 'udevcontrol reload_rules'.  I then connected my Kingston USB
>> drive and /dev/disknumber-5B7A1000021E appeared.
>>
>> Do you have any other custom rules that are mangling this one?
>>
>> Cheers,
>> Mark
>>
>>     
>
> It might just be a peculiarity of the USB stick I'm using to test it
> then since it's creating a device '/dev/disknumber-' looking like it
> can't find the serial number.
>
>  I'll try with one of the actual USB hard drives they're using when I
> can get access to one next week.
>
> Tim
>   
You can verify that using 'systool'.  Try the following command:
systool -b usb -p -v
Find your USB drive in the output, and there should be something like this:
  Device = "1-2"
  Device path = "/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-2"
    bConfigurationValue = "1"
    bDeviceClass        = "00"
    bDeviceProtocol     = "00"
    bDeviceSubClass     = "00"
    bMaxPacketSize0     = "64"
    bMaxPower           = "200mA"
    bNumConfigurations  = "1"
    bNumInterfaces      = " 1"
    bcdDevice           = "0100"
    bmAttributes        = "80"
    configuration       =
    devnum              = "3"
    idProduct           = "1d00"
    idVendor            = "13fe"
    manufacturer        = "Kingston"
    maxchild            = "0"
    product             = "DataTraveler 2.0"
    serial              = "5B7A1000021E"
    speed               = "480"
    uevent              = <store method only>
    version             = " 2.00"


If no serial exists for the device, the "serial =" line will be absent.

Cheers,
Mark

-- 
Mr. Mark V. Stodola
Digital Systems Engineer

National Electrostatics Corp.
P.O. Box 620310
Middleton, WI 53562-0310 USA
Phone: (608) 831-7600
Fax: (608) 831-9591

ATOM RSS1 RSS2