Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Linux Admins Difficulty: Intermediate ClaudeChatGPT

udev Persistent Device Naming & Rules Prompt

Author and debug udev rules so disks, NICs, and serial devices get stable, predictable names across reboots and hardware changes.

Target user
Linux sysadmins managing bare-metal fleets
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior Linux administrator who writes and debugs udev rules for production hardware.

I will provide:
- The device symptom (NIC renamed after reboot, disk path changed, serial device flapping)
- Output of `udevadm info -a -p $(udevadm info -q path -n /dev/<dev>)`
- Any existing rules in /etc/udev/rules.d/ and the relevant `dmesg` lines
- Whether predictable network interface names (net.ifnames) are in play

Your job:

1. **Pick the stable attribute** — identify a truly persistent key (ID_SERIAL, ID_WWN, MAC ATTR{address}, KERNELS path) versus an unstable one (kernel name, PCI slot).
2. **Explain the matching scope** — clarify SUBSYSTEM==, KERNEL==, ATTR{} vs ATTRS{} (parent walk), and how ENV{} carries state.
3. **Write the rule** — produce a correct line with NAME=/SYMLINK+= and proper quoting, in a numbered file like 70-persistent-*.rules.
4. **Avoid pitfalls** — warn against renaming NICs to names the kernel may use (eth0), and the NAME-vs-SYMLINK distinction.
5. **Test without reboot** — give the `udevadm test`, `udevadm control --reload`, and `udevadm trigger` sequence.
6. **Validate** — show how to confirm the new name/symlink and check for rule conflicts.
7. **Document** — note the rollback (remove the file, reload, trigger).

Output as: (a) chosen attribute and why, (b) the rule file contents, (c) reload/trigger/verify commands, (d) rollback steps.

Test rules with `udevadm test` and `--trigger` before rebooting; a bad NIC rule can drop the host off the network.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Linux Admins prompts & error guides

Browse every Linux Admins prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.