HomeFreeBSD

contrib/initramfs: use LVM autoactivation for activating VGs (#17125)

Description

contrib/initramfs: use LVM autoactivation for activating VGs (#17125)

Currently, the zfs initramfs-tools boot script under local-top calls
vgchange -ay, which unconditionally activates all logical volumes
(LVs) in all discovered volume groups (VGs). This causes all LVs to be
active after boot. However, users may prefer to not activate certain
VGs/LVs on boot. They might normally use the --setautoactivation n
VG/LV flag or the auto_activation_volume_list LVM config option to
achieve this, but since the script unconditionally activates all LVs,
neither has an effect.

To fix this, call vgchange -aay instead. This triggers LVM
autoactivation, which honors autoactivation settings such as the
--setautoactivation flag. It is also more in line with the LVM
documentation, which says autoactivation is "meant to be used by
activation commands that are run automatically by the system" [1].

Note that this change might break misconfigured setups that have ZFS
on top of an LV for which autoactivation is disabled.

[1] https://gitlab.com/lvmteam/lvm2/-/blob/cff93e4d/conf/example.conf.in#L1579

Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>

Details

Provenance
Friedrich Weber <56110206+frwbr@users.noreply.github.com>Authored on Apr 1 2025, 11:07 PM
GitHub <noreply@github.com>Committed on Apr 1 2025, 11:07 PM
Parents
rG87f8bf6b0c4d: Multiple printf() size fixes (#17199)
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG047803e9062f: contrib/initramfs: use LVM autoactivation for activating VGs (#17125) (authored by Friedrich Weber <56110206+frwbr@users.noreply.github.com>).Apr 1 2025, 11:07 PM