1 |
On Thu, Nov 29, 2012 at 6:35 PM, Marco Bonfiglio |
2 |
<marco.bonfiglio@×××××.com> wrote: |
3 |
> |
4 |
> |
5 |
> 2012/11/29 Jorge Almeida <jjalmeida@×××××.com> |
6 |
>> |
7 |
>> Anyone knows how to dig into /sys to find the serial number of a device |
8 |
>> (say, |
9 |
>> a USB pen)? I few days ago I found by trial and error something like |
10 |
>> $ cat |
11 |
>> /sys/devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host13/target13:0:0/13:0:0:0/block/sdc/../../../../../serial |
12 |
>> which gave me E68911000519 |
13 |
>> Now I can't find nothing of the sort. (Yes, I know the path changes |
14 |
>> each time the |
15 |
>> device is plugged in, but even so) |
16 |
>> Any information that would put some order into this mess would be great. |
17 |
>> |
18 |
>> TIA |
19 |
>> |
20 |
>> Joreg Almeida |
21 |
>> |
22 |
> |
23 |
> If by "serial" you mean UUID I personally use "ls -l /dev/disk/by-uuid/" |
24 |
> |
25 |
It is not the same thing, but anyway I have in /dev/disk/by-id/ a symlink |
26 |
usb-silicon_-power_E68911000519-0:0 -> ../../sdd |
27 |
|
28 |
This is indeed the device I meant, and the serial number is the "E68911000519" |
29 |
substring. But this symlink exists because udev created it. I need to somehow |
30 |
dig it out of /sys, not out of /dev. IOW, how did udev retrieved the |
31 |
information to create the symlink? The values of ../by-uuid/ would probably be |
32 |
equally good, but I don't know how to find them any more than I know how to |
33 |
find the serials... |
34 |
|
35 |
Thanks |
36 |
|
37 |
J.A. |