VGs and LVs have an internal autoactivation flag that specifies whether they should be automatically activated during system initalization or not. The flag can be set with "--setautoactivation y|n" using vgchange and lvchange and can be viewed with "lvs -o +lv_autoactivation". The setting defaults to being enabled. The current lvm init script calls vgchange with "--activate y", forcing activation of all VGs and LVs, regardless of their autoactivation flag. During system initialization "--activate ay" should be used, to honor the autoactivation flag set on VGs and LVs. Use case for this is, that a VG has PVs that are not always present. Disabling autoactivation on the respective LVs currently has no effect, causing the vgchange command and the init script to fail during system initialization. > --- i/sys-fs/lvm2/files/lvm.rc-r1 > +++ w/sys-fs/lvm2/files/lvm.rc-r1 > @@ -102,8 +102,8 @@ start() { > ${lvm_path} vgscan${verbose_command} --config "${config}" --mknodes > [ $? -ne 0 ] && has_errors=1 > > - # Enable all VGs > - ${lvm_path} vgchange${verbose_command} --config "${config}" --sysinit --activate y > + # Enable autoactivation VGs > + ${lvm_path} vgchange${verbose_command} --config "${config}" --sysinit --activate ay > [ $? -ne 0 ] && has_errors=1 > > if _use_lvmlockd ; then
Seems reasonable to me.