yum freezes on an NFS mount

Todd Denniston Todd.Denniston at ssa.crane.navy.mil
Thu Mar 27 14:07:11 UTC 2008


Laurent Vaills wrote, On 03/27/2008 04:28 AM:
> Hi.
> 
> On my Fedora box I have defined some NFS mount points like this in my
> /etc/fstab :
> <hostname>:/path/to/exported/dir /nfs/mount-point   nfs   user,hard,intr 0 0
> 
> But sometimes the machine <hostname> is not powered up.
> When I run "yum -y upgrade" it freezes on "Running transaction test" .
> So I decided to strace it and I saw it stops at stat64("/nfs/mount-point",
> ....
> 
> My first question is :
> - Why yum/rpm has to go in that directory ?

Assuming no soft/hard-links are used to obfuscate the location
grep nfs.mount-point /etc/yum.repos.d/*

i.e., do you have a yum repo there?
Or do you have an rpm that installs some files there?

> - What are the correct options to put in the fstab in order not to have any
> process frozen when they try access an NFS directory that does not respond ?
> 
hard,intr - safe but freezes process until server responds
soft      - IO errors to process and process does something sane (in theory)

I highly suggest NEVER use soft with a mount that you have any care for data 
integrity.  I have seen too many _silent_ data corruptions using soft. 
examples of programs that corrupt data on soft: cp, mv, gnome, kde ... well 
pretty much everything.  The probability of corruption increases reasonably 
proportionally with the number of times larger the file is than the 
rsize||wsize, i.e., for my tests ([rw]size=4k) I never saw an error with a 
file smaller than ~8kB, but I _ALWAYS_ saw corruptions with files bigger than 
~100MB.  I am not sure if the TCP variant of NFS would cope better than UDP 
with soft (I think it should), that is something that would have to be tested 
to be really sure.

As suggested in other threads, you might be served by setting up the mount 
using the autofs.  autofs has the quality that if the mount has not been used 
in a while, it is umounted, and if you need it autofs will mount it for you. 
For an NFS server that is not expected to be up all the time autofs makes a 
lot of sense, because you do not have to remember to umount the uses of it 
prior to server shutdown.


-- 
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter




More information about the users mailing list