Bug 735552 - mount -n no longer works
Summary: mount -n no longer works
Keywords:
Status: CLOSED DUPLICATE of bug 735551
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-03 13:20 UTC by Bill C. Riemers
Modified: 2011-09-03 13:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-03 13:21:40 UTC


Attachments (Terms of Use)

Description Bill C. Riemers 2011-09-03 13:20:18 UTC
Description of problem:

I have a number of bind mounts I create on my system with an autofs script.  Since these mounts are not interesting to view when I run a df command or such, I use the -n option in the scripts that create these mounts.  I've been using these same scripts since Fedora Core 6.   I was surprised to find when I ran my df command on Fedora 15 all mount autofs bind mounts were appearing.  There were also many system created /dev and /sys mounts that normally should not show-up.

After investigating I found the problem is that /etc/mtab is now a symbolic link to /proc/mounts.   This trick is fine on a minimal install environment like a live CD or such.  However, on a full install I don't expect the system to trade away functionality just to save a few kilobytes.

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

$ rpm -q --whatprovides /etc/mtab
util-linux-2.19.1-1.4.fc15.x86_64


How reproducible:

100% 

Steps to Reproduce:
1. mkdir /home2
2. mount -n -o bind /home /home2
3. df -a |grep home

  
Actual results:

$ df -a  |grep /home
                      92891128  74916636  13256540  85% /home
                      92891128  74916636  13256540  85% /home2


Expected results:

$ df -a  |grep /home
                      92891128  74916636  13256540  85% /home


Additional info:

The manual page for mount has the following to say about replacing /etc/mtab with a symlink /proc/mounts.  Note particularly the phrase a number of things won't work...

              When  the  proc  filesystem is mounted (say at /proc), the files
              /etc/mtab and /proc/mounts have very similar contents. The  for‐
              mer  has  somewhat  more  information, such as the mount options
              used, but is not  necessarily  up-to-date  (cf.  the  -n  option
              below).  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 using the "user"
              option will fail.

Comment 1 Bill C. Riemers 2011-09-03 13:21:40 UTC

*** This bug has been marked as a duplicate of bug 735551 ***


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