Installation guide

udev Integration with the Device Mapper
93
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.
The Red Hat Enterprise Linux 6 release provides officially supported udev rules for Device Mapper
devices in general and for LVM as well. Table A.1, “udev Rules for Device-Mapper Devices”
summarizes these rules, which are installed in /lib/udev/rules.d.
Table A.1. udev Rules for Device-Mapper Devices
Filename Description
10-dm.rules Contains basic/general Device Mapper rules and creates the
symlinks in /dev/mapper with a /dev/dm-N target where N
is a number assigned dynamically to a device by the kernel (/
dev/dm-N is a node)
NOTE: /dev/dm-N nodes should never be used in scripts to
access the device since the N number is assigned dynamically
and changes with the sequence of how devices are activated.
Therefore, true names in the /dev/mapper directory should
be used. This layout is to support udev requirements of how
nodes/symlinks should be created.
11-dm-lvm.rules Contains rules applied for LVM devices and creates the
symlinks for the volume group's logical volumes. The symlinks
are created in the /dev/vgname directory with a /dev/dm-N
target.
NOTE: To be consistent with the standard for naming all
future rules for Device Mapper subsystems, udev rules should
follow the format 11-dm-subsystem_name.rules. Any
libdevmapper users providing udev rules as well should
follow this standard.
13-dm-disk.rules Contains rules to be applied for all Device Mapper devices
in general and creates symlinks in the /dev/disk/by-
id, /dev/disk/by-uuid and the /dev/disk/by-uuid
directories.
95-dm-notify.rules Contains the rule to notify the waiting process using
libdevmapper (just like LVM and dmsetup). The notification
is done after all previous rules are applied, to ensure any udev
processing is complete. Notified process is then resumed.
You can add additional customized permission rules by means of the 12-dm-permissions.rules
file. This file is not installed in the /lib/udev/rules directory; it is found in the /usr/share/doc/
device-mapper-version directory. The 12-dm-permissions.rules file is a template containing
hints for how to set the permissions, based on some matching rules given as an example; the file
contains examples for some common situations. You can edit this file and place it manually in the /
etc/udev/rules.d directory where it will survive updates, so the settings will remain.
These rules set all basic variables that could be used by any other rules while processing the events.
The following variables are set in 10-dm.rules:
DM_NAME: Device Mapper device name
DM_UUID: Device Mapper device UUID