LVM2 now lets you specify precisely which Logical Volumes should be activated at boot time and which ones should not. With the assistance of udev and lvmetad, specified devices are activated automatically as soon as all the Physical Volumes making up the Volume Group appear on the system. LVM2 calls this 'autoactivation' and it is triggered by device hotplug. Currently, it supports non-clustered and complete VGs: the VG must have all its PVs in place to activate the VG/LV.
Before this change, it was not possible to have the VG/LV activated automatically once all the PVs are attached to the system - users had to activate the VG/LV manually by calling vgchange/lvchange -ay on the command line directly. The LVM2 autoactivation feature removes this need.
To make use of the autoactivation, lvmetad must be enabled (global/use_lvmetad=1 LVM2 configuration option). A new LVM2 configuration option has been added that determines which VGs/LVs will be autoactivated: activation/auto_activation_volume_list. By default, if the list is not specified, all volumes are autoactivated. Users can specify VG names, LV names and VG/LV tags in the auto_activation_volume_list.
The 'vgchange/lvchange -a/--activate' command has been enhanced and to support the autoactivation, it recognizes a new '-aa/--activate a' activation option. When using this option, the volumes are activated only if there is a match against the auto_activation_volume_list. In addition, pvscan command also recognizes a new '-a/--activate ay' option that causes the PV to be scanned and if it's the last PV that makes up a VG, the autoactivation is triggered.
The pvscan --cache -aay is called automatically (from udev rules) for each PV that appears in the system.