Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

There is mention of a device node, when I was reading about LVM. I can't find anything useful as to what it is or functions as. Any help or suggestion of where to look would be appreciated.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

It is basically the /dev/VGname/LVname and /dev/mapper/ ,that it is being created when you create the and LVM structure. It called device node since it is under the /dev node.

So the question is, why is the /dev node it there ? Simple answer is that it is intended to be used as a convenient why for you to specify the device in the fstab file and the like.

The udev system is responsible for the creation of this nodes, and here is some points of why you want it to create them.

The primary role of the udev device manager is to provide a dynamic way of setting up nodes in the /dev directory. The creation of these nodes is directed by the application of udev rules in userspace. These rules are processed on udev events sent from the kernel directly as a result of adding, removing or changing particular devices. This provides a convenient and central mechanism for hotplugging support.

Besides creating the actual nodes, the udev device manager is able to create symbolic links which the user can name. This provides users the freedom to choose their own customized naming and directory structure in the/dev directory, if needed. Each udev event contains basic information about the device being processed, such as its name, the subsystem it belongs to, the device's type, its major and minor number used, and the type of the event. Given that, and having the possibility of accessing all the information found in the /sys directory that is also accessible within udev rules, the users are able to utilize simple filters based on this information and run the rules conditionally based on this information. The udev device manager also provides a centralized way of setting up the nodes' permissions. A user can easily add a customized set of rules to define the permissions for any device specified by any bit of information that is available while processing the event. It is also possible to add program hooks in udev rules directly.

The udev device manager can call these programs to provide further processing that is needed to handle the event. Also, the program can export environment variables as a result of this processing. Any results given can be used further in the rules as a supplementary source of information. Any software using the udev library is able to receive and process udev events with all the information that is available, so the processing is not bound to the udev daemon only.

In Red Hat Enterprise Linux 6 and its clones, the Device Mapper provides direct support for udev integration. This synchronizes the Device Mapper with all udev processing related to Device Mapper devices, including LVM devices. The synchronization is needed since the rule application in the udev daemon is a form of parallel processing with the program that is the source of the device's changes (such as dmsetup and LVM). Without this support, it was a common problem for a user to try to remove a device that was still open and processed by udev rules as a result of a previous change event; this was particularly common when there was a very short time between changes for that device.

share|improve this answer
1  
It is called a device node because that is what it is ( ls -l shows 'b' as the first char of the mode, for block device ), not because it is in the /dev directory. –  psusi Dec 27 '11 at 16:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.