[Bug 802626] Re: boot hangs at initrd
Eduard Hasenleithner
eduard at hasenleithner.at
Sun Aug 21 12:16:10 UTC 2011
In my opinion, there is a fundamental problem wrt interworking between
udev and lvm during the init phase. Looking at scripts and source code I
found nothing which prevents the following to happen:
1) kernel boots with initial ramdisk
2) udevd of initial ramdisk is started by initrd.img/scripts/init-top/udev
3) udevd handles the initial events of the block devices (partitions) produced by "udevadm trigger --action=add ..." invoked by "initrd.img/scripts/init-top/udev". Please note that this is executed in the background using "&".
4) /lib/udev/rules.d/85-lvm2.rules intercepts add events for LVM partitions and issues "watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'"
5) "lvm vgchange -a y" sends a LV resume request to the device-mapper in the kernel and waits for completition notification by udevd via semaphore
6) initrd.img/scripts/init-bottom/udev gets executed which invokes "udevadm control --exit". After this point, the initrd-udevd is not handling events anymore.
7) kernel delivers the mapper-task-completion-event to udevd which does not handle events anymore, and therefore does not decrement the semaphore
8) having already waited 60 seconds (event_timeout) for "watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'" to complete, udevd just gives up and continues termination
9) according to udev-173/udev/udevd.c:1631 the remaining queued events (including the semaphore decrement) are discarded by means of "event_queue_cleanup".
10) after termination of udevd "udevadm control --exit" also terminates and the boot process continues
In the end, the rootfs-udevd does not see the semaphore decrement event
anymore, so "lvm vgscan -a y" still hangs. Some other bugs like #631795
#797226 #581566 might be related to this timing problem.
Also adding udev to the bug. Please set to invalid if e.g. lvm is
required to wait for the logical volume setup to finish in
initrd.img/scripts/init-premount/lvm2.
** Also affects: udev (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to udev in Ubuntu.
https://bugs.launchpad.net/bugs/802626
Title:
boot hangs at initrd
Status in “lvm2” package in Ubuntu:
Confirmed
Status in “udev” package in Ubuntu:
New
Bug description:
The system is now unable to boot.
I had to boot on previous kernel 3.0.0.
Symptoms are boot freezes. When debugging, issuing a vgscan works ok.
doing the vgchange -a y just hangs. I need to reboot the system afterwards.
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: lvm2 2.02.66-4ubuntu2
ProcVersionSignature: Ubuntu 3.0-0.1-generic 3.0.0-rc2
Uname: Linux 3.0-0-generic x86_64
Architecture: amd64
Date: Mon Jun 27 18:15:46 2011
ProcEnviron:
LANGUAGE=fr_FR:en
PATH=(custom, user)
LANG=fr_FR.utf8
LC_MESSAGES=fr_FR.UTF-8
SHELL=/bin/bash
SourcePackage: lvm2
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/802626/+subscriptions
More information about the foundations-bugs
mailing list