Tag Info

Hot answers tagged

45

# udevadm control --reload-rules


30

These /dev nodes appear because the standard PC serial port driver is compiled into the kernel you're using, and it is finding UARTs. That causes /sys/devices/platform/serial8250 (or something compatible) to appear, so udev creates the corresponding /dev nodes. These UARTs are most likely one of the many features of your motherboard's chipset. Serial UARTs ...


24

Udev uses the inotify mechanism to watch for changes in the rules directory, in both the library and in the local configuration trees (typically located at /lib/udev/rules.d and /etc/udev/rules.d). So you don't need to do anything when you change a rules file. You only need to notify the udev daemon explicitly if you're doing something unusual, for example ...


18

On many devices, the main operations are to send bytes from the computer to a peripheral, or to receive bytes from a peripheral on the computer. Such devices are similar to pipes and work well as character devices. For operations that aren't reading and writing (such as flow control on a serial line), the device provides ad-hoc commands called ioctl. Some ...


14

Responding to the "[a] way to tell that a monitor has been plugged in" part of the question: The support still varies quite a bit, but with recent kernels there is some support for generating udev events when a display hotplug occurs. With kernel 2.6.38 and ATI X1400 hardware, I get an event the first time I connect a VGA display but no events on subsequent ...


13

The kernel lists them by name in /sys, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net. E.g.: > ls /sys/class/net em1 lo wlp6so Another example: > ls /sys/class/net lo p6s1 wlan0 If you are not sure which is ...


11

They're different devices. /dev/sda is the first disk that's either SCSI or (more likely) providing the SCSI drive API to user land. This includes SATA drives and IDE drives using libata. This can also be an IDE/SATA/SCSI/etc. drive emulated by the hypervisor. /dev/vda is the first disk using the virtualization-aware disk driver. The performance should be ...


11

There are various alternatives to udev out there. Seemingly Gentoo can use something called mdev. Another option would be to attempt to use udev's predecessor devfsd. Finally, you can always create all the device files you need with mknod. Note that with the latter there is no need to create everything at boot time since the nodes can be created on disk and ...


9

I'm using this simple (homemade) script that keeps polling RandR and switches between LVDS1 and VGA1 when VGA gets connected/disconnected. It's a dirty solution, yet it's working just fine. It's customized for my setup: you'll most likely need to change RandR output names (LVDS1 and VGA1) and unlike me you'll probably be fine with your RandR default mode ...


9

For the first part of the question, I've looked and couldn't find a better way to detach a USB driver than what you're already doing with libusb. As for the second part of the question, udev can react to driver loading, but not force a specific driver to be assigned to a device. Every driver in the Linux kernel is responsible for one or more devices. The ...


9

The walk is over the different software components (drivers) that handle the device; this corresponds by and large to the hardware devices and buses that are involved in connecting to the device. This is mostly unrelated to the physical arrangement of the devices: most of them are inside the same chip anyway. Taking this example from the top: First we ...


8

The AT&T/Solaris "Transport Level Interface" (TLI) way of doing TCP/IP networking has special files like "/dev/tcp" or "/dev/udp". The programmer opens that special file to get a socket of an appropriate protocol family. I think that's why you have to have "-lnsl" when compiling a program that uses sockets on Solaris: underneath it all it's TLI.


8

Regarding a tool which can store monitor configuration profiles on a per-user and per-display basis, autorandr will do exactly that. https://github.com/wertarbyte/autorandr. My laptop has an NVIDIA card, so I use the disper backend instead of xrandr: http://willem.engen.nl/projects/disper/. Autorandr will use disper as the backend to manage your monitors if ...


8

On Debian (and hopefully your distro as well) all the LVM metadata is already loaded into udev (by some of the rules in /lib/udev/rules.d). So you can use a rules file like this: $ cat /etc/udev/rules.d/92-local-oracle-permissions.rules ENV{DM_VG_NAME}=="vgRandom" ENV{DM_LV_NAME}=="ora_users_*" OWNER="oracle" ENV{DM_VG_NAME}=="vgRandom" ...


8

Put a line like this in a file in /etc/udev/rules.d: KERNEL=="sd*", ATTRS{vendor}=="Yoyodyne", ATTRS{model}=="XYZ42", ATTRS{serial}=="123465789", RUN+="/pathto/script" Add a clause like NAME="subdir/mydisk%n" if you want to use a custom entry path under /dev. Run udevadm info -a -n sdb to see what attributes you can match against (attribute=="value").


8

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show


8

Modern Linux kernels support the devtmpfs file system (do not confuse with ancient devfs), which creates all device nodes dynamically as soon as the kernel discovers them. (In fact, latest udev releases require this; you'll find that udev doesn't create any device nodes anymore, only symlinks.) Similarly, firmware loading has been moved into the kernel as ...


7

This was tested on a laptop with a i915 drived graphic card. Definitively, in my config/install, there are not. :-( When a new screen is plugged, no event is sent to the host! (This stay true after my last edit!) So the only way is to use pooling... Trying to make them lighter as possible... Last Edit : Finaly there is one better solution (through ...


7

Figured there should be a much easier way to address such a common problem, and there is. Here's what I tried on my wheezy/sid server: sudo apt-get install usbmount Plug in usb stick, done! My stick is now accessible through /media/usb. Btw, usbmount doesn't have a man page, please read /usr/share/doc/usbmount/README.gz instead. It seems usbmount ...


7

Firstly, make sure that dbus and consolekit are running -- usually this means prepending ck-launch-session dbus-launch to your exec statement. You will also want to check that your user is in the storage group (you can check with groups). Most distributions ship with the storage group's policies configured on install, but in case they aren't, you may want ...


7

The files in /dev are actual devices files which UDEV creates at run time. The directory /sys/class is exported by the kernel at run time, exposing the hierarchy of the hardware through sysfs. From the libudev and Sysfs Tutorial excerpt On Unix and Unix-like systems, hardware devices are accessed through special files (also called device files or ...


7

Ok, the summary is that Nautilus uses GVFS and you need to tell udev to use GVFS too when reading the fstab entries, you can do this using: /dev/block-device /mount/point auto x-gvfs-show,ro 0 0 x-gvfs-show will tell udev and anyone interested to use the GVFS helper to mount the filesystem, so gvfs has all the control mounting, umounting, moving mount ...


6

One possibility is to add your own udev rule for this partition, that overrides the default ones. On Ubuntu 10.04 /lib/udev/rules.d/80-udisks.rules has some default rules that make udisks ignore some partitions (e.g. partitions that are known to be rescue partitions etc.) which might be an inspiration... On Ubuntu 10.04 your own rules should go into ...


6

I looked into /lib/udev/rules.d for examples of disk related rules. On an Ubuntu system one rule file provides the environment variable ID_FS_UUID_ENC which you can use in own rule files. Thus I put a custom rule file under /etc/udev/rules.d/foodevice.rules. Since it is not prefixed with a number, it is ran at last by udev. Btw, the udev daemon watched ...


6

udev outputs logging information to /var/log/messages, but by default it only logs errors, and it happens you've constructed a command that doesn't do what you want, but also doesn't error out. The >> redirection is handled by your shell, and udev doesn't run the command through a shell, so it's literally running the binary /bin/echo and passing it the ...


6

On CentOS, I don't get udev messages when I plug in a simple USB thumbstick. Instead I get: [sdb] Assuming drive cache: write through a couple of times. But this isn't udev, or syslog mentioning this to you on the console. You could know this for sure yourself, by killing syslogd or rsyslogd (Please make sure this isn't a production server, which I hope ...


6

I assume you're referring to this paragraph: Unlike traditional Unix systems, where the device nodes in the /dev directory have been a static set of files, the Linux udev device manager dynamically provides only the nodes for the devices actually present on a system. Although devfs used to provide similar functionality, Greg Kroah-Hartman cited a number ...


6

/dev/sdx and /dev/hdx are physical (hard) disk drives or emulated physical (hard) disk drives. When the kernel or some program I/O's to these, it does all sorts of things like bringing the disk to the right spot and doing all sorts of physical-specific "stuff." /dev/vdx is for virtual (hard) disk drives. All the kernel does when it is I/O'd to is tell the ...


5

This is Linux specific: A hotplug event handler will register with the kernel to receive hotplug events either over a netlink socket or by echoing its path to /proc/sys/kernel/hotplug. It will then receive information over the socket (netlink) or via being launched with environment variables (/proc.../hotplug). Usually, udev is this handler. When udev gets ...


5

Mailing list archives: http://www.spinics.net/lists/hotplug/ Git repository: http://git.kernel.org/?p=linux/hotplug/udev.git;a=summary Documentation: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/ It's also in the source.



Only top voted, non community-wiki answers of a minimum length are eligible