[Bug 1807499] Re: 30 seconds boot delay when root fs is on lvm

2019-08-08 Thread gongxp
According to your post, I have modified /lib/udev/rules.d/69-lvm-metad.rules 
the line 96, but no.
# the ACTION!="remove", ENV{violently _pv_gone}=="1", 
RUN+="/usr/bin/systemd-run /sbin/ LVM pvscan --cache $major:$minor", GOTO=" 
violently _end"
The ACTION!="remove", RUN+="/sbin/ LVM pvscan --cache $major:$minor --activate 
ay"


Could you please tell me how to modify 
/usr/share/initramfs-tools/scripts/local-top/lvm2 ?

#!/bin/sh

PREREQ="mdadm mdrun multipath"

prereqs()
{
echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac

if [ ! -e /sbin/lvm ]; then
exit 0
fi

lvchange_activate() {
lvm lvchange -aay -y --sysinit --ignoreskippedcluster "$@"
}

activate() {
local dev="$1"

# Make sure that we have a non-empty argument
if [ -z "$dev" ]; then
return 1
fi

case "$dev" in
# Take care of lilo boot arg, risky activating of all vg
fe[0-9]*)
lvchange_activate
exit 0
;;
# FIXME: check major
/dev/root)
lvchange_activate
exit 0
;;

/dev/mapper/*)
eval $(dmsetup splitname --nameprefixes --noheadings --rows 
"${dev#/dev/mapper/}")
if [ "$DM_VG_NAME" ] && [ "$DM_LV_NAME" ]; then
lvchange_activate "$DM_VG_NAME/$DM_LV_NAME"
fi
;;

/dev/*/*)
# Could be /dev/VG/LV; use lvs to check
if lvm lvs -- "$dev" >/dev/null 2>&1; then
lvchange_activate "$dev"
fi
;;
esac
}

activate "$ROOT"
activate "$resume"

exit 0

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

Title:
  30 seconds boot delay when root fs is on lvm

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

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

[Bug 1807499] Re: 30 seconds boot delay when root fs is on lvm

2018-12-08 Thread Eduard Hasenleithner
A the moment I can see following solutions:

(1)
Make the lvchange_activate function in 
/usr/share/initramfs-tools/scripts/local-top/lvm2 a while loop which executes 
the "lvchange" command repeatedly until the root LV appears

(2)
Utilize udevd to create the LV devices while wait-for-root is waiting for the 
root LV to appear. A hack for doing so is to replace in 
/lib/udev/rules.d/69-lvm-metad.rules the line 96
  ACTION!="remove", ENV{LVM_PV_GONE}=="1", RUN+="/bin/systemd-run /sbin/lvm 
pvscan --cache $major:$minor --activate ay", GOTO="lvm_end"
with
  ACTION!="remove", RUN+="/sbin/lvm pvscan --cache $major:$minor --activate ay"

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

Title:
  30 seconds boot delay when root fs is on lvm

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

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