Add the DM_DISABLE_UDEV env var instead of setting various options directly. The DM_DISABLE_UDEV env var gets top priority over all existing settings.
Upstream commits: http://git.fedorahosted.org/cgit/lvm2.git/commit/?id=fb8cc7c63f7f5ab9e0d6d2d38f29169346a54087 http://git.fedorahosted.org/cgit/lvm2.git/commit/?id=4891a735d343db26460f1b6218169c458d59f2a1 http://git.fedorahosted.org/cgit/lvm2.git/commit/?id=b13d45d21d616c5512593617bbf5ed4c623805ed http://git.fedorahosted.org/cgit/lvm2.git/commit/?id=ed9751d9fa6638e0cae5aa38727f971eeac6516c
To QA: To test this, use the DM_DISABLE_UDEV=1 environment variable and then try to create/remove dm/lvm devices. This should have the same effect as setting/using: For dmsetup: --noudevsync in dmsetup --noudevrules --verifyudev For LVM2: devices/obtain_device_list_from_udev=0 activation/udev_sync=0 (or --noudevsync lvm2 cmd line option) activation/udev_rules=0 activation/verify_udev_operations=1 You can check that udev is bypassed by: - checking the /dev/mapper dir - the nodes should be created here instead of symlinks - /dev/<vg_name>/<lv_name> should be a symlink to /dev/mapper instead of /dev/dm-X - also checking the udev database, for example: udevadm info --query=all --name=/dev/mapper/vg-lvol0 P: /devices/virtual/block/dm-0 N: dm-0 S: disk/by-id/dm-name-vg-lvol0 S: disk/by-id/dm-uuid-LVM-lLYHEhwf9yDVwsA2KAIj2BGE2Tmrfa59gGQny4UDP2xCa6vl275fepLDPCG8LQLJ E: DEVLINKS=/dev/disk/by-id/dm-name-vg-lvol0 /dev/disk/by-id/dm-uuid-LVM-lLYHEhwf9yDVwsA2KAIj2BGE2Tmrfa59gGQny4UDP2xCa6vl275fepLDPCG8LQLJ E: DEVNAME=/dev/dm-0 E: DEVPATH=/devices/virtual/block/dm-0 E: DEVTYPE=disk E: DM_LV_NAME=lvol0 E: DM_NAME=vg-lvol0 E: DM_SUSPENDED=0 E: DM_UDEV_DISABLE_DM_RULES_FLAG=1 E: DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG=1 E: DM_UDEV_PRIMARY_SOURCE_FLAG=1 E: DM_UDEV_RULES_VSN=2 E: DM_UUID=LVM-lLYHEhwf9yDVwsA2KAIj2BGE2Tmrfa59gGQny4UDP2xCa6vl275fepLDPCG8LQLJ E: DM_VG_NAME=vg E: MAJOR=253 E: MINOR=0 E: SUBSYSTEM=block So no symlink "S:" record for /dev/mapper/vg-lvol0 and /dev/vg/lvol0. And also there are DM_UDEV_DISABLE_{DM, SUBSYSTEM}_FLAG=1 variables set. Compared to udev records *without DM_DISABLE_UDEV*: P: /devices/virtual/block/dm-0 N: dm-0 S: disk/by-id/dm-name-vg-lvol0 S: disk/by-id/dm-uuid-LVM-lLYHEhwf9yDVwsA2KAIj2BGE2Tmrfa59gGQny4UDP2xCa6vl275fepLDPCG8LQLJ S: mapper/vg-lvol0 S: vg/lvol0 E: DEVLINKS=/dev/disk/by-id/dm-name-vg-lvol0 /dev/disk/by-id/dm-uuid-LVM-lLYHEhwf9yDVwsA2KAIj2BGE2Tmrfa59gGQny4UDP2xCa6vl275fepLDPCG8LQLJ /dev/mapper/vg-lvol0 /dev/vg/lvol0 E: DEVNAME=/dev/dm-0 E: DEVPATH=/devices/virtual/block/dm-0 E: DEVTYPE=disk E: DM_LV_NAME=lvol0 E: DM_NAME=vg-lvol0 E: DM_SUSPENDED=0 E: DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 E: DM_UDEV_PRIMARY_SOURCE_FLAG=1 E: DM_UDEV_RULES_VSN=2 E: DM_UUID=LVM-lLYHEhwf9yDVwsA2KAIj2BGE2Tmrfa59gGQny4UDP2xCa6vl275fepLDPCG8LQLJ E: DM_VG_NAME=vg E: MAJOR=253 E: MINOR=0 E: SUBSYSTEM=block The S:mapper/vg-lvol0 and S:vg/lvol0 is there and DM_UDEV_DISABLE_LIBRARY_FALLBACK=1 is set and no DM_UDEV_DISABLE_*_FLAG set.
Also, if you use DM_DISABLE_UDEV=1 and at the same time udevd daemon is running, you should get these warning messages: $ export DM_DISABLE_UDEV=1 $ lvchange -ay vg Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will manage logical volume symlinks in device directory. Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will obtain device list by scanning device directory. Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, device-mapper library will manage device nodes in device directory.
Adding QA ACK based on Comment #2
Verified by setting DM_DISABLE_UDEV and by changing the lvm.conf The behavior is the same, save for the lack of warnings: Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will manage logical volume symlinks in device directory. Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will obtain device list by scanning device directory. Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, device-mapper library will manage device nodes in device directory. Just a note of warning: Even though it is possible, it is highly _not recommended_ mixing the udev and non-udev devices in a VG. This can cause issues later when manipulating those different LVs, especially after deleting the VG which had LVs created in such a combined way (left over orphaned/dangling nodes in /dev and /dev/mapper).
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0501.html