contrib/initramfs: use LVM autoactivation for activating VGs #17125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Currently, when zfs-initramfs is installed on a host, all LVM LVs will be activated on boot, regardless of the respective VG/LV autoactivation settings such as
--setautoactivation n
on an LV. The reason is that a boot script shipped by zfs-initramfs callsvgchange -ay
, which unconditionally activates all LVs. This patch changes the call tovgchange -aay
, which honors autoactivation settings.For context: We encountered this on Proxmox VE (a Debian derivative shipping ZFS focused on virtualization), where it is not uncommon to e.g. boot from ZFS but have additional LVM VGs on external storage, e.g. on a LUN provided by a SAN and accessed via iSCSI/Fibre Channel. We were looking into disabling autoactivation in order to fix a bug, and wondered why
--setautoactivation n
did not appear to have an effect on VGs that are already visible at boot. If you're interested, you can find more details in this patch series.Description
See also the commit message.
One way to reproduce:
a
flag):apt install zfsutils-linux zfs-initramfs
How Has This Been Tested?
Ater running the reproducer above, I applied this patch manually to
/usr/share/initramfs-tools/scripts/local-top/zfs
, updated initramfs, rebooted, and verified that LVtestvg/testlv
is not active.Types of changes
Checking "breaking change" here, as it is technically one on setups which can be considered misconfigured, see the commit message.
Checklist:
I believe the unchecked boxes do not apply here though I'm not 100% sure -- if they do, please let me know. :)
Signed-off-by
.