1822040 Members
3431 Online
109640 Solutions
New Discussion юеВ

.nfs files

 
SOLVED
Go to solution
Glenn Wagner
Advisor

.nfs files

Can someone explain what causes .nfs#### files to be created? I have seen these files a couple of times and sometimes they are quite large (1.3 GB is the largest I have seen). These files do not seem to contain anything important. Also, is there any significance to the numbers after the .nfs in the file name? Any help would be appreciated.

GW
2 REPLIES 2
Frederic Soriano
Honored Contributor
Solution

Re: .nfs files

I found an old post from Steve Fosdick that may explain .nfsXXXX files on mounted NFS filesystems:

"This is tied up with the UNIX delete file semantics, and the fact that
NFS is a stateless protocol.

UNIX allows a file to be deleted when it is still open. The directory
entry for the file is removed at delete time, and hence the file
appears to have gone for anyone trying to open it afresh. The inode
and disk blocks are retained until the last process closes the file,
thus allowing processes which still have it open to carry on using it.

NFS does not support the operation of opening and closing files, so
the NFS server will open a file when it is accessed by the client,
then some time after the last client has appeared to use it it will
close the file. There is now way for the server to know whether one
of the clients still has the file open.

So, when a client deletes the file, the server cannot actually delete
it for some time, because it doesn't know whether it will still get
requests to read/write that file from processes on the client which
still have it open, yet it should return a "No such file or directory"
error to any new process which tries to access the file.

The way it handles this is to rename the file to a temporary name such
as you have seen, and remember which clients still have access to it.

You can delete them, if you are sure that all the clients which may
have had the original file open have finished with it - difficult to
determine."

What I am doing from time to time, is zeroing these files, as these files may still have a file descriptor on them.

I hope this helps !

Regards.
Nick W
Frequent Advisor

Re: .nfs files

Assuming this is a 10.20 system, there are a couple of patches which you should consider:

PHNE_21375: (s700_800 10.20 NFS/NIS cumulative megapatch)
PHKL_19756: (Buffer:cache:hang:performance:cumulative)

(check for dependencies)

Regards,
Nick