Bug#845161: udev: "mount: invalid option --" when busybox is not installed

Luca Boccassi luca.boccassi at gmail.com
Mon Nov 21 10:16:50 GMT 2016


On Mon, 2016-11-21 at 10:01 +0000, Simon McVittie wrote:
> On Mon, 21 Nov 2016 at 09:50:39 +0100, Martin Pitt wrote:
> > Michael Biebl [2016-11-21  1:15 +0100]:
> > > Am 21.11.2016 um 00:50 schrieb Simon McVittie:
> > > > Because udev's initramfs hook now does "mount --move", it doesn't work with
> > > > klibc mount, which is used when busybox isn't installed:
> > > 
> > > 
> > > This was changed as a response to
> > > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844775
> > > 
> > > Luca, you wrote that initramfs-tools is now using mount from util-linux,
> > > but I can't find anything in the initramfs-tools changelog
> 
> For what it's worth, initramfs-tools in Debian hasn't changed since April,
> and appears to use "mount -o move" unconditionally in its own files
> (for example in /init, to move /run to /root/run). So it might be best to
> just revert that change and stick to "mount -o move", which is known to
> work in both busybox and klibc mount.
> 
> I can't help wondering why we support three different mount
> implementations here, rather than mandating a preferred implementation.
> 
> For what it's worth, dracut appears to install the "full-fat" util-linux
> mount binary from the host system rather than trying to use statically
> linked or otherwise minimal binaries.

Hello Simon, Martin and Michael,

First of all, sorry for the breakage!

The context is a squashfs and liveboot/build based ISO. When rebasing
from Jessie to Stretch I encountered this issue as described in the
original bug. Booting was broken. I tracked it down to the mount in the
init-bottom/udev script. Changing from -o move to --move fixed it.

I don't pick the mount utility in any of my scripts or configs, so I do
not know when or where the change happened, could have been anytime
since Jessie was released. But I am 100% sure that it's the util-linux
one being used in this case, as proved by the fact that --move fixed the
boot process.

Of course as you all pointed out this won't work with klibc mount and it
needs to be fixed. But please if possible don't revert, as it will break
again virtual filesystem based images.

> > -# move the /dev tmpfs to the rootfs
> > -mount -n --move /dev ${rootmnt}/dev
> > +# move the /dev tmpfs to the rootfs; fall back to klibc mount that does not
> > +# understand --move
> > +mount -n --move /dev ${rootmnt}/dev || mount -n -o move /dev ${rootmnt}/dev
> 
> This looks fine as a short-term answer.
> 
> Longer-term, it would be great if we had a specification for how a
> suitable mount implementation for the initramfs must behave, or a consensus
> on which mount implementations had to be supported, or even a requirement
> that potential mount implementors (klibc or busybox or util-linux) define
> a mount_move() shell function or something.
> 
> (An alternative long-term direction would be defaulting to dracut, which
> has the advantage of not being Debian-specific.)

Martin, for completeness I just tested the change above and as expected
everything still works on squashfs + liveboot, so +1 from me :-)

Simon, having a standardised approach would be very welcome indeed!
Having all implementations of mount offer the same options would be an
easy starting point I guess, but having a well-defined spec as you
suggested would be even better.

Thank you all for your help.

Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20161121/708deb68/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list