Bug 227903 - mount -f does not work with NFS-mounted file system (such as / on diskless boot system); workaround included
mount -f does not work with NFS-mounted file system (such as / on diskless bo...
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2007-02-08 15:54 EST by Alexander Aminoff
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-06 05:38:26 EDT
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 Alexander Aminoff 2007-02-08 15:54:36 EST
Description of problem:

mount -f does not work as intended (doing nothing but writing an /etc/mtab 
entry) with an NFS-mounted file system.

It appears that this may be a problem where /sbin/mount.nfs does not honor the -
f flag. You can obtain the correct behavior by using -f -i (-i being ignore the 
per-fstype helper).

For an NFS-mounted root FS, this causes problems because line 716 of /etc/rc.d/
rc.sysinit is "mount -f /", for the purpose of writing info about the already 
mounted root FS into /etc/mtab. The workaround is to change that line to "mount 
-f -i /".

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

mount (util-linux 2.13-pre7)

How reproducible:


Steps to Reproduce:
1. mount -n nfs-server:/exported /mnt
2. mount -f /mnt

Actual results:

[root@perlw2 /]# mount -n store2:/vol/vol0 /mnt
[root@perlw2 /]# grep /mnt /etc/mtab 
[root@perlw2 /]# cat /proc/mounts | grep vol0
store2:/vol/vol0 /mnt nfs 
 0 0
[root@perlw2 /]# mount -f store2:/vol/vol0 /mnt
mount.nfs: /mnt is already mounted or busy
[root@perlw2 /]# grep /mnt /etc/mtab 
[root@perlw2 /]# mount -f -i store2:/vol/vol0 /mnt
[root@perlw2 /]# grep /mnt /etc/mtab 
store2:/vol/vol0 /mnt nfs rw 0 0

Expected results:

Additional info:

I am not sure whether to classify this as a bug with mount, mount.nfs, or 
rc.sysinit. I guess from my perspective the important thing was figuring out 
the workaround in rc.sysinit, but the real bug is the misbehavior of mount -f.
Comment 1 Karel Zak 2007-02-09 05:41:16 EST
It's bug in the mount command and also in mount.nfs:

  - the mount calls mount.nfs without the "-f" option.
  - the mount.nfs doesn't work with "-f" correctly (it doesn't update mtab)

I'm not sure if "-i" is the best solution, maybe some mount.<xxx> needs to write
to the mtab an extra information which is specific for the helper. For example:

  knedlo:/mnt/store /mnt/store nfs rw,addr= 0 0
Comment 2 Karel Zak 2007-04-06 05:38:26 EDT
The problem has been fixed in util-linux-2.13-0.46 and nfs-utils-1.0.10-6

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