Bug 479287 - [RHEL-5.3] mount -a & bind with /proc/mounts linked to /etc/mtab creates doubled entries
[RHEL-5.3] mount -a & bind with /proc/mounts linked to /etc/mtab creates doub...
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: util-linux (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Karel Zak
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2009-01-08 12:07 EST by Flavio Leitner
Modified: 2010-10-23 02:51 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-13 05:54:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Flavio Leitner 2009-01-08 12:07:07 EST
Description of problem:

The 'mount' manpage suggests that /etc/mtab can be linked to /proc/mounts:
      It is possible to replace
      /etc/mtab by a symbolic link to /proc/mounts, and especially  when  you
      have  very large numbers of mounts things will be much faster with that
      symlink, but some information is lost that way, and in particular work-
      ing  with the loop device will be less convenient, and using the "user"
      option will fail.

The problem happens when you run 'mount -a' and /etc/fstab contains entries
using 'bind' option. The result is multiple mounts, see below:

# grep rhel4 /etc/fstab
/tmp  /rhel4/tmp    ext3    defaults,bind    1 1

I did the symlink manually
# ls -la /etc/mtab
lrwxrwxrwx 1 root root 12 Jan  8 14:18 /etc/mtab -> /proc/mounts

# grep 'rhel4/tmp' /etc/mtab

# mount -a
# grep 'rhel4/tmp' /etc/mtab
/dev/root /rhel4/tmp ext3 rw,data=ordered 0 0
# mount -a
# grep 'rhel4/tmp' /etc/mtab
/dev/root /rhel4/tmp ext3 rw,data=ordered 0 0
/dev/root /rhel4/tmp ext3 rw,data=ordered 0 0

There is a upstream thread about this:

and also an old bugzilla:
with analysis on comment#2 and a suggested patch.

Version-Release number of selected component (if applicable):

How reproducible:

Actual results:
Multiple mounts events

Expected results:
Just one mount event
Comment 1 Flavio Leitner 2009-01-08 12:10:29 EST
This bugzilla is interesting too:

Note You need to log in before you can comment on or make changes to this bug.