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>
23 <refmiscinfo class="version"></refmiscinfo>
27 <refname>udevadm</refname><refpurpose>udev management tool</refpurpose>
32 <command>udevadm</command>
33 <arg><option>--debug</option></arg>
34 <arg><option>--version</option></arg>
35 <arg><option>--help</option></arg>
38 <command>udevadm info <replaceable>options</replaceable></command>
41 <command>udevadm trigger <optional>options</optional></command>
44 <command>udevadm settle <optional>options</optional></command>
47 <command>udevadm control <replaceable>command</replaceable></command>
50 <command>udevadm monitor <optional>options</optional></command>
53 <command>udevadm hwdb <optional>options</optional></command>
56 <command>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></command>
59 <command>udevadm test-builtin <optional>options</optional> <replaceable>command</replaceable> <replaceable>devpath</replaceable></command>
63 <refsect1><title>Description</title>
64 <para><command>udevadm</command> expects a command and command
65 specific options. It controls the runtime behavior of
66 <command>systemd-udevd</command>, requests kernel events, manages
67 the event queue, and provides simple debugging mechanisms.</para>
70 <refsect1><title>OPTIONS</title>
73 <term><option>--debug</option></term>
75 <para>Print debug messages to stderr.</para>
79 <term><option>--version</option></term>
81 <para>Print version number.</para>
85 <term><option>-h</option></term>
86 <term><option>--help</option></term>
88 <para>Print help text.</para>
93 <refsect2><title>udevadm info <optional><replaceable>OPTIONS</replaceable></optional> <optional><replaceable>DEVPATH</replaceable>|<replaceable>FILE</replaceable></optional></title>
94 <para>Queries the udev database for device information
95 stored in the udev database. It can also query the properties
96 of a device from its sysfs representation to help creating udev
97 rules that match this device.</para>
100 <term><option>-q</option></term>
101 <term><option>--query=<replaceable>TYPE</replaceable></option></term>
103 <para>Query the database for the specified type of device
104 data. It needs the <option>--path</option> or
105 <option>--name</option> to identify the specified device.
106 Valid <replaceable>TYPE</replaceable>s are:
107 <constant>name</constant>, <constant>symlink</constant>,
108 <constant>path</constant>, <constant>property</constant>,
109 <constant>all</constant>.</para>
113 <term><option>-p</option></term>
114 <term><option>--path=<replaceable>DEVPATH</replaceable></option></term>
116 <para>The <filename>/sys</filename> path of the device to
118 <filename><optional>/sys</optional>/class/block/sda</filename>.
119 Note that this option usually is not very useful, since
120 <command>udev</command> can guess the type of the
121 argument, so <command>udevadm
122 --devpath=/class/block/sda</command> is equivalent to
123 <command>udevadm /sys/class/block/sda</command>.</para>
127 <term><option>-n</option></term>
128 <term><option>--name=<replaceable>FILE</replaceable></option></term>
130 <para>The name of the device node or a symlink to query,
131 e.g. <filename><optional>/dev</optional>/sda</filename>.
132 Note that this option usually is not very useful, since
133 <command>udev</command> can guess the type of the
134 argument, so <command>udevadm --name=sda</command> is
135 equivalent to <command>udevadm /dev/sda</command>.</para>
139 <term><option>-r</option></term>
140 <term><option>--root</option></term>
142 <para>Print absolute paths in <command>name</command> or <command>symlink</command>
147 <term><option>-a</option></term>
148 <term><option>--attribute-walk</option></term>
150 <para>Print all sysfs properties of the specified device that can be used
151 in udev rules to match the specified device. It prints all devices
152 along the chain, up to the root of sysfs that can be used in udev rules.</para>
156 <term><option>-x</option></term>
157 <term><option>--export</option></term>
159 <para>Print output as key/value pairs. Values are enclosed in single quotes.</para>
163 <term><option>-P</option></term>
164 <term><option>--export-prefix=<replaceable>NAME</replaceable></option></term>
166 <para>Add a prefix to the key name of exported values.</para>
170 <term><option>-d</option></term>
171 <term><option>--device-id-of-file=<replaceable>FILE</replaceable></option></term>
173 <para>Print major/minor numbers of the underlying device, where the file
178 <term><option>-e</option></term>
179 <term><option>--export-db</option></term>
181 <para>Export the content of the udev database.</para>
185 <term><option>-c</option></term>
186 <term><option>--cleanup-db</option></term>
188 <para>Cleanup the udev database.</para>
192 <term><option>--version</option></term>
194 <para>Print version.</para>
198 <term><option>-h</option></term>
199 <term><option>--help</option></term>
201 <para>Print help text.</para>
207 <refsect2><title>udevadm trigger <optional>options</optional></title>
208 <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
211 <term><option>-v</option></term>
212 <term><option>--verbose</option></term>
214 <para>Print the list of devices which will be triggered.</para>
218 <term><option>-n</option></term>
219 <term><option>--dry-run</option></term>
221 <para>Do not actually trigger the event.</para>
225 <term><option>-t</option></term>
226 <term><option>--type=<replaceable>TYPE</replaceable></option></term>
228 <para>Trigger a specific type of devices. Valid types are:
229 <command>devices</command>, <command>subsystems</command>.
230 The default value is <command>devices</command>.</para>
234 <term><option>-c</option></term>
235 <term><option>--action=<replaceable>ACTION</replaceable></option></term>
237 <para>Type of event to be triggered. The default value is
238 <command>change</command>.</para>
242 <term><option>-s</option></term>
243 <term><option>--subsystem-match=<replaceable>SUBSYSTEM</replaceable></option></term>
245 <para>Trigger events for devices which belong to a
246 matching subsystem. This option can be specified multiple
247 times and supports shell style pattern matching.</para>
251 <term><option>-S</option></term>
252 <term><option>--subsystem-nomatch=<replaceable>SUBSYSTEM</replaceable></option></term>
254 <para>Do not trigger events for devices which belong to a matching subsystem. This option
255 can be specified multiple times and supports shell style pattern matching.</para>
259 <term><option>-a</option></term>
260 <term><option>--attr-match=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
262 <para>Trigger events for devices with a matching sysfs
263 attribute. If a value is specified along with the
264 attribute name, the content of the attribute is matched
265 against the given value using shell style pattern
266 matching. If no value is specified, the existence of the
267 sysfs attribute is checked. This option can be specified
268 multiple times.</para>
272 <term><option>-A</option></term>
273 <term><option>--attr-nomatch=<replaceable>ATTRIBUTE</replaceable>=<replaceable>VALUE</replaceable></option></term>
275 <para>Do not trigger events for devices with a matching
276 sysfs attribute. If a value is specified along with the
277 attribute name, the content of the attribute is matched
278 against the given value using shell style pattern
279 matching. If no value is specified, the existence of the
280 sysfs attribute is checked. This option can be specified
281 multiple times.</para>
285 <term><option>-p</option></term>
286 <term><option>--property-match=<replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable></option></term>
288 <para>Trigger events for devices with a matching property
289 value. This option can be specified multiple times and
290 supports shell style pattern matching.</para>
294 <term><option>-g</option></term>
295 <term><option>--tag-match=<replaceable>PROPERTY</replaceable></option></term>
297 <para>Trigger events for devices with a matching tag. This
298 option can be specified multiple times.</para>
302 <term><option>-y</option></term>
303 <term><option>--sysname-match=<replaceable>NAME</replaceable></option></term>
305 <para>Trigger events for devices with a matching sys
306 device name. This option can be specified multiple times
307 and supports shell style pattern matching.</para>
311 <term><option>-b</option></term>
312 <term><option>--parent-match=<replaceable>SYSPATH</replaceable></option></term>
314 <para>Trigger events for all children of a given
319 <term><option>-h</option></term>
320 <term><option>--help</option></term>
322 <para>Print help text.</para>
328 <refsect2><title>udevadm settle <optional>options</optional></title>
329 <para>Watches the udev event queue, and exits if all current events are handled.</para>
332 <term><option>-t</option></term>
333 <term><option>--timeout=<replaceable>SECONDS</replaceable></option></term>
335 <para>Maximum number of seconds to wait for the event
336 queue to become empty. The default value is 120 seconds. A
337 value of 0 will check if the queue is empty and always
338 return immediately.</para>
342 <term><option>-s</option></term>
343 <term><option>--seq-start=<replaceable>SEQNUM</replaceable></option></term>
345 <para>Wait only for events after the given sequence
350 <term><option>-e</option></term>
351 <term><option>--seq-end=<replaceable>SEQNUM</replaceable></option></term>
353 <para>Wait only for events before the given sequence number.</para>
357 <term><option>-E</option></term>
358 <term><option>--exit-if-exists=<replaceable>FILE</replaceable></option></term>
360 <para>Stop waiting if file exists.</para>
364 <term><option>-q</option></term>
365 <term><option>--quiet</option></term>
367 <para>Do not print any output, like the remaining queue entries when reaching the timeout.</para>
371 <term><option>-h</option></term>
372 <term><option>--help</option></term>
374 <para>Print help text.</para>
380 <refsect2><title>udevadm control <replaceable>command</replaceable></title>
381 <para>Modify the internal state of the running udev daemon.</para>
384 <term><option>-x</option></term>
385 <term><option>--exit</option></term>
387 <para>Signal and wait for systemd-udevd to exit.</para>
391 <term><option>-l</option></term>
392 <term><option>--log-priority=<replaceable>value</replaceable></option></term>
394 <para>Set the internal log level of systemd-udevd. Valid values are the numerical
395 syslog priorities or their textual representations: <option>err</option>,
396 <option>info</option> and <option>debug</option>.</para>
400 <term><option>-s</option></term>
401 <term><option>--stop-exec-queue</option></term>
403 <para>Signal systemd-udevd to stop executing new events. Incoming events
404 will be queued.</para>
408 <term><option>-S</option></term>
409 <term><option>--start-exec-queue</option></term>
411 <para>Signal systemd-udevd to enable the execution of events.</para>
415 <term><option>-R</option></term>
416 <term><option>--reload</option></term>
418 <para>Signal systemd-udevd to reload the rules files and other databases like the kernel
419 module index. Reloading rules and databases does not apply any changes to already
420 existing devices; the new configuration will only be applied to new events.</para>
424 <term><option>-p</option></term>
425 <term><option>--property=<replaceable>KEY</replaceable>=<replaceable>value</replaceable></option></term>
427 <para>Set a global property for all events.</para>
431 <term><option>-m</option></term>
432 <term><option>--children-max=</option><replaceable>value</replaceable></term>
434 <para>Set the maximum number of events, systemd-udevd will handle at the
439 <term><option>--timeout=</option><replaceable>seconds</replaceable></term>
441 <para>The maximum number of seconds to wait for a reply from systemd-udevd.</para>
445 <term><option>-h</option></term>
446 <term><option>--help</option></term>
448 <para>Print help text.</para>
454 <refsect2><title>udevadm monitor <optional>options</optional></title>
455 <para>Listens to the kernel uevents and events sent out by a udev rule
456 and prints the devpath of the event to the console. It can be used to analyze the
457 event timing, by comparing the timestamps of the kernel uevent and the udev event.
461 <term><option>-k</option></term>
462 <term><option>--kernel</option></term>
464 <para>Print the kernel uevents.</para>
468 <term><option>-u</option></term>
469 <term><option>--udev</option></term>
471 <para>Print the udev event after the rule processing.</para>
475 <term><option>-p</option></term>
476 <term><option>--property</option></term>
478 <para>Also print the properties of the event.</para>
482 <term><option>-s</option></term>
483 <term><option>--subsystem-match=<replaceable>string[/string]</replaceable></option></term>
485 <para>Filter events by subsystem[/devtype]. Only udev events with a matching subsystem value will pass.</para>
489 <term><option>-t</option></term>
490 <term><option>--tag-match=<replaceable>string</replaceable></option></term>
492 <para>Filter events by property. Only udev events with a given tag attached will pass.</para>
496 <term><option>-h</option></term>
497 <term><option>--help</option></term>
499 <para>Print help text.</para>
505 <refsect2><title>udevadm hwdb <optional>options</optional></title>
506 <para>Maintain the hardware database index in <filename>/etc/udev/hwdb.bin</filename>.</para>
509 <term><option>-u</option></term>
510 <term><option>--update</option></term>
512 <para>Compile the hardware database information located in /usr/lib/udev/hwdb.d/,
513 /etc/udev/hwdb.d/ and store it in <filename>/etc/udev/hwdb.bin</filename>. This should be done after
514 any update to the source files; it will not be called automatically. The running
515 udev daemon will detect a new database on its own and does not need to be
516 notified about it.</para>
520 <term><option>-t</option></term>
521 <term><option>--test=<replaceable>string</replaceable></option></term>
523 <para>Query the database with a modalias string, and print the
524 retrieved properties.</para>
528 <term><option>-r</option></term>
529 <term><option>--root=<replaceable>string</replaceable></option></term>
531 <para>Alternative root path in the file system for reading and writing files.</para>
535 <term><option>-h</option></term>
536 <term><option>--help</option></term>
538 <para>Print help text.</para>
544 <refsect2><title>udevadm test <optional>options</optional> <replaceable>devpath</replaceable></title>
545 <para>Simulate a udev event run for the given device, and print debug output.</para>
548 <term><option>-a</option></term>
549 <term><option>--action=<replaceable>string</replaceable></option></term>
551 <para>The action string.</para>
555 <term><option>-N</option></term>
556 <term><option>--resolve-names=<constant>early</constant>|<constant>late</constant>|<constant>never</constant></option></term>
558 <para>Specify when udevadm should resolve names of users
559 and groups. When set to <constant>early</constant> (the
560 default), names will be resolved when the rules are
561 parsed. When set to <constant>late</constant>, names will
562 be resolved for every event. When set to
563 <constant>never</constant>, names will never be resolved
564 and all devices will be owned by root.</para>
568 <term><option>-h</option></term>
569 <term><option>--help</option></term>
571 <para>Print help text.</para>
577 <refsect2><title>udevadm test-builtin <optional>options</optional> <replaceable>COMMAND</replaceable> <replaceable>DEVPATH</replaceable></title>
578 <para>Run a built-in command <replaceable>COMMAND</replaceable>
579 for device <replaceable>DEVPATH</replaceable>, and print debug
583 <term><option>-h</option></term>
584 <term><option>--help</option></term>
586 <para>Print help text.</para>
594 <title>See Also</title>
596 <refentrytitle>udev</refentrytitle><manvolnum>7</manvolnum>
599 <refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum>
600 </citerefentry></para>