Comment 0 for bug 1922295

Revision history for this message
Fabian (moocan2112) wrote :

On a freshly installed Ubuntu 20.04 LTS (raw minimal installation) with LVM on LUKS using https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019 as a basis

/dev/sda2 => luks encrypted with LVM
 VG named "ubuntu" and LVM tag "ubuntu_vg"
 LV /boot named boot and LVM tag "ubuntu_vg,boot"
 LV /root named root with LVM tag "ubuntu_vg,root"
 LV /home named home with LVM tag "ubuntu_vg,home"
 LV /swap named swap with LVM tag "ubuntu_vg,swap"
/dev/sda3 => LVM VG named "tools" VG and two LVs

The tools VG and related LVs are always activated at startup despite the settings in /etc/lvm/lvm.conf.

According to lvm2-activation-generator

The lvm2-activation-generator is called by systemd(1) on boot to
       generate systemd units at runtime to activate LVM Logical Volumes
       (LVs) when global/event_activation=0 is set in lvm.conf(5).
       These units use vgchange -aay to activate LVs.
(vgchange -aay that honours the activation/auto_activation_volume_list setting)

With the following settings in lvm.conf:

/etc/lvm/lvm.conf:
global/event_activation
event_activation = 0
activation/auto_activation_volume_list
auto_activation_volume_list = [ "ubuntu", "@ubuntu_vg" ]
activation/volume_list
volume_list = [ "ubuntu", "@ubuntu_vg" ]

>> tools VG/LV is activated at startup => KO
even with journalctl log line: lvm[PID]: pvscan[PID] VG tools skip autoactivation
lvm.conf settings are working because
- Can be desactivated with vgchange -an tools
- Can't be reactivated with vgchange -ay tools due to tools VG/Tags not listed in volume_list

/etc/lvm/lvm.conf:
global/event_activation
event_activation = 0
activation/auto_activation_volume_list
auto_activation_volume_list = [ "ubuntu", "@ubuntu_vg" ]
activation/auto_activation_volume_list
#auto_activation_volume_list = [ "ubuntu", "@ubuntu_vg" ]

>> tools VG/LV is activated at startup => KO
even with journalctl log line : lvm[PID]: pvscan[PID] VG tools skip autoactivation
lvm.conf settings are working because
- Can be desactivated with vgchange -an tools
- Can be reactivated due to activation/volume_list is commented

/etc/lvm/lvm.conf:
global/event_activation
event_activation = 0
global/global_filter
global_filter = [ "r|.*sda3|" ]
activation/auto_activation_volume_list
auto_activation_volume_list = [ "ubuntu", "@ubuntu_vg" ]

>> tools VG/LV is activated at startup => KO
even if vgs do not show the tools VG due to the global/global_filter settings.
lvm.conf settings are working because
Can't be desactivated with vgchange -an tools due to the global/global_filter or nor list this tools VG/LV.

/etc/lvm/lvm.conf:

global/event_activation
event_activation = 0
activation/auto_activation_volume_list
auto_activation_volume_list = [ ]

>> tools VG/LV is activated at startup => KO
even with an empty auto_activation_volume_list [ ] which disable any auto activation.

A process or script bypass and does not honor the activation/auto_activation_volume_list, global/global_filter and global/event_activation settings in lvm.conf at startup and activate all available VG/LV without any trace in boot log.
Any new VG/LV is always activated during startup even if these VG/LV are not related to the running system and configured to be not auto activated.

Regards