From d6462323d6df4a50d1e774827a7e21a1565bf844 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 2 Sep 2009 13:35:17 +0200 Subject: [PATCH] LVM/DM rules in dracut I've looked at the LVM rules used in dracut just recently and it needs fixing - we should react to change events only for DM devices, so we have to skip vol_id/blkid call on ADD: KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end" Also, MD devices have their own rules, where vol_id/blkid is called and where the symlinks are created (when looking into raw initrd, this is in 64-md-raid.rules). Also, if those rules are meant to be for DM devices only, maybe we should skip symlink creation for the other devices there, to keep the rules clean and straightforward. I think we shouldn't create/recreate symlinks for non-dm devices in LVM/DM rules (..should be in appropriate rules for that type of device): KERNEL!="dm-[0-9]*", GOTO="lvm_end" --- modules.d/90lvm/64-lvm-vol_id.rules | 4 +++- modules.d/90lvm/64-lvm.rules | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules.d/90lvm/64-lvm-vol_id.rules b/modules.d/90lvm/64-lvm-vol_id.rules index faafffa..1e75948 100644 --- a/modules.d/90lvm/64-lvm-vol_id.rules +++ b/modules.d/90lvm/64-lvm-vol_id.rules @@ -6,14 +6,16 @@ SUBSYSTEM!="block", GOTO="lvm_end" ACTION!="add|change", GOTO="lvm_end" +KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end" KERNEL=="dm-[0-9]*", IMPORT{program}="vol_id --export $tempnode" -KERNEL=="md[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" ENV{ID_FS_TYPE}=="LVM2_member", \ TEST!="/tmp/.lvm_scan-%k", \ RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k; /bin/ln -fs /sbin/lvm_scan /initqueue/lvm_scan.sh'" +KERNEL!="dm-[0-9]*", GOTO="lvm_end" + OPTIONS="link_priority=-100" ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules index 702540a..3aef1dd 100644 --- a/modules.d/90lvm/64-lvm.rules +++ b/modules.d/90lvm/64-lvm.rules @@ -6,15 +6,17 @@ SUBSYSTEM!="block", GOTO="lvm_end" ACTION!="add|change", GOTO="lvm_end" +KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end" KERNEL=="dm-[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -KERNEL=="md[0-9]*|md/*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" ENV{ID_FS_TYPE}=="LVM2_member", \ TEST!="/tmp/.lvm_scan-%k", \ RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k; /bin/ln -fs /sbin/lvm_scan /initqueue/lvm_scan.sh'" +KERNEL!="dm-[0-9]*", GOTO="lvm_end" + OPTIONS="link_priority=-100" ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -- 2.7.4