lvm.conf activation/auto_activation_volume_list not honored, VG is always activated at startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
On a freshly installed Ubuntu 20.04 LTS (raw minimal installation) with LVM on LUKS using https:/
/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
The lvm2-activation
generate systemd units at runtime to activate LVM Logical Volumes
(LVs) when global/
These units use vgchange -aay to activate LVs.
(vgchange -aay that honors the activation/
With the following settings in lvm.conf:
/etc/lvm/lvm.conf:
global/
event_activation = 0
activation/
auto_activation
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 deactivated 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 = 0
activation/
auto_activation
activation/
#auto_activatio
>> 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 deactivated with vgchange -an tools
- Can be reactivated due to activation/
/etc/lvm/lvm.conf:
global/
event_activation = 0
global/
global_filter = [ "r|.*sda3|" ]
activation/
auto_activation
>> tools VG/LV is activated at startup => KO
even if vgs do not show the tools VG due to the global/
lvm.conf settings are working because
Can't be deactivated with vgchange -an tools due to the global/
/etc/lvm/lvm.conf:
global/
event_activation = 0
activation/
auto_activation
>> tools VG/LV is activated at startup => KO
even with an empty auto_activation
A process or script bypass and does not honor the activation/
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
Hello,
° According to man pages in: 03.07-1ubuntu1_ amd64 -> Ubuntu 20.04 LTS 03.07-1ubuntu3_ amd64 -> Ubuntu 20.10
lvm2_2.
lvm2_2.
The lvm2-activation -generator is called by systemd(1) on boot to generate systemd units at event_activatio n=0 is set in
runtime to activate LVM Logical Volumes (LVs) when global/
lvm.conf(5). These units use vgchange -ay to activate LVs.
If event_activation=1, the lvm2-activation -generator exits immediately without generating
any systemd units, and LVM fully relies on event-based activation to activate LVs. In
this case, event-generated pvscan --cache -aay commands activate LVs.
° According to man pages in: 03.11-2ubuntu4_ amd64 -> Ubuntu 21.04
lvm2_2.
The lvm2-activation -generator is called by systemd(1) on boot to generate systemd units at event_activatio n=0 is set in
runtime to activate LVM Logical Volumes (LVs) when global/
lvm.conf(5). These units use vgchange -aay to activate LVs.
If event_activation=1, the lvm2-activation -generator exits immediately without generating
any systemd units, and LVM fully relies on event-based activation to activate LVs. In
this case, event-generated pvscan --cache -aay commands activate LVs.
So in Ubuntu 20.04 & Ubuntu 20.10 "These units use vgchange -ay to activate LVs."
and not "vgchange -aay" as in Ubuntu 21.04.
"vgchange -ay" does not honor lvm.conf activation/ auto_activation _volume_ list setting.
it activates everything regardless of lvm.conf settings.
Regards