Installation guide

Appendix A. The Device Mapper
94
DM_SUSPENDED: the suspended state of Device Mapper device
DM_UDEV_RULES_VSN: udev rules version (this is primarily for all other rules to check that
previously mentioned variables are set directly by official Device Mapper rules)
The following variables are set in 11-dm-lvm.rules:
DM_LV_NAME: logical volume name
DM_VG_NAME: volume group name
DM_LV_LAYER: LVM layer name
All these variables can be used in the 12-dm-permissions.rules file to define a permission for
specific Device Mapper devices, as documented in the 12-dm-permissions.rules file.
A.3.2. Commands and Interfaces that Support udev
Table A.2, “dmsetup Commands to Support udev” summarizes the dmsetup commands that support
udev integration.
Table A.2. dmsetup Commands to Support udev
Command Description
dmsetup udevcomplete Used to notify that udev has completed processing the rules
and unlocks waiting process (called from within udev rules in
95-dm-notify.rules).
dmsetup udevcomplete_all Used for debugging purposes to manually unlock all waiting
processes.
dmsetup udevcookies Used for debugging purposes, to show all existing cookies
(system-wide semaphores).
dmsetup udevcreatecookie Used to create a cookie (semaphore) manually. This is useful
to run more processes under one synchronization resource.
dmsetup udevreleasecookie Used to wait for all udev processing related to all processes
put under that one synchronization cookie.
The dmsetup options that support udev integration are as follows.
--udevcookie
Needs to be defined for all dmsetup processes we would like to add into a udev transaction. It is
used in conjunction with udevcreatecookie and udevreleasecookie:
COOKIE=$(dmsetup udevcreatecookie)
dmsetup command --udevcookie $COOKIE ....
dmsetup command --udevcookie $COOKIE ....
....
dmsetup command --udevcookie $COOKIE ....
dmsetup udevreleasecookie --udevcookie $COOKIE
Besides using the --udevcookie option, you can just export the variable into an environment of
the process:
export DM_UDEV_COOKIE=$(dmsetup udevcreatecookie)
dmsetup command ...