Bug 227903

Summary: mount -f does not work with NFS-mounted file system (such as / on diskless boot system); workaround included
Product: [Fedora] Fedora Reporter: Alexander Aminoff <aminoff>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
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: 2007-04-06 09:38:26 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 Alexander Aminoff 2007-02-08 20:54:36 UTC
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)
nfs-utils-1.0.10-5.fc6
nfs-utils-lib-1.0.8-7.2
initscripts-8.45.7-1

How reproducible:

always

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 
rw,vers=3,rsize=65536,wsize=65536,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=store2
 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 10:41:16 UTC
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=10.34.32.80 0 0
                                       ^^^^^^^^^^^^^^^

Comment 2 Karel Zak 2007-04-06 09:38:26 UTC
The problem has been fixed in util-linux-2.13-0.46 and nfs-utils-1.0.10-6