Serge, I'm sorry this patch hasn't had any attention for so long.
On Thu, 9 Dec 2010 15:20:28 -0600 "Serge E. Hallyn" <serge.hallyn@canonical.com> wrote:
> Here is a patch (against the ubuntu package, just as example)
> which instead of doing a dumb retry loop, waits for udev.
>
> === modified file 'debian/changelog'
> --- debian/changelog 2010-04-26 15:17:47 +0000
> +++ debian/changelog 2010-12-08 21:44:32 +0000
> @@ -1,3 +1,15 @@
> +initramfs-tools (0.92bubuntu79) natty; urgency=low
> +
> + * When using multipath, it is possible that mountroot() will race
> + with udev's renaming of /dev/disk/by-uuid/{rootfs-uuid} from
> + /dev/sd?? to /dev/mapper/something. After multipath has grabbed
> + the /dev/sd?? and until udev completes the rename, mounting
> + /dev/disk/by-uuid/{rootfs-uuid} will fail with -EBUSY. In that
> + case, call 'udevsettle' to wait until udev has finished all its
> + related actions. (Closes LP: #686832)
> +
> + -- Serge Hallyn <serge.hallyn@ubuntu.com> Fri, 19 Nov 2010 12:19:43 -0600
(Bear in mind that I have no experience of using multipath.)
If one path shows up quickly and the other rather later, can't we still
end up mounting the single-path device rather than the multipath
device? How do we tell when multipath discovery is complete?
Does it even make sense to specify a multipath device by UUID rather
than by its device-mapper name? This certainly isn't supported for
LVM.
Ben.
> initramfs-tools (0.92bubuntu78) lucid; urgency=low
>
> * hooks/compcache: Escape $-expansions inside <<EOF (thanks, Eugene San;
>
> === modified file 'scripts/local'
> --- scripts/local 2009-12-21 23:06:53 +0000
> +++ scripts/local 2010-11-20 01:03:26 +0000
> @@ -69,10 +69,19 @@
> # FIXME This has no error checking
> [ -n "${FSTYPE}" ] && modprobe ${FSTYPE}
>
> - # FIXME This has no error checking
> # Mount root
> - mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
> - mountroot_status="$?"
> + tries=0
> + ret=1
> + while [ $tries -lt 2 -a $ret -ne 0 ]; do
> + mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
> + ret=$?
> + if [ $ret -ne 0 ]; then
> + echo "failed attempt $tries to mount $ROOT as root"
> + udevadm settle
> + tries=$((tries+1))
> + fi
> + done
> + mountroot_status=$ret
> if [ "$LOOP" ]; then
> if [ "$mountroot_status" != 0 ]; then
> if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then
>
>
>
>
--
Ben Hutchings
I'm always amazed by the number of people who take up solipsism because
they heard someone else explain it. - E*Borg on alt.fan.pratchettAttachment:
signature.asc
Description: This is a digitally signed message part