From: Brian Troutwine on
Hello all,

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"

And the custom rule file 10-local.rules:

> SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{serial}=="57442D575839314133303236343538", SYMLINK+="external%n"

After restarting Udev I'm greeted with the following dmesg output:

> [138065.272612] scsi10 : SCSI emulation for USB Mass Storage devices
> [138065.272965] usb 3-3: New USB device found, idVendor=1058, idProduct=1010
> [138065.272972] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [138065.272978] usb 3-3: Product: External HDD
> [138065.272983] usb 3-3: Manufacturer: Western Digital
> [138065.272988] usb 3-3: SerialNumber: 57442D575839314133303236343538
> [138065.273008] usb-storage: device found at 9
> [138065.273012] usb-storage: waiting for device to settle before scanning
> [138070.327947] usb-storage: device scan complete
> [138070.328938] scsi 10:0:0:0: Direct-Access WD 1200BEV External 1.75 PQ: 0 ANSI: 4
> [138070.334995] sd 10:0:0:0: [sdb] 234441648 512-byte hardware sectors (120034 MB)
> [138070.336676] sd 10:0:0:0: [sdb] Write Protect is off
> [138070.336676] sd 10:0:0:0: [sdb] Mode Sense: 23 00 00 00
> [138070.336676] sd 10:0:0:0: [sdb] Assuming drive cache: write through
> [138070.337550] sd 10:0:0:0: [sdb] 234441648 512-byte hardware sectors (120034 MB)
> [138070.338045] sd 10:0:0:0: [sdb] Write Protect is off
> [138070.338045] sd 10:0:0:0: [sdb] Mode Sense: 23 00 00 00
> [138070.338045] sd 10:0:0:0: [sdb] Assuming drive cache: write through
> [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?

Thanks,
Brian

---
[1] http://wiki.debian.org/AutoFs
[2] http://www.reactivated.net/writing_udev_rules.html#udevinfo


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTik=p=FWiKayKm4tuFRw8fOdsMYL_GEWNWe6gyk+(a)mail.gmail.com
From: Camaleón on
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

> 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.

> 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? :-?

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/pan.2010.08.10.08.27.06(a)gmail.com
From: Brian Troutwine on
On Tue, Aug 10, 2010 at 1:27 AM, Camaleón <noelamac(a)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(a)lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian..org
> Archive: http://lists.debian.org/pan.2010.08.10.08.27.06(a)gmail.com
>
>

Good day,
Brian


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTi?i5gL?TythjkXThLJYK3WqEH9rFROznc0F(a)mail.gmail.com
From: Camaleón on
On Tue, 10 Aug 2010 09:48:35 -0700, Brian Troutwine wrote:

> On Tue, Aug 10, 2010 at 1:27 AM, Camaleón wrote:

(...)

>> 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

Good :-)

(...)

>> 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.

Mmm, by reading the bunch of data you've sent, I don't think so. Look:

ATTRS{serial}=="57442D575839314133303236343538"

Is on the same "parent device" that:

SUBSYSTEMS=="usb"

But no "scsi". Try by correcting that and test again. It should be
something like:

***
SUBSYSTEM=="block", SUBSYSTEMS=="usb", ATTRS{serial}=="57442D575839314133303236343538", SYMLINK+="external%n"
***

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/pan.2010.08.10.17.08.36(a)gmail.com
From: Brian Troutwine on
On Tue, Aug 10, 2010 at 10:08 AM, Camaleón <noelamac(a)gmail.com> wrote:
> On Tue, 10 Aug 2010 09:48:35 -0700, Brian Troutwine wrote:
>
>> On Tue, Aug 10, 2010 at 1:27 AM, Camaleón wrote:
>
>> I _believe_ that it is, but I am new to reading udevinfo output.
>
> Mmm, by reading the bunch of data you've sent, I don't think so. Look:
>
> ATTRS{serial}=="57442D575839314133303236343538"
>
> Is on the same "parent device" that:
>
> SUBSYSTEMS=="usb"
>
> But no "scsi". Try by correcting that and test again. It should be
> something like:
>
> ***
> SUBSYSTEM=="block", SUBSYSTEMS=="usb", ATTRS{serial}=="57442D575839314133303236343538", SYMLINK+="external%n"
> ***

Ah, that was indeed the problem: bad subsystem. I was simply reading
the udevinfo output incorrectly.

Thank you, Camaleón.

--
Brian


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/AANLkTim7NC139N4qHT7+kH1Le9fDL9nNjnT4k_Wi7hZS(a)mail.gmail.com