Bug 735551

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

Description Bill C. Riemers 2011-09-03 13:10:44 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:

Comment 1 Bill C. Riemers 2011-09-03 13:21:40 UTC
*** Bug 735552 has been marked as a duplicate of this bug. ***

Comment 2 Karel Zak 2011-09-04 02:43:16 UTC
The mtab has not been removed to save space :-) See for example:
http://permalink.gmane.org/gmane.linux.redhat.fedora.devel/144960

The -n functionality cannot be implemented without mtab. 

Note that the mount(8) command still supports mtab (and -n), so you can remove the symlink, but it does not work correctly with systemd (it does not clean up and update the file after/before boot, etc.).

Sorry, WONTFIX.

Comment 3 Bill C. Riemers 2011-09-06 13:11:13 UTC
OK.  As a workaround I'll modify init.d script for autofs to copy /proc/mounts to /etc/mtab at start-up time.  Then the mtab will be equally accurate /proc/mounts after boot, but still none of my autofs mount using the -n options will show-up in the /etc/mtab.