On Wed, 2015-12-09 at 20:35 +0000, Ben Hutchings wrote:
> 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" 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.
You need to answer these questions, otherwise I'm just going to close
this bug.
Ben.
> > initramfs-tools (0.92bubuntu78) lucid; urgency=low
> >
> > * hooks/compcache: Escape $-expansions inside <
> >
> > === 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
Klipstein's 4th Law of Prototyping and Production:
A fail-safe circuit will destroy others.Attachment:
signature.asc
Description: This is a digitally signed message part