Red Hat Bugzilla – Bug 168384
extra_opts not parsed before calling nfsmount in anaconda
Last modified: 2007-11-30 17:07:20 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050909 Red Hat/1.0.6-1.4.2 Firefox/1.0.6
Description of problem:
The NFS client code in Anaconda/Loader relies on the kernel to determine the best mount options. This is not ideal in most networks. For example, the kernel defaults to rsize=32768,wsize=32768,udp on my network and this causes very painful installs. I wanted to be able to mount with tcp and or reduce the rsize and wsize, so I wrote a patch.
The NFS client code in isys/nfsclient.c allows for extra_opts to be defined and passed to the NFS mount (i.e. rsize, wsize, tcp). However, the isys/imount.c function doPwMount does not accept an argument with mount options. This proposed patch adds a new argument to doPwMount char * extra_opts. This is only used in the loader2/nfsinstall.c file. All other calls to doPwMount pass NULL as an extra_opts argument.
This patch adds char * nfsmountopts to the loaderData struct and takes anything passed on /proc/cmdline and sticks it into loaderData->nfsmountopts. This then gets passed to doPwMount extra_opts.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install RHEL 4 via NFS
2. cat /proc/mounts
3. /mnt/source is mounted rsize=32768,wsize=32768,udp.
Actual Results: Install takes longer on any busy network because a loss of a single 32K UDP packet causes a full retransmission of the packet.
Expected Results: Reduced rsize/wsize (like older releases of RHEL) or using the tcp mount option would be ideal.
This is also an Issue Tracker 79818.
Created attachment 118859 [details]
Patch adding nfsmountopts cmdline option to Anaconda
Per my mail to anaconda-devel-list...
I'd rather try to approach this from a less brute force approach. As it
stands now, the number of arguments to doPwMount is getting fairly
If we're going to make changes to doPwMount, we should probably make it
closer to just a wrapper of mount(2). The various integer flags should
probably become a bitmask. The account and password arguments are only
there for (obsolete) SMB support, so should just be dropped. Instead of
adding an NFS specific option, maybe doing just a pointer to fs specific
options makes more sense. I'll probably do this later tonight now that
I've written out a description of it ;)
For the other side of things, I'd rather see the nfs options in the
'nfs' kickstart directive and with special handling in ks=nfs:... rather
than making another bit of global data. Although this doesn't help the
interactive case right now, we'll probably going to have to do something
for when we add NFSv4 support anyway, so this is a logical step to move
things in the right direction.
I understand this approach going forward in Anaconda CVS HEAD, but what about
RHEL 4? :) Is there any chance your completely-revamped doPwMount could be
back-ported to RHEL4 Anaconda? If not, I'd like separate consideration for my
patch (or a similar tweak) just on the RHEL 4 branch. Thanks.
The changes to doPwMount() probably wouldn't make sense to push back to RHEL4,
but doing things right as far as handling of where to get the options does to
avoid one-off ways of specifying things.
Also, have to get it right on HEAD before its really viable to push back in an
Created attachment 128364 [details]
allow specification of NFS mount options for kickstart
This patch provides per-mount specification of NFS mount options during
kickstart installs. For kickstart (ks.cfg) we add the an option to the nfs
directive (opts), eg:
nfs --server=filer --dir=/inst/fc5 --opts="rsize=8192,wsize=8192"
NOTE: this obviously doesn't affect the options used when grabbing the
ks.cfg since we won't have seen the above line at that point
For the command line ks=nfs specifier, we add the options into the argument,
NOTE: this only sets the mount options for the mount of filer:/inst to
The patch is fairly simple, but untested. If someone can has an FC5 devel box I
can play with I'll be happy to test it.
Tested Dave's patch against HEAD and it seems to work, so committed to HEAD.
Based on successful integration of support for doing this into the development
tree, I've gone ahead and merged Brian's initial patch into the rhel4 branch.
NOTE NOTE NOTE: that syntax will *ONLY* be valid in RHEL4 updates. Future
releases will follow the syntax as outlined in comment #9.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.
*** Bug 169851 has been marked as a duplicate of this bug. ***
We use EL3u7 and would love to be able to parse the NFS client options to force
the use of tcp and NFSv3. Could this be backported to EL3 in time for update 9?