]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
lvm_scan.sh: use -K when calling lvchange 223/head
authorBryn M. Reeves <bmr@redhat.com>
Wed, 26 Apr 2017 13:15:15 +0000 (14:15 +0100)
committerBryn M. Reeves <bmr@redhat.com>
Wed, 26 Apr 2017 13:15:15 +0000 (14:15 +0100)
The --ignoreactivationskip/-K switch was added to LVM2 in 2.02.99
(July 2013) and is used to control the activation of volumes with
the activation skip flag set: without -K these volumes will be
ignored when 'lvchange -ay $LV' is issued.

This prevents an LVM2 thin-privisioned snapshot from being used
as the root device when booting with rd.lvm.lv=vg/lv since the
activation skip flag is set for these snapshots by default (the
legacy non-thinp snapshots do not set this flag and can already
be activated and used as a root device by specifying appropriate
values for rd.lvm.lv).

This is only used in the rd.lvm.lv case since in that situation
we are activating one or more named LVs specified by the user:
the flag is not given when calling 'vgchange' since this may
cause many unwanted volumes to be activated during early user
space. Users wishing to use a specific snapshot volume should
specify it with 'rd.lvm.lv'.

modules.d/90lvm/lvm_scan.sh

index 8bf086414e23a6b156f2563f250c5c7f64058c7d..61a18b240d647c1e14d8700ca15fba8a5578fd27 100755 (executable)
@@ -114,7 +114,7 @@ if [ -n "$LVS" ] ; then
     info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
     lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo
     for LV in $LVS; do
-        lvm lvchange --yes -ay $lvm_quirk_args $LV 2>&1 | vinfo
+        lvm lvchange --yes -K -ay $lvm_quirk_args $LV 2>&1 | vinfo
     done
 fi