Bug 735551 - mount -n no longer works
Summary: mount -n no longer works
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 15
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
: 735552 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-03 13:10 UTC by Bill C. Riemers
Modified: 2011-09-06 13:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-09-04 02:43:16 UTC
Type: ---

Attachments (Terms of Use)

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

How reproducible:


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:

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.).


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.

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