2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 <refentry id="udevadm">
9 <productname>systemd</productname>
12 <contrib>Developer</contrib>
13 <firstname>Kay</firstname>
14 <surname>Sievers</surname>
15 <email>kay@vrfy.org</email>
21 <refentrytitle>udevadm</refentrytitle>
22 <manvolnum>8</manvolnum>
26 <refname>udevadm</refname><refpurpose>udev management tool</refpurpose>
31 <command>udevadm</command>
32 <arg><option>--debug</option></arg>
33 <arg><option>--version</option></arg>
34 <arg><option>--help</option></arg>
37 <command>udevadm info <replaceable>options</replaceable></command>
40 <command>udevadm trigger <optional>options</optional></command>
43 <command>udevadm settle <optional>options</optional></command>
46 <command>udevadm control <replaceable>command</replaceable></command>
49 <command>udevadm monitor <optional>options</optional></command>
52 <command>udevadm hwdb <optional>options</optional></command>
55 <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
58 <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command>
62 <refsect1><title>Description</title>
63 <para><command>udevadm</command> expects a command and command
64 specific options. It controls the runtime behavior of
65 <command>systemd-udevd</command>, requests kernel events, manages
66 the event queue, and provides simple debugging mechanisms.</para>
69 <refsect1><title>OPTIONS</title>
72 <term><option>--debug</option></term>
74 <para>Print debug messages to standard error.</para>
78 <term><option>--version</option></term>
80 <para>Print version number.</para>
84 <term><option>-h</option></term>
85 <term><option>--help</option></term>
87 <para>Print help text.</para>
92 <refsect2><title>udevadm info <optional><replaceable>OPTIONS</replaceable></optional> <optional><replaceable>DEVPATH</replaceable>|<replaceable>FILE</replaceable></optional></title>
93 <para>Queries the udev database for device information
94 stored in the udev database. It can also query the properties
95 of a device from its sysfs representation to help creating udev
96 rules that match this device.</para>
99 <term><option>-q</option></term>
100 <term><option>--query=<replaceable>TYPE</replaceable></option></term>
102 <para>Query the database for the specified type of device
103 data. It needs the <option>--path</option> or
104 <option>--name</option> to identify the specified device.
105 Valid <replaceable>TYPE</replaceable>s are:
106 <constant>name</constant>, <constant>symlink</constant>,
107 <constant>path</constant>, <constant>property</constant>,
108 <constant>all</constant>.</para>
112 <term><option>-p</option></term>
113 <term><option>--path=<replaceable>DEVPATH</replaceable></option></term>
115 <para>The <filename>/sys</filename> path of the device to
117 <filename><optional>/sys</optional>/class/block/sda</filename>.
118 Note that this option usually is not very useful, since
119 <command>udev</command> can guess the type of the
120 argument, so <command>udevadm
121 --devpath=/class/block/sda</command> is equivalent to
122 <command>udevadm /sys/class/block/sda</command>.</para>
126 <term><option>-n</option></term>
127 <term><option>--name=<replaceable>FILE</replaceable></option></term>
129 <para>The name of the device node or a symlink to query,
130 e.g. <filename><optional>/dev</optional>/sda</filename>.
131 Note that this option usually is not very useful, since
132 <command>udev</command> can guess the type of the
133 argument, so <command>udevadm --name=sda</command> is
134 equivalent to <command>udevadm /dev/sda</command>.</para>
138 <term><option>-r</option></term>
139 <term><option>--root</option></term>
141 <para>Print absolute paths in <command>name</command> or <command>symlink</command>
146 <term><option>-a</option></term>
147 <term><option>--attribute-walk</option></term>
149 <para>Print all sysfs properties of the specified device that can be used
150 in udev rules to match the specified device. It prints all devices
151 along the chain, up to the root of sysfs that can be used in udev rules.</para>
155 <term><option>-x</option></term>
156 <term><option>--export</option></term>
158 <para>Print output as key/value pairs. Values are enclosed in single quotes.</para>
162 <term><option>-P</option></term>
163 <term><option>--export-prefix=<replaceable>NAME</replaceable></option></term>
165 <para>Add a prefix to the key name of exported values.</para>
169 <term><option>-d</option></term>
170 <term><option>--device-id-of-file=<replaceable>FILE</replaceable></option></term>
172 <para>Print major/minor numbers of the underlying device, where the file
177 <term><option>-e</option></term>
178 <term><option>--export-db</option></term>
180 <para>Export the content of the udev database.</para>
184 <term><option>-c</option></term>
185 <term><option>--cleanup-db</option></term>
187 <para>Cleanup the udev database.</para>
191 <term><option>--version</option></term>
193 <para>Print version.</para>
197 <term><option>-h</option></term>
198 <term><option>--help</option></term>
200 <para>Print help text.</para>
206 <refsect2><title>udevadm trigger <optional>options</optional></title>
207 <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
210 <term><option>-v</option></term>
211 <term><option>--verbose</option></term>
213 <para>Print the list of devices which will be triggered.</para>
217 <term><option>-n</option></term>
218 <term><option>--dry-run</option></term>
220 <para>Do not actually trigger the event.</para>
224 <term><option>-t</option></term>
225 <term><option>--type=<replaceable>TYPE</replaceable></option></term>
227 <para>Trigger a specific type of devices. Valid types are:
228 <command>devices</command>, <command>subsystems</command>.
229 The default value is <command>devices</command>.</para>
233 <term><option>-c</option></term>
234 <term><option>--action=<replaceable>ACTION</replaceable></option></term>
236 <para>Type of event to be triggered. The default value is
237 <command>change</command>.</para>
241 <term><option>-s</option></term>
242 <term><option>--subsystem-match=<replaceable>SUBSYSTEM</replaceable></option></term>
244 <para>Trigger events for devices which belong to a
245 matching subsystem. This option can be specified multiple
246 times and supports shell style pattern matching.</para>
250 <term><option>-S</option></term>
251 <term><option>--subsystem-nomatch=<replaceable>SUBSYSTEM</replaceable></option></term>
253 <para>Do not trigger events for devices which belong to a matching subsystem. This option
254 can be specified multiple times and supports shell style pattern matching.</para>
258 <term><option>-a</option></term>
259 <term><option>--attr-match=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
261 <para>Trigger events for devices with a matching sysfs
262 attribute. If a value is specified along with the
263 attribute name, the content of the attribute is matched
264 against the given value using shell style pattern
265 matching. If no value is specified, the existence of the
266 sysfs attribute is checked. This option can be specified
267 multiple times.</para>
271 <term><option>-A</option></term>
272 <term><option>--attr-nomatch=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
274 <para>Do not trigger events for devices with a matching
275 sysfs attribute. If a value is specified along with the
276 attribute name, the content of the attribute is matched
277 against the given value using shell style pattern
278 matching. If no value is specified, the existence of the
279 sysfs attribute is checked. This option can be specified
280 multiple times.</para>
284 <term><option>-p</option></term>
285 <term><option>--property-match=<replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable></option></term>
287 <para>Trigger events for devices with a matching property
288 value. This option can be specified multiple times and
289 supports shell style pattern matching.</para>
293 <term><option>-g</option></term>
294 <term><option>--tag-match=<replaceable>PROPERTY</replaceable></option></term>
296 <para>Trigger events for devices with a matching tag. This
297 option can be specified multiple times.</para>
301 <term><option>-y</option></term>
302 <term><option>--sysname-match=<replaceable>NAME</replaceable></option></term>
304 <para>Trigger events for devices with a matching sys
305 device name. This option can be specified multiple times
306 and supports shell style pattern matching.</para>
310 <term><option>-b</option></term>
311 <term><option>--parent-match=<replaceable>SYSPATH</replaceable></option></term>
313 <para>Trigger events for all children of a given
318 <term><option>-h</option></term>
319 <term><option>--help</option></term>
321 <para>Print help text.</para>
327 <refsect2><title>udevadm settle <optional>options</optional></title>
328 <para>Watches the udev event queue, and exits if all current events are handled.</para>
331 <term><option>-t</option></term>
332 <term><option>--timeout=<replaceable>SECONDS</replaceable></option></term>
334 <para>Maximum number of seconds to wait for the event
335 queue to become empty. The default value is 120 seconds. A
336 value of 0 will check if the queue is empty and always
337 return immediately.</para>
341 <term><option>-E</option></term>
342 <term><option>--exit-if-exists=<replaceable>FILE</replaceable></option></term>
344 <para>Stop waiting if file exists.</para>
348 <term><option>-h</option></term>
349 <term><option>--help</option></term>
351 <para>Print help text.</para>
357 <refsect2><title>udevadm control <replaceable>command</replaceable></title>
358 <para>Modify the internal state of the running udev daemon.</para>
361 <term><option>-x</option></term>
362 <term><option>--exit</option></term>
364 <para>Signal and wait for systemd-udevd to exit.</para>
368 <term><option>-l</option></term>
369 <term><option>--log-priority=<replaceable>value</replaceable></option></term>
371 <para>Set the internal log level of systemd-udevd. Valid values are the numerical
372 syslog priorities or their textual representations: <option>err</option>,
373 <option>info</option> and <option>debug</option>.</para>
377 <term><option>-s</option></term>
378 <term><option>--stop-exec-queue</option></term>
380 <para>Signal systemd-udevd to stop executing new events. Incoming events
381 will be queued.</para>
385 <term><option>-S</option></term>
386 <term><option>--start-exec-queue</option></term>
388 <para>Signal systemd-udevd to enable the execution of events.</para>
392 <term><option>-R</option></term>
393 <term><option>--reload</option></term>
395 <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
396 module index. Reloading rules and databases does not apply any changes to already
397 existing devices; the new configuration will only be applied to new events.</para>
401 <term><option>-p</option></term>
402 <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
404 <para>Set a global property for all events.</para>
408 <term><option>-m</option></term>
409 <term><option>--children-max=</option><replaceable>value</replaceable></term>
411 <para>Set the maximum number of events, systemd-udevd will handle at the
416 <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
418 <para>The maximum number of seconds to wait for a reply from systemd-udevd.</para>
422 <term><option>-h</option></term>
423 <term><option>--help</option></term>
425 <para>Print help text.</para>
431 <refsect2><title>udevadm monitor <optional>options</optional></title>
432 <para>Listens to the kernel uevents and events sent out by a udev rule
433 and prints the devpath of the event to the console. It can be used to analyze the
434 event timing, by comparing the timestamps of the kernel uevent and the udev event.
438 <term><option>-k</option></term>
439 <term><option>--kernel</option></term>
441 <para>Print the kernel uevents.</para>
445 <term><option>-u</option></term>
446 <term><option>--udev</option></term>
448 <para>Print the udev event after the rule processing.</para>
452 <term><option>-p</option></term>
453 <term><option>--property</option></term>
455 <para>Also print the properties of the event.</para>
459 <term><option>-s</option></term>
460 <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
462 <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
466 <term><option>-t</option></term>
467 <term><option>--tag-match=<replaceable>string</replaceable></option></term>
469 <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
473 <term><option>-h</option></term>
474 <term><option>--help</option></term>
476 <para>Print help text.</para>
482 <refsect2><title>udevadm hwdb <optional>options</optional></title>
483 <para>Maintain the hardware database index in <filename>/etc/udev/hwdb.bin</filename>.</para>
486 <term><option>-u</option></term>
487 <term><option>--update</option></term>
489 <para>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
490 /etc/udev/hwdb.d/ and store it in <filename>/etc/udev/hwdb.bin</filename>. This should be done after
491 any update to the source files; it will not be called automatically. The running
492 udev daemon will detect a new database on its own and does not need to be
493 notified about it.</para>
497 <term><option>-t</option></term>
498 <term><option>--test=<replaceable>string</replaceable></option></term>
500 <para>Query the database with a modalias string, and print the
501 retrieved properties.</para>
505 <term><option>-r</option></term>
506 <term><option>--root=<replaceable>string</replaceable></option></term>
508 <para>Alternative root path in the file system for reading and writing files.</para>
512 <term><option>-h</option></term>
513 <term><option>--help</option></term>
515 <para>Print help text.</para>
521 <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
522 <para>Simulate a udev event run for the given device, and print debug output.</para>
525 <term><option>-a</option></term>
526 <term><option>--action=<replaceable>string</replaceable></option></term>
528 <para>The action string.</para>
532 <term><option>-N</option></term>
533 <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
535 <para>Specify when udevadm should resolve names of users
536 and groups. When set to <constant>early</constant> (the
537 default), names will be resolved when the rules are
538 parsed. When set to <constant>late</constant>, names will
539 be resolved for every event. When set to
540 <constant>never</constant>, names will never be resolved
541 and all devices will be owned by root.</para>
545 <term><option>-h</option></term>
546 <term><option>--help</option></term>
548 <para>Print help text.</para>
554 <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>COMMAND</replaceable> <replaceable>DEVPATH</replaceable></title>
555 <para>Run a built-in command <replaceable>COMMAND</replaceable>
556 for device <replaceable>DEVPATH</replaceable>, and print debug
560 <term><option>-h</option></term>
561 <term><option>--help</option></term>
563 <para>Print help text.</para>
571 <title>See Also</title>
573 <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
576 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
577 </citerefentry></para>