1 |
On 3 Oct 2009, at 20:11, daid kahl wrote: |
2 |
>> ... |
3 |
>>> Another useful notion is to use udev to automount flash drives (or |
4 |
>>> external usb harddrives) to a specified location based on serial |
5 |
>>> number. ... I can either give an overview or dig up the url if |
6 |
>>> anyone likes. |
7 |
>> |
8 |
>> I'd have assumed you simple used any of the usual "automount drives |
9 |
>> with udev" guides. Am I wrong? |
10 |
>> |
11 |
>> This is the way I have always intended to approach this problem, so |
12 |
>> I'd be grateful to be corrected in advance if there's a better way. |
13 |
> |
14 |
> That's correct, except not all of these guides discuss the drive |
15 |
> serial number. If you want to ensure that different drives are |
16 |
> mounted at different points, you have to rely on the device serial |
17 |
> (since the /dev nodes are filled in order of the device connection, |
18 |
> regardless of which drive it is). |
19 |
> |
20 |
> There are plenty of guides that mention how to find the serial |
21 |
> number and how to write the correct udev rules, but most the guides |
22 |
> are outdated and suggest use of the symlink udevinfo, which was |
23 |
> removed upstream recently. So, to get a device's serial number, for |
24 |
> example (replace /dev/sdb with the correct node) : |
25 |
> |
26 |
> # udevadm info -a -p $(udevadm info -q path -n /dev/sdb) | grep |
27 |
> ATTRS{serial} |
28 |
> |
29 |
> and use the (first) serial that doesn't have colons and periods. |
30 |
> Then for the udev rule you just need to include ATTRS{serial}==" |
31 |
> 0000000000" |
32 |
> |
33 |
> This is also useful when you have external harddrives that use ext3 |
34 |
> formatting and flashdrives that don't. |
35 |
|
36 |
Ooooops... I omitted a paste - I went to a terminal to check the |
37 |
details and then appear to have completely forgotten to include them. |
38 |
Thus my question is misphrased & incomplete. |
39 |
|
40 |
I intended to ask: |
41 |
|
42 |
I'd have assumed you simple used any of the usual "automount |
43 |
drives with udev" guides, but based their entry in "/dev/disk/by- |
44 |
uuid/". Am I wrong? |
45 |
|
46 |
How do you find the serial, please? I'm guessing from `dmesg`? |
47 |
|
48 |
I think the entry in "/dev/disk/by-uuid/" may change if you reformat |
49 |
the drive, so your response is most helpful. |
50 |
|
51 |
Thank you for your help, |
52 |
|
53 |
Stroller. |