Bug 735552

Summary: mount -n no longer works
Product: [Fedora] Fedora Reporter: Bill C. Riemers <briemers>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: jonathan, kzak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-03 13:21:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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 ***