Linux

Where Are udev Rules Stored?

System and local directories for udev rules files on Linux.

Last updated

udev reads rules from system directories, the runtime directory, and the local admin directory. All files are sorted together in lexical order.

Custom rules belong in /etc. System files should not be edited in place because package updates replace them.

Where udev stores this, by platform

Linux
/etc/udev/rules.d

Local admin rules, highest priority. Files must end in .rules, commonly numbered like 99-custom.rules. Same filename in /etc overrides /run and /usr/lib. A symlink to /dev/null with the same name disables the matching system file. Reload with udevadm control --reload-rules and trigger with udevadm trigger after changes.

Linux
/usr/lib/udev/rules.d

Packaged system rules (also visible as /lib/udev/rules.d on systems where /lib is a symlink to /usr/lib, plus /usr/local/lib/udev/rules.d on some builds). Volatile overrides live in /run/udev/rules.d. Copy a system file to /etc/udev/rules.d with the same name to customize it instead of editing the /usr copy.

Frequently asked questions

Why did my rule not apply?

Check extension (.rules required), lexical order, syntax with udevadm test, and whether an /etc file with the same name shadows another file. Then reload rules and re trigger the device.

Is /lib/udev/rules.d different from /usr/lib/udev/rules.d?

On modern merged usr systems /lib points to /usr/lib, so they are the same directory. Use the /usr/lib path in documentation and check /etc and /run for active overrides.

Notice an outdated path? Let us know.