[Fwd: Re: Bug: mount: "user" mounts broken when /etc/mtab is a symlink]

Bruce Dubbs bruce.dubbs at gmail.com
Mon Jan 10 10:08:06 PST 2011


 From the util-linux mailing list.  I don't think it will change LFS 
directly becaus ewe don't normally do a mount --bind read only,  but 
changes are coming.

I think the overall goal it to enable /etc to be read-only, but there 
are other problems with that, e.g. passwd, group, etc.

   -- Bruce

-------- Original Message --------
Subject: Re: Bug: mount: "user" mounts broken when /etc/mtab is a symlink
Date: Mon, 10 Jan 2011 15:08:46 +0100
From: Karel Zak <kzak at redhat.com>
CC: util-linux-ng at vger.kernel.org

On Sun, Jan 09, 2011 at 12:37:49PM +0000, Roger Leigh wrote:
> I just wanted to check with you which versions of util-linux-ng would
> work correctly with /etc/mtab removed
[...]
> If 2.19 is required

Yes. Note that "mtab removed" means mtab is symlink to /proc/mounts :-)

> I'd be interested to know how experimental libmount support is.

The code is not well tested.

> i.e. are there any known regressions or failing use cases which we
> should be aware of, or any other reasons not to enable it at this
> point?

Probably the most problematic thing is read-only bind. The problem is
described in the mount man page and this problem is not specific to
2.19, but to all systems without mtab.

with mtab:

     mount --bind olddir newdir
     mount -o remount,ro newdir

without mtab:

     mount --bind olddir newdir
     mount -o remount,ro,bind olddir newdir
                         ^^^^

The another problem is

     mount -o loop /path/foo.img /mnt
     mount | grep /path/foo.img

where the grep command returns nothing on systems without mtab and
with old kernels (< 2.6.37). The latest kernel provides info about
loopdevs in /sys, so mtab is unnecessary.

> Have you removed mtab in Fedora/RedHat yet?

Yes, this is my plan for Fedora rawhide, because mtab is unsupported
by systemd.  On systems without systemd I'd suggest to be conservative
and compile mount without --enable-libmount-mount.

Note that more utils depend on mtab. It's not enough to updated
mount(8) -- the long term goal is to modify also mount.<type> helpers
to use libmount library (this is my goal for this year).  Then we can
say that mtab is really dead.

     Karel

-- 
  Karel Zak  <kzak at redhat.com>
  http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




More information about the lfs-dev mailing list