Wired behaviour about the 'global_filter' configuration in `lvm.conf`

flying_tiantian

New Member
Jun 9, 2020
6
3
3
29
There is a tutorial about configuring the `global_filter` in `lvm.conf` to spin down some disks, please see Disk prevent from spinning down because of pvestatd.

But after adding `"r|/dev/sdb*|"` to the `global_filter`, it appears that `vgscan` does not scan `/dev/sda` neither, and causes problems.

Is this behaviour expected? If so, what is the proper way to only filter `/dev/sdb*` devices?
 
  • Like
Reactions: alois
Hi,

can you post the full global_filter line in use now?

Thanks for replay.

The default value is `global_filter = [ "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" "r|/dev/mapper/.*-(vm|base)--[0-9]+--disk--[0-9]+|" ] `.

I want to filter my HDD (/dev/sdb*) and change it to `global_filter = [ "r|/dev/sdb*|", "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" "r|/dev/mapper/.*-(vm|base)--[0-9]+--disk--[0-9]+|" ] `.

But under this configuration I find that `/dev/sda3` is also skipped by vgscan (`dstat -D sda` shows no data read) and vgscan cannot find any volume group (there is a volume group on sda3).

So I manually add `/dev/sda3` to the accept list by changing the configuration to `global_filter = [ "a|/dev/sda|", "r|/dev/sdb*|", "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" "r|/dev/mapper/.*-(vm|base)--[0-9]+--disk--[0-9]+|" ] `.

And this works fine, vgscan can find the volume group on sda3 and correctly skip /dev/sdb* .
 
The global filter is a list of regular expressions - '/dev/sdb*' matches '/dev/sd' as well and thus /dev/sda too.
try '/dev/sdb.*'
 
  • Like
Reactions: alois