]> sourceware.org Git - lvm2.git/blob - udev/69-dm-lvm-metad.rules
spacing
[lvm2.git] / udev / 69-dm-lvm-metad.rules
1 # Copyright (C) 2012 Red Hat, Inc. All rights reserved.
2 #
3 # This file is part of LVM2.
4
5 # Udev rules for LVM.
6 #
7 # Scan all block devices having a PV label for LVM metadata.
8 # Store this information in LVMetaD (the LVM metadata daemon) and maintain LVM
9 # metadata state for improved performance by avoiding further scans while
10 # running subsequent LVM commands or while using lvm2app library.
11 # Also, notify LVMetaD about any relevant block device removal.
12 #
13 # This rule is essential for having the information in LVMetaD up-to-date.
14 # It also requires blkid to be called on block devices before so only devices
15 # used as LVM PVs are processed (ID_FS_TYPE="LVM2_member" or "LVM1_member").
16
17 SUBSYSTEM!="block", GOTO="lvm_end"
18
19 # Device-mapper devices are processed only on change event or on supported synthesized event.
20 KERNEL=="dm-[0-9]*", ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
21
22 # Set proper sbin path, /sbin has higher priority than /usr/sbin.
23 ENV{LVM_SBIN_PATH}="/sbin"
24 TEST!="$env{LVM_SBIN_PATH}/lvm", ENV{LVM_SBIN_PATH}="/usr/sbin"
25 TEST!="$env{LVM_SBIN_PATH}/lvm", GOTO="lvm_end"
26
27 # Only process devices already marked as a PV - this requires blkid to be called before.
28 ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", RUN+="$env{LVM_SBIN_PATH}/lvm pvscan --cache --major $major --minor $minor"
29
30 LABEL="lvm_end"
This page took 0.038041 seconds and 5 git commands to generate.