[Bug 1922295] Re: lvm.conf activation/auto_activation_volume_list not honored, VG is always activated at startup

2021-04-18 Thread Fabian
Hello,

° According to man pages in:
lvm2_2.03.07-1ubuntu1_amd64 -> Ubuntu 20.04 LTS
lvm2_2.03.07-1ubuntu3_amd64 -> Ubuntu 20.10

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 -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:
lvm2_2.03.11-2ubuntu4_amd64 -> Ubuntu 21.04

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.

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

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1922295

Title:
  lvm.conf activation/auto_activation_volume_list not honored, VG is
  always activated at startup

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/1922295/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1922295] Re: lvm.conf activation/auto_activation_volume_list not honored, VG is always activated at startup

2021-04-01 Thread Fabian
** Description changed:

  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 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
  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 deactivated 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 deactivated with vgchange -an tools due to the global/global_filter 
or nor list this tools VG/LV.
+ Can't be deactivated with vgchange -an tools due to the global/global_filter
  
  /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

** Description changed:

  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)
+ (vgchange -aay that honors 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 w