Questions tagged [udev]

Udev is a Linux process that manages device file entries under /dev

Udev is a Linux system process that manages device names and device file creation. It listens to events from the kernel and adds or removes entries under /dev based on configurable rules.

Further reading

1101 questions
35
votes
5 answers

Difference between sdX and vdX

When I use Ubuntu and CentOS, I see /dev/sda and /dev/vda. So I can't understand what is the different between above two?
31
votes
3 answers

Udev- How do I find out which subsystem a device belongs to?

For example, I have device /dev/sdb. How do I find out it's udev subsystem?
Rucent88
  • 1,880
  • 4
  • 24
  • 37
19
votes
1 answer

List all udev rules (e.g. for a device)?

I want to know how I can list all udev rules. I know that in they can be potentially stored as lines (one line = one rule) in *.rules files in these directories /etc/udev/rules.d /lib/udev/rules.d /run/udev/rules.d /var/run/udev/rules.d Therefore I…
16
votes
1 answer

Udev rule to match any usb storage device

How can I implement udev rules for any USB mass-storage device plugged in, not just for specific one? What should be changed in idVendor, and idProduct? ACTION=="add", SUBSYSTEM=="usb", SYSFS{idVendor}=="0204", SYSFS{idProduct}=="6025", …
16
votes
6 answers

Get device node by major/minor numbers pair

Each device node under /dev has its own major/minor number pair. I know that we can retrieve this pair of numbers from the device node by means of stat, like this: stat -c 'major: %t minor: %T' Or, ls -l also shows these numbers. But how can…
Dmitry Frank
  • 2,738
11
votes
1 answer

Why do the rules in udev/.../rules.d have numbers in front of them

Is it just for convenience or is there some reason for it? Example: cat /etc/udev/conf.d/rules.d/98-kexec.rules
D.Zou
  • 405
10
votes
2 answers

Where is the official udev source and other dev information?

I'm trying to find a changelog or commit history for udevd, but I can't seem to find the official source. Where is that?
Shawn J. Goff
  • 46,081
8
votes
1 answer

What ENV variables can be set in udev rules?

Recently I discovered the ENV{REMOVE_CMD} variable, which removes the need for using the ACTION=="remove" match in the case you need both add and remove. I was trying to find some info on other useful variables that can be set in udev rules, but…
7
votes
2 answers

Why is my udev rule executed three times

I've made a little udev rule that launch a script that make an archive of my ~/Documents directory. That do the job, but when I read the log file, it seems that the archive script is executed 3 times when I plug my key. Here's my…
Mathieu
  • 2,719
7
votes
1 answer

how to find out if kernel or udev created a device node?

Is there any way to find out who created a device node? If it has been udev or the kernel itself? In the specific case of mine, I have two webcams. Nodes created for them are /dev/video0 and /dev/video1. Unfortunately this is not a constant…
7
votes
2 answers

how to write a udev rule to remove a tag?

Is it possible to write a new udev rule that undoes TAG+="uaccess" (removes the uaccess tag) without undoing any of the other tags on a device? If so, how? (I have a device that should be opened by a daemon. Unfortunately, the uaccess tag added in…
5
votes
2 answers

udev rule for usb attach/detach not triggering

I'm running RHEL6 and I'm trying to write a udev rule that is triggered upon plugging in and removing usb devices. I created a file called 80-usb.rules in /etc/udev/rules.d/ and I gave it the following contents (so far nothing too specific, just…
jayhendren
  • 8,384
  • 2
  • 33
  • 58
5
votes
4 answers

UDEV rule when USB flash drive is unplugged

I wrote a rule to automount my USB stick to certain folder but when I unplug it the folder still mounted and when I ls there I see a lot of errors like: Directory bread (block: NNNN) failed I tried to use SUBSYSTEM=="block", ACTION=="remove",…
bakytn
  • 2,951
5
votes
1 answer

What permissions should a udev rule have?

What permissions should a udev rule have for a USB device? 644? 755? For example on Ubuntu I'm looking at this file: /etc/udev/rules.d/99-lpcscrypt.rules
tarabyte
  • 4,296
5
votes
1 answer

What is the purpose of a udev rule?

I'm being asked to add a udev rule for a new USB device I purchased. There doesn't seem to be a dirt simple explanation for why this is necessary or valuable to do. To always map a device to the same path? E.g. Always mount a device as…
tarabyte
  • 4,296
1
2 3 4 5 6 7