Pcornel
Browse topics
Options
Recent
Favorites
Storage · Technical reference

udev

Direct answer

udev is the Linux device manager that creates /dev entries and stable symlinks like /dev/disk/by-id and by-uuid when devices appear. Custom rules in /etc/udev/rules.d set names, permissions or actions.

When to use this

Use this when device names, symlinks or permissions under /dev need to be stable or custom.

First 30 seconds

1. udev creates /dev nodes and symlinks (by-id, by-uuid, by-path).

2. Custom rules for stable names/permissions.

3. Test with udevadm test.

4. Reload: udevadm control --reload && udevadm trigger.

5. Events show hotplug.

Operational verification

kernel event → udev rules → /dev node + symlinks

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Rules matching too broadly (all disks instead of one serial).
  • Rules in /lib/udev/rules.d overwritten by package updates — use /etc/udev/rules.d.
  • Long-running commands in RUN+= (killed by udev; use a systemd unit).
  • Forgetting to test with udevadm test /sys/block/sdb.
Platform / version applicability
Linux Storage
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformLinux Storage
Scope / prerequisiteUse this when device names, symlinks or permissions under /dev need to be stable or custom.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • udev creates /dev entries and by-id/by-uuid links.
  • Custom rules go in /etc/udev/rules.d.
  • Reload and trigger after rule changes.
Key checks
  • udevadm info --query=all --name=/dev/sdX — device properties
  • udevadm monitor --udev — live events
  • ls /etc/udev/rules.d/ — custom rules
ReferenceHow it works1 section · depth on demand

Using udev

udevadm info --query=all --name=/dev/sdb
udevadm monitor --udev --property
ls -l /dev/disk/by-id/ /dev/disk/by-path/ /dev/disk/by-uuid/

Custom rule example (/etc/udev/rules.d/99-data.rules):

ENV{ID_SERIAL}=="WDC_WD40EFRX_WD-WCC4E1234567", SYMLINK+="backupdisk"

Documented example, not captured output. Reload with udevadm control --reload && udevadm trigger.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

udev creates device nodes and stable symlinks in /dev when the kernel reports a device, using rules in /usr/lib/udev/rules.d (vendor) and /etc/udev/rules.d (local).

udevadm info --query=all --name=/dev/sdb | grep -E 'ID_SERIAL|ID_WWN|ID_PATH'
udevadm monitor --udev --property         # watch events while plugging/rescanning
udevadm trigger --subsystem-match=block; udevadm settle

Example rule that sets a scheduler and a stable name for a device by serial:

# /etc/udev/rules.d/60-data.rules
ACTION=="add|change", KERNEL=="sd?", ENV{ID_SERIAL}=="SAMSUNG_MZ7L3_S6CXXX", ATTR{queue/scheduler}="none", SYMLINK+="data0"
ReferenceConfiguration & state1 section · depth on demand

Example rule

# /etc/udev/rules.d/99-backup-disk.rules
SUBSYSTEM=="block", ENV{ID_SERIAL}=="WDC_WD40EFRX_WD-WCC4E1234567", SYMLINK+="backupdisk"

Documented example, not captured output. Find attributes with udevadm info --query=all --name=/dev/sdb, reload with udevadm control --reload && udevadm trigger.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docLinux Storage current

Authoritative/upstream documentation reviewed for bounded claims in Linux Storage → udev. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/block/index.html · confidence 94%
Confirmation

Confirm action

Continue?