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