Skip to content

Commit 7e03d81

Browse files
teiglandjohannbg
authored andcommitted
fix(lvm): ignore expected error message from lvm config
The "lvm config" commands that check the filter settings will often find nothing set and report an error message: "Configuration node devices/filter not found" Direct these messages to /dev/null so they do not appear as noise in system logs.
1 parent f6d83f9 commit 7e03d81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules.d/90lvm/lvm_scan.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ no_lvm_conf_filter() {
5252
# Save lvm config results in /run to avoid running
5353
# lvm config commands for every PV that's scanned.
5454

55-
filter=$(lvm config devices/filter | grep "$filter=")
55+
filter=$(lvm config devices/filter 2> /dev/null | grep "$filter=")
5656
if [ -n "$filter" ]; then
5757
printf '%s\n' "$filter" > /run/lvm/initrd_filter
5858
return 1
5959
fi
6060

61-
global_filter=$(lvm config devices/global_filter | grep "$global_filter=")
61+
global_filter=$(lvm config devices/global_filter 2> /dev/null | grep "$global_filter=")
6262
if [ -n "$global_filter" ]; then
6363
printf '%s\n' "$global_filter" > /run/lvm/initrd_global_filter
6464
return 1

0 commit comments

Comments
 (0)