Usually, udevadm
requires the sysfs device path of the device in question. But you can also ask udevadm
which device path belongs to a certain device node. This gets really helpful if you combine these two queries.
Example: You want to get a list of attributes for a specific device. You do not know the complete device path; all you know is the device node /dev/sdb
:
# udevadm info -a -p $(udevadm info -q path -n /dev/sdb)
A nice document describing how to use this information to write udev rules can be found on http://www.reactivated.net/writing_udev_rules.html.
Pingback: /dev/blog
Pingback: Rambles of Ev » Blog Archive » /dev/blog » Using udevadm to gather information about specific device
Pingback: ogre 3d III « Invalidmagic's Blog
Pingback: Can not mount my USB disk– Ubuntu nor windows[dmesg including] Drija
THANKS FOR MUCH NEEDED INFO.
Old page, but still comes up as the first google result for ‘udevadm examples’. This seems to be the same thing as above in a more natural form:
# udevadm info -a -n /dev/sdb
Please let the folks over at reactivated.net know that udevinfo got replaced by udevadm. Otherwise, the example udev rules are a valuable reference, as is this page.
–Internet Society For Replacing Obsolete Data In Reference Documentation (ISFRODIRD)
Thanks for giving the relatively new system admins a leg-up!
Pingback: Delicious Bookmarks for August 2nd through August 4th « Lâmôlabs
Pingback: Udev & Udevadm gather info about a device & all devices (little info on mknod & mdev -s) - kossboss
can confirm. This is the first result for udevadm examples… not many examples tho 🙁
@muahaha
Yeah, sorry. It was intended as memory hook for myself. I should do a new, more verbose post since this is almost six years old…
Pingback: Android 開發環境之安裝 | [心] 誌