brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: udevadm monitor shows hardware events live while you plug things in

Hardware
~/tips/tip-hardware-udevadm-monitor

udevadm monitor

Watch the system react the moment a device appears or disappears.

If a device does nothing when plugged in, my first question is whether Linux noticed it at all. This command answers that in seconds.

udevadm monitor

Now plug the device in. KERNEL lines are the raw events from the kernel, and UDEV lines appear after udev has applied its rules. Press Ctrl+C to stop.

Filter to one subsystem to cut the noise:

udevadm monitor --udev --subsystem-match=usb

Add the properties when you are writing a udev rule:

udevadm monitor --udev --property --subsystem-match=tty

That prints values such as the vendor ID, model ID and serial, which are exactly what a rule needs to match on. I find that quicker than guessing from the documentation of the device.

No events at all usually means a bad cable, a dead port or a device without power, and software will not fix those. Try another cable first, since charge only USB cables carry no data and look identical to normal ones. Events but no usable device points the other way, at a missing driver, and then the kernel log is your next stop. A flaky device that keeps connecting and disconnecting shows up here as a stream of add and remove lines.

Further reading: udevadm man page

More Hardware tips disable_poe_fan=1 sudo dmidecode -s bios-version sudo lshw -short rfkill list Get-CimInstance Win32_BIOS | Select-Object Manufacturer, SMBIOSBIOSVersion, ReleaseDate, SerialNumber All Hardware tips (8) All topics

Link