summaryrefslogtreecommitdiff
path: root/64-btrfs-dm.rules
diff options
context:
space:
mode:
Diffstat (limited to '64-btrfs-dm.rules')
-rw-r--r--64-btrfs-dm.rules10
1 files changed, 10 insertions, 0 deletions
diff --git a/64-btrfs-dm.rules b/64-btrfs-dm.rules
new file mode 100644
index 00000000..b2e49f4e
--- /dev/null
+++ b/64-btrfs-dm.rules
@@ -0,0 +1,10 @@
+SUBSYSTEM!="block", GOTO="btrfs_end"
+KERNEL!="dm-[0-9]*", GOTO="btrfs_end"
+ACTION!="add|change", GOTO="btrfs_end"
+ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end"
+
+# Once the device mapper symlink is created, tell btrfs about it
+# so we get the friendly name in /proc/mounts (and tools that read it)
+ENV{DM_NAME}=="?*", RUN{builtin}+="btrfs ready /dev/mapper/$env{DM_NAME}"
+
+LABEL="btrfs_end"