[linux-lvm] pvscan --cache -aay $device does not activate LV with multiple "legs"

Tom Yan tom.ty89 at gmail.com
Sun Jun 27 13:01:43 UTC 2021


Hi,

I notice that LV with multiple legs (i.e. type raid or similar) is not
auto activated after boot.

After finding out that the activation of LVs mainly relies on
lvm2-pvscan at .service (and the udev rules that make the PVs want their
own instances), wondering whether the issue is due to a race condition
or so, I run the command `pvscan --cache -aay $device` (where $device
is in the form of $major:$minor). It seems that it's simply because
the device-specific run of the command will not activate such LV(s)
anyway:

[tom at archlinux ~]$ sudo lvchange -an /dev/green/meh
[tom at archlinux ~]$ sudo lvs | grep meh
  meh      green rwi---r--- 512.00m
[tom at archlinux ~]$ sudo pvscan --cache -aay /dev/sda2
  pvscan[2064] PV /dev/sda2 online, VG green is complete.
  pvscan[2064] VG green skip autoactivation.
[tom at archlinux ~]$ sudo pvscan --cache -aay /dev/sdb
  pvscan[2066] PV /dev/sdb online, VG green is complete.
  pvscan[2066] VG green skip autoactivation.
[tom at archlinux ~]$ sudo lvs | grep meh
  meh      green rwi---r--- 512.00m

However, if I run the command without a device specified, such LV will
be activated:

[tom at archlinux ~]$ sudo pvscan --cache -aay
  pvscan[2071] PV /dev/sda2 online, VG green incomplete (need 1).
  pvscan[2071] PV /dev/sdb online, VG green is complete.
  pvscan[2071] VG green run autoactivation.
  5 logical volume(s) in volume group "green" now active
[tom at archlinux ~]$ sudo lvs | grep meh
  meh      green rwi-a-r--- 512.00m
100.00

So is this some kind of bug/regression? Or is it intended for some
reason? What I expect would be, when the command is run with any of
the legs of such an LV as the device, it will check whether all legs
of it are available and if so, the LV will be activated.

Regards,
Tom




More information about the linux-lvm mailing list