On Mon, 27 Dec 2010 13:20:37 -0500, Tom H wrote: > On Mon, Dec 27, 2010 at 10:17 AM, Camaleón <noela...@gmail.com> wrote: >> On Sun, 26 Dec 2010 15:58:08 -0800, briand wrote: >> >>> how do I know that "SerialNumber" is a valid udev key other than the >>> fact that it is listed in dmesg when the device is plugged in. >> >> For instance, my USB key has at least one "ATTRS{serial}" value: >> >> s...@stt008:~$ udevinfo -a -p /sys/block/sdc | grep serial >> ATTRS{serial}=="0000:00:1a.7" >> >> But not my internal hard disks, neither from udevinfo: >> >> s...@stt008:~$ udevinfo -a -p /sys/block/sda | grep serial >> s...@stt008:~$ udevinfo -a -p /sys/block/sdb | grep serial >> s...@stt008:~$ > > Question: > > You use the equivalent of "udevadm info --attribute-walk > --path=/sys/block/sda". > > What if you use "udevadm info --query=property --path=/sys/block/sda" > and it outputs an "ID_SERIAL"? Can it be used in a udev rule?
I'd say yes, provided it is an ENV (E) key and you write the propper rule: http://www.reactivated.net/writing_udev_rules.html#env Look: stt008:~# udevadm info --query all --name=/dev/sdb P: /block/sdb N: sdb S: block/8:16 S: disk/by-id/ata-ST3500320NS_xxxxxxxx S: disk/by-id/scsi-SATA_ST3500320NS_xxxxxxxx S: disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0 E: ID_VENDOR=ATA E: ID_MODEL=ST3500320NS E: ID_REVISION=SN06 E: ID_SERIAL=SATA_ST3500320NS_xxxxxxxx E: ID_SERIAL_SHORT=xxxxxxxx E: ID_TYPE=disk E: ID_BUS=scsi E: ID_ATA_COMPAT=ST3500320NS_xxxxxxx E: ID_PATH=pci-0000:00:1f.2-scsi-1:0:0:0 "P" must be "path", "N" must be "name", "S" must be "symlink" and "E" has to be "environment". Greetings, -- Camaleón -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/pan.2010.12.27.19.26...@gmail.com