Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk5 min

How Linux Identifies USB Devices: USB IDs, udev Rules, and systemd hwdb

Linux exposes USB vendor and product IDs through sysfs. Learn how udev derives properties from them, how to choose the right rule match, and when systemd hwdb applies.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linux identifies USB hardware from numeric vendor and product IDs exposed by the kernel, then systemd-udevd can turn those values and other USB descriptors into properties used by rules and applications. Use a udev rule when you need to match a device event and change udev behavior; use systemd hwdb when a hardware-aware consumer expects match-keyed properties. First inspect the device and its parent chain: a USB device, one of its interfaces, and a child such as a tty node are different match targets.

What Linux means by a USB hardware ID

When the kernel enumerates a USB device, it exposes descriptor values through its device model and sysfs. Common raw attributes include idVendor, idProduct, bcdDevice, manufacturer, product, and serial. The vendor and product IDs are numeric identifiers; manufacturer and product strings are separate descriptive fields and may be absent or inconsistent. The Linux USB API documentation also describes vendor and product IDs as values used for USB driver matching.

As an Amazon Associate I earn from qualifying purchases.

A numeric ID is usually a steadier match key than a text label, but it identifies a product identity rather than necessarily one physical unit. If a device provides a serial number and you include it in a match, you may narrow the match to an individual unit. Device strings can help make output readable; they should not be assumed to be present.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How udev turns USB descriptors into properties

systemd-udevd processes device events and can derive properties from USB attributes using its usb_id builtin. Properties such as ID_VENDOR_ID, ID_MODEL_ID, ID_VENDOR, ID_MODEL, ID_SERIAL, and ID_BUS are udev metadata, not the original USB descriptor fields. The builtin normalizes readable strings and can fall back to numeric IDs when a manufacturer or product string is unavailable. Its implementation also handles serial and interface-related information; see the systemd usb_id source.

#1 Best Overall
Rinbers Universal Laptop Keyboard Tester Testing Device Machine Tool USB Interface QK-AK5 with USB Charging Data Cable
  • New Laptop Keyboard Tester Testing Device Machine Tool USB Interface QK-AK5 with Free USB Charging Cable for Apple Samsung Dell HP ASUS Sony Acer Huawei Lenovo and so on
  • This is an universal laptop keyboard tester with several test cable connector, you can use it to test any keyboard with cable
  • This device is easy to use:1). Connect it to a computer by the USB cable.2). Insert the keyboard cable into the corresponding connector.3). Push the opening button, the device will sound 1 times, which means it starts working.4). Press keys of the keyboard, if every keys sound, it means the keyboard is good, if not, the keyboard has problem. If the sound is long and can not stop, the keyboard might be bad or the cable is not installed correctly or firmly.
  • Package included: 1x laptop tester/testing device, 1x USB Charging Cable.
  • 30 Days Warranty,No Man-Made Scratch or Damage when Retuning or Exchanging

Keep three layers distinct when diagnosing a device:

  • Raw USB attributes: descriptor-derived values exposed in sysfs, such as idVendor and idProduct.
  • udev properties: values derived by udev builtins or rules and available to userspace consumers, such as ID_VENDOR_ID and ID_SERIAL.
  • Kernel driver matching: driver-level matching against USB IDs or class/interface information; it is related to identification but is not the same mechanism as a userspace udev rule.

Distinguish the USB device from its interfaces and child nodes

A physical USB product can expose multiple interfaces. For example, a composite device may present separate functions, each with its own interface class, subclass, and protocol. A rule targeting the USB device is not automatically equivalent to a rule targeting a child such as ttyUSB0, hidraw0, or an input event node.

Rank #2
D YEDEMC Mini Optical Fiber Power Meter FC/SC/ST Universal Interface Fiber Tester Integrated OPM, VFL, and RJ45 Functions
  • Function: can measure 8 standdard wavelengths 850/980/1300/1310/1490/ 1550/1625/1650nm , test range: -70dBm~+6dBm, Integrated OPM, VFL, and RJ45 Functions.
  • Support lighting,Support automatic shutdown,Support backlight selection, Support wavelenghth memory function,Support user calibration.
  • Support FC/SC/ST 2.5mm universal interface,Support RJ45 testing,Support simultaneous disply of linear mW and non-linear index dBm.
  • Integrated OPM, VFL, and RJ45 Functions,Test precision, fine workmanship, easy to carry,completely replace the optical power meter and red pen 2 products. Come with English manual
  • Notice:The product uses two pcs AA dry batteries, but they are not included in the packaging . Lifetime Friendly Customer Service,if have problem,pls contact us.

Inspect the actual sysfs path and ancestry before choosing a match. Use udevadm info --attribute-walk /dev/DEVICE for a device node, substituting the real path, or inspect the relevant /sys entry. Attributes belonging to the event device itself are commonly matched with ATTR; attributes found on a parent in its ancestry may require parent-aware matching such as ATTRS. Check the installed udev manual for the rule semantics on your system. The systemd rules examples show matching patterns that combine USB attributes and interface information.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to use a udev rule or systemd hwdb

Mechanism What it is for What to check
udev rule Match a device event and apply supported udev behavior, such as setting a property. Target subsystem, event device versus parent, rule ordering, and the installed udev rule syntax.
systemd hwdb Store match-keyed hardware properties for consumers that read them. Whether the specific consumer uses hwdb for the property or quirk you intend to change.

These mechanisms are related but not interchangeable. A rule expresses event-time matching and behavior; hwdb supplies hardware-specific data to consumers that consult the database. Do not assume that every hardware quirk belongs in hwdb: projects can use their own configuration systems. For example, the libinput device-configuration documentation describes hwdb workflows and notes that libinput has moved its device quirks to a separate system. Follow the documentation for the subsystem whose behavior you need to change.

Rank #3
Rechargeable Live Optical Fiber Identifier with Wave Respond 800-1700nm
  • Indicate the signal directions and power in fiber, displays the relative core power. Can detect optical signals in the tone signal fixed load, 270Hz, 1KHz and 2KHz, to identify a specific optical fiber, can quickly find the necessary fiber.
  • Build in OPM function, test wavelength 850/980/1270/1300/1310/1490/1550/1577/1625/1650nm, Measurement range -70~+10dB. Connectortype 2.5 universal connector.
  • Build in VFL can measure the fiber distance is about 15-20 kilometers, allowing for easy identification of fiber fault points.
  • Self-adjusting gripper, no need to change the adapter, Application of optical fiber 250um/900um/2mm/3mm.
  • Lightweight design and LED color screen, outline size 167*50*27mm, weight 100g. Friendly Customer Service, if have problem, pls contact us.

Write and test a local udev rule

The following is an illustrative match that sets a property; replace the example IDs and assignment with values and behavior appropriate to the device. It does not change permissions or power behavior:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="vvvv", ATTR{idProduct}=="pppp", ENV{EXAMPLE_MATCHED}="1"

For a child node, the USB attributes may be on a parent rather than the event device, so inspect the tree and adjust the matching keys accordingly. Add administrator rules in the local configuration directory, commonly /etc/udev/rules.d, using a filename whose sort order is appropriate. Do not edit packaged rules under /usr/lib/udev/rules.d or /lib/udev/rules.d; package updates can replace them. The udev manual documents rule-file syntax, matching operators, substitutions, and assignments; details can vary with the installed systemd version.

Rank #4
Secure Data Wipe USB – Permanent Hard Drive Erase Tool | Military-Grade Data Sanitization for PC, Laptop, HDD & SSD | Bootable USB Drive – Easy & Secure Data Removal
  • ✔ Permanently Wipe Data – Securely erase your hard drive, ensuring no recovery is possible.
  • ✔ Plug & Play – No Installation Needed – Bootable USB drive with preloaded professional erasure software.
  • ✔ For IT Professionals & Personal Use – Perfect for selling, recycling, or disposing of old computers.
  • ✔ Compatible with Most Devices – Works with Windows, Linux, BIOS & UEFI-based PCs & Laptops.
  • ✔ Industry-Standard Data Sanitization – Uses trusted DBAN, ShredOS (Nwipe), and Secure Erase tools.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Update and verify a hwdb change

If you edit an hwdb file, rebuild the database and refresh the relevant device so the consumer can see the resulting properties. The libinput documentation gives this example workflow; replace the example input path with the actual affected device path:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemd-hwdb update
sudo udevadm trigger /sys/class/input/eventX
udevadm info /sys/class/input/eventX
sudo udevadm test /sys/class/input/eventX

Command availability and behavior depend on the systemd version and distribution. udevadm info lets you inspect the properties associated with the device. udevadm test is useful for diagnosing rule matching and parsing, but it does not execute RUN directives, so it cannot simulate every side effect. Consult the installed systemd-hwdb and udevadm manual pages alongside the consumer’s documentation.

A practical identification workflow

  1. Locate the target. Determine whether your goal concerns the USB device itself, an interface, or a child node such as a tty, hidraw, or input event device.
  2. Inspect raw attributes and ancestry. Record the vendor and product IDs, relevant interface attributes, and—only if needed—the serial number. Use udevadm info --attribute-walk on the relevant device node or inspect its sysfs path.
  3. Inspect the current udev properties. Use udevadm info to see derived properties. If a property is missing, determine whether the underlying raw attribute is missing or whether it was not imported or set by a rule.
  4. Choose the mechanism by consumer and outcome. Use a local rule for event matching and udev behavior; use hwdb only when the consumer documents that it reads the relevant hardware property there.
  5. Apply and refresh. For a rule, follow your system’s rule reload and device-trigger procedure. For hwdb, run systemd-hwdb update and trigger the relevant device as appropriate.
  6. Verify the result. Re-check properties with udevadm info, and use udevadm test to diagnose matching issues while accounting for its limits around RUN directives.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.