Manage Linux Hardware with udev - Page 2
Writing udev Rules
Current releases of udev come
with bales of man pages, and several different useful commands. On Debian
systems, find them all with dpkg:
$ dpkg -L udev
On Fedora, use the rpm command:
$ rpm -ql udev
You'll see there are different command sets for each distribution, and a pox on both of them for sowing useless confusion, so we'll look at the important commands they have in common.
$ udevinfo -e
You may query individual devices, if you know the device path, as this
example for an SATA partition shows:
$ udevinfo -a -p /block/sda/sda1
How do you know the device path? From udevinfo. You already know
the node name for some of your devices, and can query it this way:
$ udevinfo -q all -n sda
Both of these commands spit out a lot of information. Just for fun, you
can run lspci and match up the disk/by-path/pci values from
0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA
VT6420 SATA RAID Controller (rev 80)S: disk/by-path/pci-0000:00:0f.0-scsi-0:0:0:0-part1
The output of udevinfo is pretty cryptic, so this is one way to match it up to devices with names you recognize. For USB devices compare with the output of lsusb. SCSI devices compare to lsscsi.
Come back next week to learn how to nail down USB network cards, straighten out device permissions, and manage multiple storage drives painlessly with udev.