.nfsNN files

Thanks to all who took the time to answer my question regarding .nfsNN

files. Thanks to...

Mark S. Anderson, James M Mosley, Fedor Gnuchev, Dotty Pon, Cheryl L.

Southard, Anthony Clarke, Jens Fischer and Alan Hill

And the winners are!

 ---

Have you noticed this entry in root's crontab (on the server)?

/usr/lib/fs/nfs/nfsfind

This is the contents:

#!/bin/sh

# Copyright (c) 1993 by Sun Microsystems, Inc.

#ident "@(#)nfsfind.sh 1.4 93/05/18 SMI" /* */

#

# Check shared NFS filesystems for .nfs* files that

# are more than a week old.

#

# These files are created by NFS clients when an open file

# is removed. To preserve some semblance of Unix semantics

# the client renames the file to a unique name so that the

# file appears to have been removed from the directory, but

# is still usable by the process that has the file open.

if [ ! -s /etc/dfs/sharetab ]; then exit ; fi

for dir in `awk '$3 == "nfs" {print $1}' /etc/dfs/sharetab`

do

        find $dir -name .nfs\* -mtime +7 -mount -exec rm -f {} \;

done

 ---

The AIX machine may not be allowing you to delete the files because

it detects that they are being used. I know that Sun/Solaris

doesn't bother checking and just deletes whatever you tell it to.

 ---

If you are trying to get rid of the .nfsNN file, then kill the process

that has this file open. The process is most likely on one of the

NFS clients and not on the server, since the server's nfs daemon is

creating these .nfsNN files. If you don't know which process has these files

open, then get the public domain program "lsof" and run it on all your

clients. One of them is bound to have a process that has the .nfsNN

file open. Origionally the .nfsNN file had a REAL name, but one

of the NFS clients attempted to delete this file, and the NFS

daemon on the server moved the file to a different name; This is

to prevent the process with this file open from crashing.

 ---

See 'manb nfsd'

nfsd(1M) Maintenance Commands nfsd(1M)

FILES

     .nfsXXX client machine pointer to an open-but-unlinked

                  file

When an open file is deleted through an NFS call, it is renamed to

.nfsXXX. I am not sure why AIX displays a * aon the end, but I should

have a look at the nfsd man page.

[2578 byte] By [CodeProf.com] at [2007-12-25 9:58:00]