]> sourceware.org Git - lvm2.git/blame - udev/13-dm-disk.rules.in
tests: aux check for leaked symlinks
[lvm2.git] / udev / 13-dm-disk.rules.in
CommitLineData
e5fa2e44
AK
1# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
2#
3# This file is part of LVM2.
4
252239bd
AK
5# Udev rules for device-mapper devices.
6#
7# These rules create symlinks in /dev/disk directory.
8# Symlinks that depend on probing filesystem type,
9# label and uuid are created only if the device is not
10# suspended.
11
772f7d41 12# "add" event is processed on coldplug only!
48188d71 13ACTION=="remove", GOTO="dm_end"
9c20c7af
PR
14ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
15ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end"
252239bd
AK
16
17SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
18ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
19
21ca92c4 20ENV{.DM_SUSPENDED}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_import"
a1967529 21ENV{.DM_NOSCAN}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_import"
21ca92c4 22ENV{.DM_SUSPENDED}=="1", GOTO="dm_end"
a1967529 23ENV{.DM_NOSCAN}=="1", GOTO="dm_watch"
252239bd 24
6dd70f47 25(BLKID_RULE)
94f77a4d
YW
26GOTO="dm_link"
27
28LABEL="dm_import"
6f44e109 29IMPORT{db}="ID_FS_TYPE"
94f77a4d
YW
30IMPORT{db}="ID_FS_USAGE"
31IMPORT{db}="ID_FS_UUID_ENC"
32IMPORT{db}="ID_FS_LABEL_ENC"
33IMPORT{db}="ID_PART_ENTRY_NAME"
34IMPORT{db}="ID_PART_ENTRY_UUID"
35IMPORT{db}="ID_PART_ENTRY_SCHEME"
36IMPORT{db}="ID_PART_GPT_AUTO_ROOT"
e10f67e9
MW
37
38LABEL="dm_link"
772f7d41 39ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
252239bd 40ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
f09a9927 41ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
c48149cf
PR
42ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
43ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
44ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_GPT_AUTO_ROOT}=="1", SYMLINK+="gpt-auto-root"
252239bd 45
9a0cf1ad 46# Add inotify watch to track changes on this device.
386220ad 47# Using the watch rule is not optimal - it generates a lot of spurious
9a0cf1ad 48# and useless events whenever the device opened for read-write is closed.
39b7d1ba 49# The best would be to generate the event directly in the tool changing
9a0cf1ad
PR
50# relevant information so only relevant events will be processed
51# (like creating a filesystem, changing filesystem label etc.).
52#
53# But let's use this until we have something better...
2f5ddfba 54LABEL="dm_watch"
9a0cf1ad
PR
55OPTIONS+="watch"
56
252239bd 57LABEL="dm_end"
This page took 0.170298 seconds and 6 git commands to generate.