1UDEVADM(8) udevadm UDEVADM(8)
2
3
4
6 udevadm - udev management tool
7
9 udevadm [--debug] [--version] [--help]
10
11 udevadm info [options] [devpath]
12
13 udevadm trigger [options] [devpath]
14
15 udevadm settle [options]
16
17 udevadm control option
18
19 udevadm monitor [options]
20
21 udevadm test [options] devpath
22
23 udevadm test-builtin [options] command devpath
24
26 udevadm expects a command and command specific options. It controls the
27 runtime behavior of systemd-udevd, requests kernel events, manages the
28 event queue, and provides simple debugging mechanisms.
29
31 -d, --debug
32 Print debug messages to standard error. This option is implied in
33 udevadm test and udevadm test-builtin commands.
34
35 -h, --help
36 Print a short help text and exit.
37
38 udevadm info [options] [devpath|file|unit...]
39 Query the udev database for device information.
40
41 Positional arguments should be used to specify one or more devices.
42 Each one may be a device name (in which case it must start with /dev/),
43 a sys path (in which case it must start with /sys/), or a systemd
44 device unit name (in which case it must end with ".device", see
45 systemd.device(5)).
46
47 -q, --query=TYPE
48 Query the database for the specified type of device data. Valid
49 TYPEs are: name, symlink, path, property, all.
50
51 -p, --path=DEVPATH
52 The /sys/ path of the device to query, e.g.
53 [/sys/]/class/block/sda. This option is an alternative to the
54 positional argument with a /sys/ prefix. udevadm info
55 --path=/class/block/sda is equivalent to udevadm info
56 /sys/class/block/sda.
57
58 -n, --name=FILE
59 The name of the device node or a symlink to query, e.g.
60 [/dev/]/sda. This option is an alternative to the positional
61 argument with a /dev/ prefix. udevadm info --name=sda is
62 equivalent to udevadm info /dev/sda.
63
64 -r, --root
65 Print absolute paths in name or symlink query.
66
67 -a, --attribute-walk
68 Print all sysfs properties of the specified device that can be used
69 in udev rules to match the specified device. It prints all devices
70 along the chain, up to the root of sysfs that can be used in udev
71 rules.
72
73 -x, --export
74 Print output as key/value pairs. Values are enclosed in single
75 quotes. This takes effects only when --query=property or
76 --device-id-of-file=FILE is specified.
77
78 -P, --export-prefix=NAME
79 Add a prefix to the key name of exported values. This implies
80 --export.
81
82 -d, --device-id-of-file=FILE
83 Print major/minor numbers of the underlying device, where the file
84 lives on. If this is specified, all positional arguments are
85 ignored.
86
87 -e, --export-db
88 Export the content of the udev database.
89
90 -c, --cleanup-db
91 Cleanup the udev database.
92
93 -w[SECONDS], --wait-for-initialization[=SECONDS]
94 Wait for device to be initialized. If argument SECONDS is not
95 specified, the default is to wait forever.
96
97 -h, --help
98 Print a short help text and exit.
99
100 The generated output shows the current device database entry in a terse
101 format. Each line shown is prefixed with one of the following
102 characters:
103
104 Table 1. udevadm info output prefixes
105 ┌───────┬─────────────────────────┐
106 │Prefix │ Meaning │
107 ├───────┼─────────────────────────┤
108 │"P:" │ Device path in /sys/ │
109 ├───────┼─────────────────────────┤
110 │"N:" │ Kernel device node name │
111 ├───────┼─────────────────────────┤
112 │"L:" │ Device node symlink │
113 │ │ priority │
114 ├───────┼─────────────────────────┤
115 │"S:" │ Device node symlink │
116 ├───────┼─────────────────────────┤
117 │"E:" │ Device property │
118 └───────┴─────────────────────────┘
119
120 udevadm trigger [options] [devpath|file|unit]
121 Request device events from the kernel. Primarily used to replay events
122 at system coldplug time.
123
124 Takes device specifications as positional arguments. See the
125 description of info above.
126
127 -v, --verbose
128 Print the list of devices which will be triggered.
129
130 -n, --dry-run
131 Do not actually trigger the event.
132
133 -q, --quiet
134 Suppress error logging in triggering events.
135
136 -t, --type=TYPE
137 Trigger a specific type of devices. Valid types are: devices,
138 subsystems. The default value is devices.
139
140 -c, --action=ACTION
141 Type of event to be triggered. Possible actions are "add",
142 "remove", "change", "move", "online", "offline", "bind", and
143 "unbind". Also, the special value "help" can be used to list the
144 possible actions. The default value is "change".
145
146 -s, --subsystem-match=SUBSYSTEM
147 Trigger events for devices which belong to a matching subsystem.
148 This option supports shell style pattern matching. When this option
149 is specified more than once, then each matching result is ORed,
150 that is, all the devices in each subsystem are triggered.
151
152 -S, --subsystem-nomatch=SUBSYSTEM
153 Do not trigger events for devices which belong to a matching
154 subsystem. This option supports shell style pattern matching. When
155 this option is specified more than once, then each matching result
156 is ANDed, that is, devices which do not match all specified
157 subsystems are triggered.
158
159 -a, --attr-match=ATTRIBUTE=VALUE
160 Trigger events for devices with a matching sysfs attribute. If a
161 value is specified along with the attribute name, the content of
162 the attribute is matched against the given value using shell style
163 pattern matching. If no value is specified, the existence of the
164 sysfs attribute is checked. When this option is specified multiple
165 times, then each matching result is ANDed, that is, only devices
166 which have all specified attributes are triggered.
167
168 -A, --attr-nomatch=ATTRIBUTE=VALUE
169 Do not trigger events for devices with a matching sysfs attribute.
170 If a value is specified along with the attribute name, the content
171 of the attribute is matched against the given value using shell
172 style pattern matching. If no value is specified, the existence of
173 the sysfs attribute is checked. When this option is specified
174 multiple times, then each matching result is ANDed, that is, only
175 devices which have none of the specified attributes are triggered.
176
177 -p, --property-match=PROPERTY=VALUE
178 Trigger events for devices with a matching property value. This
179 option supports shell style pattern matching. When this option is
180 specified more than once, then each matching result is ORed, that
181 is, devices which have one of the specified properties are
182 triggered.
183
184 -g, --tag-match=TAG
185 Trigger events for devices with a matching tag. When this option is
186 specified multiple times, then each matching result is ANDed, that
187 is, devices which have all specified tags are triggered.
188
189 -y, --sysname-match=NAME
190 Trigger events for devices for which the last component (i.e. the
191 filename) of the /sys/ path matches the specified PATH. This option
192 supports shell style pattern matching. When this option is
193 specified more than once, then each matching result is ORed, that
194 is, all devices which have any of the specified NAME are triggered.
195
196 --name-match=NAME
197 Trigger events for devices with a matching device path. When this
198 option is specified more than once, then each matching result is
199 ORed, that is, all specified devices are triggered.
200
201 -b, --parent-match=SYSPATH
202 Trigger events for all children of a given device. When this option
203 is specified more than once, then each matching result is ORed,
204 that is, all children of each specified device are triggered.
205
206 -w, --settle
207 Apart from triggering events, also waits for those events to
208 finish. Note that this is different from calling udevadm settle.
209 udevadm settle waits for all events to finish. This option only
210 waits for events triggered by the same command to finish.
211
212 --uuid
213 Trigger the synthetic device events, and associate a randomized
214 UUID with each. These UUIDs are printed to standard output, one
215 line for each event. These UUIDs are included in the uevent
216 environment block (in the "SYNTH_UUID=" property) and may be used
217 to track delivery of the generated events.
218
219 --wait-daemon[=SECONDS]
220 Before triggering uevents, wait for systemd-udevd daemon to be
221 initialized. Optionally takes timeout value. Default timeout is 5
222 seconds. This is equivalent to invoke invoking udevadm control
223 --ping before udevadm trigger.
224
225 -h, --help
226 Print a short help text and exit.
227
228 In addition, optional positional arguments can be used to specify
229 device names or sys paths. They must start with /dev/ or /sys/
230 respectively.
231
232 udevadm settle [options]
233 Watches the udev event queue, and exits if all current events are
234 handled.
235
236 -t, --timeout=SECONDS
237 Maximum number of seconds to wait for the event queue to become
238 empty. The default value is 120 seconds. A value of 0 will check if
239 the queue is empty and always return immediately. A non-zero value
240 will return an exit code of 0 if queue became empty before timeout
241 was reached, non-zero otherwise.
242
243 -E, --exit-if-exists=FILE
244 Stop waiting if file exists.
245
246 -h, --help
247 Print a short help text and exit.
248
249 See systemd-udev-settle.service(8) for more information.
250
251 udevadm control option
252 Modify the internal state of the running udev daemon.
253
254 -e, --exit
255 Signal and wait for systemd-udevd to exit. No option except for
256 --timeout can be specified after this option. Note that
257 systemd-udevd.service contains Restart=always and so as a result,
258 this option restarts systemd-udevd. If you want to stop
259 systemd-udevd.service, please use the following:
260
261 systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service
262
263
264 -l, --log-level=value
265 Set the internal log level of systemd-udevd. Valid values are the
266 numerical syslog priorities or their textual representations:
267 emerg, alert, crit, err, warning, notice, info, and debug.
268
269 -s, --stop-exec-queue
270 Signal systemd-udevd to stop executing new events. Incoming events
271 will be queued.
272
273 -S, --start-exec-queue
274 Signal systemd-udevd to enable the execution of events.
275
276 -R, --reload
277 Signal systemd-udevd to reload the rules files and other databases
278 like the kernel module index. Reloading rules and databases does
279 not apply any changes to already existing devices; the new
280 configuration will only be applied to new events.
281
282 -p, --property=KEY=value
283 Set a global property for all events.
284
285 -m, --children-max=value
286 Set the maximum number of events, systemd-udevd will handle at the
287 same time.
288
289 --ping
290 Send a ping message to systemd-udevd and wait for the reply. This
291 may be useful to check that systemd-udevd daemon is running.
292
293 -t, --timeout=seconds
294 The maximum number of seconds to wait for a reply from
295 systemd-udevd.
296
297 -h, --help
298 Print a short help text and exit.
299
300 udevadm monitor [options]
301 Listens to the kernel uevents and events sent out by a udev rule and
302 prints the devpath of the event to the console. It can be used to
303 analyze the event timing, by comparing the timestamps of the kernel
304 uevent and the udev event.
305
306 -k, --kernel
307 Print the kernel uevents.
308
309 -u, --udev
310 Print the udev event after the rule processing.
311
312 -p, --property
313 Also print the properties of the event.
314
315 -s, --subsystem-match=string[/string]
316 Filter kernel uevents and udev events by subsystem[/devtype]. Only
317 events with a matching subsystem value will pass. When this option
318 is specified more than once, then each matching result is ORed,
319 that is, all devices in the specified subsystems are monitored.
320
321 -t, --tag-match=string
322 Filter udev events by tag. Only udev events with a given tag
323 attached will pass. When this option is specified more than once,
324 then each matching result is ORed, that is, devices which have one
325 of the specified tags are monitored.
326
327 -h, --help
328 Print a short help text and exit.
329
330 udevadm test [options] [devpath]
331 Simulate a udev event run for the given device, and print debug output.
332
333 -a, --action=ACTION
334 Type of event to be simulated. Possible actions are "add",
335 "remove", "change", "move", "online", "offline", "bind", and
336 "unbind". Also, the special value "help" can be used to list the
337 possible actions. The default value is "add".
338
339 -N, --resolve-names=early|late|never
340 Specify when udevadm should resolve names of users and groups. When
341 set to early (the default), names will be resolved when the rules
342 are parsed. When set to late, names will be resolved for every
343 event. When set to never, names will never be resolved and all
344 devices will be owned by root.
345
346 -h, --help
347 Print a short help text and exit.
348
349 udevadm test-builtin [options] [command] [devpath]
350 Run a built-in command COMMAND for device DEVPATH, and print debug
351 output.
352
353 -h, --help
354 Print a short help text and exit.
355
357 udev(7), systemd-udevd.service(8)
358
359
360
361systemd 249 UDEVADM(8)