Chapter 1: The Name Problem

Think about how we identify people. We don't say "the person sitting in the third chair from the left." We use names, relationships, unique characteristics. If someone moves to a different chair, they're still the same person. Their identity persists.

Now imagine if we did it the other way. Every morning, you'd have to relearn: "Okay, today Sarah is Chair 1, Tom is Chair 2..." It would be chaotic, fragile, and utterly exhausting.

This was exactly the problem in early Linux systems.

The "Discovery Order" Chaos

Traditional Linux systems named devices by the order they were discovered. Your first SATA drive became /dev/sda, your second /dev/sdb, and so on. Your keyboard might be /dev/input/event0, your mouse /dev/input/event1.

It's like calling someone "the third person who walked into the room." Simple, right? Until the second person leaves. Does everyone's number change? What happens when people enter in a different order tomorrow?

The chaos in action:

  • Plug in your USB drive → it becomes /dev/sdb
  • Reboot without the drive → your internal hard drive might shift from /dev/sda to /dev/sdb
  • Plug the USB back in → now it's /dev/sdc
  • Your backup script pointing to /dev/sdb just broke
  • Your encrypted disk configuration is now pointing to the wrong device

This wasn't just inconvenient - it was fundamentally broken for a dynamic world where devices come and go.

This is where udev enters our story. The developers realized: we weren't asking the right question.

Instead of "What order did devices appear?" they asked: "Who are you, really?"

What This Reveals: Dynamic Device Management

Udev (userspace /dev) is Linux's dynamic device manager. It lives in userspace (not the kernel) and has one primary job: give every device a persistent, meaningful identity.

Here's the elegant dance of device discovery:

  1. A device connects (USB drive, keyboard, printer)
  2. The kernel detects it and creates a kernel event
  3. Udev receives this event
  4. Udev examines the device's properties (manufacturer, serial number, type, model)
  5. Udev applies rules to determine what to do
  6. Udev creates device nodes in /dev/ with consistent names
  7. Udev triggers any necessary actions (mount, notify, run scripts)

Instead of /dev/sdb (which changes), udev creates multiple, reliable access points:

  • /dev/disk/by-uuid/a1b2c3d4... (unique identifier burned into the hardware)
  • /dev/disk/by-label/MYUSB (human-readable name you chose)
  • /dev/disk/by-path/pci-0000:00:14.0-usb-0:2:1.0 (physical connection path)
  • /dev/disk/by-id/usb-SanDisk_Cruzer_Blade_4C530101020806115295 (manufacturer details)

Same device, multiple ways to find it - none dependent on discovery order. Your backup script can now use /dev/disk/by-uuid/... and work forever. Your encrypted disk will always find its home.

Exercise 1: Discover Your Devices

Open a terminal and try these commands:

# See all your storage devices and their persistent links
ls -la /dev/disk/by-id/

# Watch udev events in real-time (try plugging in a USB while this runs)
udevadm monitor

# See all properties of a specific device
udevadm info /dev/sda        

Notice how much information udev has about each device - manufacturer, model, serial number, capabilities. This rich identity is what enables the magic.

The name problem wasn't just a technical issue - it was a philosophical one. By solving it, udev didn't just make devices more reliable; it made them feel like they belonged in the system.

Your keyboard isn't "the third input device that showed up today." It's your keyboard. Your backup drive isn't "whatever happens to be sdb this week." It's your backup drive.

In our next chapter, we'll explore The Rulebook of Order - how udev uses simple, human-readable rules to create these persistent names and trigger custom actions.

For complete list of chapters, see The Udev in Linux: A Device Management Philosophy.

Thought question: Have you ever been troubled by dynamic device node naming? Share your stories in the comments!


Since the framework is in userspace, are there any alternatives the distros use for trade-offs to udev? Also, since it's in user space, is it a daemon launched by init? or, part of initrd/systemd? What would device driver need to add in their Kernel side code to make it readable by udev? Or, would they need to add anything on udev framework?

To view or add a comment, sign in

More articles by Vishnu Santhosh

Others also viewed

Explore content categories