LinuxCommandLibrary

udevadm

Manage and monitor udev event subsystem

TLDR

Monitor all device events

$ sudo udevadm monitor
copy

Print uevents sent out by the kernel
$ sudo udevadm monitor --kernel
copy

Print device events after being processed by udev
$ sudo udevadm monitor --udev
copy

List attributes of device /dev/sda
$ sudo udevadm info --attribute-walk [/dev/sda]
copy

Reload all udev rules
$ sudo udevadm control --reload
copy

Trigger all udev rules to run
$ sudo udevadm trigger
copy

Test an event run by simulating loading of /dev/sda
$ sudo udevadm test [/dev/sda]
copy

SYNOPSIS

udevadm [options] command

PARAMETERS

help
    Display help text and exit.

version
    Print version number and exit.

monitor
    Listen to kernel udev events.

control
    Request udev control functions. Available functions: reload_rules, trigger

trigger
    Request udev to process events for matching devices.

settle
    Wait for all udev events to be handled.

info
    Query the udev database for device information.

test
    Simulate a udev event without actually creating device nodes.

admdb
    Tool to manage udev's database.

hwdb
    Tool to manage hardware databases.

DESCRIPTION

udevadm is a command-line utility used to manage the udev event manager in Linux systems.

udev dynamically manages device nodes in the /dev directory, creating, removing, and renaming them based on hardware events.

udevadm allows you to query the udev database, trigger events, monitor device activity, and test udev rules.

It's a crucial tool for troubleshooting device-related issues, configuring persistent device naming, and understanding how udev interacts with the system's hardware.

Using udevadm is usually required for debugging the boot process.

CAVEATS

udevadm requires root privileges for most operations.

Incorrect use of udevadm can lead to device malfunctions or system instability.

EXAMPLES

udevadm monitor: Monitors device events in real-time.

udevadm info --attribute-walk --path=/sys/block/sda: Displays detailed information about the device /dev/sda by traversing its attributes.

udevadm trigger: Triggers udev events based on current kernel state.

udevadm control reload_rules: Reloads the udev rules from disk.

HISTORY

udev was created as a replacement for devfs, which had several limitations.

udev dynamically creates and manages device nodes, providing a more flexible and robust solution.

udevadm is the command-line tool for interacting with udev, allowing users to manage devices, monitor events, and troubleshoot issues.

It has become an integral part of modern Linux distributions, providing a standardized way to manage hardware devices.

SEE ALSO

udev(7)

Copied to clipboard