On Wed, Mar 20, 2019 at 12:17:08PM -0400, Theodore Ts'o wrote: > On Tue, Mar 19, 2019 at 11:58:24AM +0100, Lukas Czerner wrote: > > > # Find scrub targets, make sure we only do this once. > > > -ls_scrub_targets() { > > > - lsblk -o NAME,FSTYPE,MOUNTPOINT -p -P -n | while read vars; do > > > +ls_scan_targets() { > > > + lvs --name-prefixes -o vg_name,lv_name,lv_path \ > > > + -S lv_active=active,lv_role=public --noheadings | \ > > > > You're not using vg_name, nor lv_name so you can drop it maybe ? Also > > you're missing lv_role since you're checking it later, however you can > > do this instead > > > > -S lv_active=active,lv_role=public -S lv_role!=snapshot > > We don't need to check lv_role at all, since the command already > included: > > -S lv_active=active,lv_role=public You actually need to check the lv_role for snapshot, because snapshot can be "public" as well. > > And we need to do lv_role=public and not lv_role!=snapshot, since we > need to also exclude thinpools. No, you need to check both if you want to exclude snapshots. I think that specifying -S twice tricked you, sorry about that. But again you can do: -S lv_active=active,lv_role=public,lv_role!=snapshot Thanks! -Lukas