[pve-devel] [PATCH lvm 1/2] filter zvols and pve vg in lvm.conf

Dominik Csapak d.csapak at proxmox.com
Fri Aug 19 14:48:04 CEST 2016


the filter syntax is a regex, so use .* instead of *
also filter /dev/mapper/pve, our default volume group
(because of nested lvm)

and also use the global_filter setting for this

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 patchdir/filter_zvols_and_pve_vg_in_lvm.conf.patch | 21 +++++++++++++++++++++
 patchdir/filter_zvols_in_lvm.conf.patch            | 14 --------------
 patchdir/series                                    |  2 +-
 3 files changed, 22 insertions(+), 15 deletions(-)
 create mode 100644 patchdir/filter_zvols_and_pve_vg_in_lvm.conf.patch
 delete mode 100644 patchdir/filter_zvols_in_lvm.conf.patch

diff --git a/patchdir/filter_zvols_and_pve_vg_in_lvm.conf.patch b/patchdir/filter_zvols_and_pve_vg_in_lvm.conf.patch
new file mode 100644
index 0000000..f4bfb05
--- /dev/null
+++ b/patchdir/filter_zvols_and_pve_vg_in_lvm.conf.patch
@@ -0,0 +1,21 @@
+--- a/conf/example.conf.in
++++ b/conf/example.conf.in
+@@ -118,6 +118,9 @@
+     # If lvmetad is used, then see "A note about device filtering while
+     # lvmetad is used" comment that is attached to global/use_lvmetad setting.
+ 
++    # Do not scan ZFS zvols (to avoid problems on ZFS zvols snapshots)
++    filter = [ "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" ]
++
+     # By default we accept every block device:
+     # filter = [ "a/.*/" ]
+ 
+@@ -139,7 +142,7 @@
+     # global_filter. The syntax is the same as for normal "filter"
+     # above. Devices that fail the global_filter are not even opened by LVM.
+ 
+-    # global_filter = []
++    global_filter = [ "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" ]
+ 
+     # The results of the filtering are cached on disk to avoid
+     # rescanning dud devices (which can take a very long time).
diff --git a/patchdir/filter_zvols_in_lvm.conf.patch b/patchdir/filter_zvols_in_lvm.conf.patch
deleted file mode 100644
index d7232fc..0000000
--- a/patchdir/filter_zvols_in_lvm.conf.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: new/conf/example.conf.in
-===================================================================
---- new.orig/conf/example.conf.in
-+++ new/conf/example.conf.in
-@@ -118,6 +118,9 @@ devices {
-     # If lvmetad is used, then see "A note about device filtering while
-     # lvmetad is used" comment that is attached to global/use_lvmetad setting.
- 
-+    # Do not scan ZFS zvols (to avoid problems on ZFS zvols snapshots)
-+    filter = [ "r|/dev/zd*|" ]
-+
-     # By default we accept every block device:
-     # filter = [ "a/.*/" ]
- 
diff --git a/patchdir/series b/patchdir/series
index 24ec03c..e5cbcdc 100644
--- a/patchdir/series
+++ b/patchdir/series
@@ -15,4 +15,4 @@ jessie-remove-udebs.patch
 configure-with-corosync2.patch
 fix-changelog.patch
 fix-symbols.patch
-filter_zvols_in_lvm.conf.patch
+filter_zvols_and_pve_vg_in_lvm.conf.patch
-- 
2.1.4





More information about the pve-devel mailing list