[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Udev rule for external hard-drive



On Tue, Aug 10, 2010 at 1:27 AM, Camaleón <noelamac@gmail.com> wrote:
> On Mon, 09 Aug 2010 22:45:32 -0700, Brian Troutwine wrote:
>
>> I'm attempting a rule for my new external hard-drive, but it doesn't
>> seem to be taking. For reference, I am using Debian 5.0.5 am following
>> the wiki's instructions[1] and am using the kernel developers' guide as
>> a reference[2]. My udevinfo output:
>>
>>> $ udevinfo -a -p /sys/block/sdb/sdb1/ | grep serial
>>>    ATTRS{serial}=="57442D575839314133303236343538"
>>>    ATTRS{serial}=="0000:00:1a.7"
>
> Put the full output of the command:
>
> ***
> udevinfo -a -p /sys/block/sdb/sdb1/
> ***
>
> And upload the result to pastebin (or any other online service) to avoid
> flood the list with tons of data :-)
>
> http://www.pastebin.com

Clearly that would have been a capital idea. Here you are:
http://paste.lisp.org/display/113377

>> And the custom rule file 10-local.rules:
>>
>>> SUBSYSTEM=="block", SUBSYSTEMS=="scsi",
>>> ATTRS{serial}=="57442D575839314133303236343538", SYMLINK+="external%n"
>
> Care about this (comes from your [2] link):
>
> "...while it is legal to combine the attributes from the device in
> question and a single parent device, you cannot mix-and-match attributes
> from multiple parent devices - your rule will not work"
>
> So, SUBSYSTEMS=="scsi" and ATTRS{serial}
> =="57442D575839314133303236343538" have to be in the same "parent device"
> block.

I _believe_ that it is, but I am new to reading udevinfo output.

>> After restarting Udev I'm greeted with the following dmesg output:
>
> (...)
>
>>> [138070.338045]  sdb: sdb1
>>> [138070.376812] sd 10:0:0:0: [sdb] Attached SCSI disk
>>
>> Clearly I'm doing something wrong. Can someone point me in the right
>> direction?
>
> What is your main goal? Just giving the volume an static name? :-?

I'd like to give the volume a static name so that I can reliably point
autofs at it. While I realize that I could simply use the entries in
/dev/disk, I find it difficult to maintain the mental mapping of names
to device, especially at a glance.

Also, being able to write effective udev rules would be a handy skill.

> Greetings,
>
> --
> Camaleón
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] pan.2010.08.10.08.27.06@gmail.com">http://lists.debian.org/[🔎] pan.2010.08.10.08.27.06@gmail.com
>
>

Good day,
Brian


Reply to: